From 5c1bd0ff6678e3693d14fd6062b9eb5f6ce90249 Mon Sep 17 00:00:00 2001 From: alteredworlds Date: Fri, 3 Feb 2023 16:37:49 +0000 Subject: [PATCH 01/13] Update docs/ArchitectureLearningJourney.md - Writing data --- docs/ArchitectureLearningJourney.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ArchitectureLearningJourney.md b/docs/ArchitectureLearningJourney.md index 6b6fa4420..9b5a0e6aa 100644 --- a/docs/ArchitectureLearningJourney.md +++ b/docs/ArchitectureLearningJourney.md @@ -192,9 +192,9 @@ Whenever the list of topics changes (for example, when a new topic is added), th To write data, the repository provides suspend functions. It is up to the caller to ensure that their execution is suitably scoped. -_Example: Follow a topic_ +_Example: Follow a set of topics_ -Simply call `TopicsRepository.setFollowedTopicId` with the ID of the topic which the user wishes to follow. +Simply call `UserDataRepository.setFollowedTopicIds` with the set of IDs of the topics the user wishes to follow. ### Data sources From 8e7a65027f02ddbc37ff3922ec10862eeaf70e21 Mon Sep 17 00:00:00 2001 From: alteredworlds Date: Fri, 3 Feb 2023 16:53:43 +0000 Subject: [PATCH 02/13] Update docs/ArchitectureLearningJourney.md - User action follow topic --- docs/ArchitectureLearningJourney.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ArchitectureLearningJourney.md b/docs/ArchitectureLearningJourney.md index 9b5a0e6aa..741c5c424 100644 --- a/docs/ArchitectureLearningJourney.md +++ b/docs/ArchitectureLearningJourney.md @@ -309,7 +309,7 @@ User actions are communicated from UI elements to ViewModels using regular metho **Example: Following a topic** -The `InterestsScreen` takes a lambda expression named `followTopic` which is supplied from `InterestsViewModel.followTopic`. Each time the user taps on a topic to follow this method is called. The ViewModel then processes this action by informing the topics repository. +The `InterestsScreen` takes a lambda expression named `followTopic` which is supplied from `InterestsViewModel.followTopic`. Each time the user taps on a topic to follow this method is called. The ViewModel then processes this action by informing the user data repository. ## Further reading From 6146dd55769bcd67e8365190510a0babee67a04b Mon Sep 17 00:00:00 2001 From: Alex Vanyo Date: Fri, 3 Feb 2023 15:38:48 -0800 Subject: [PATCH 03/13] Switch GMD to use a convention plugin Change-Id: Ia4f94cd7533c9168752ee39e3f960108fe802ab4 --- .github/workflows/AndroidCIWithGmd.yaml | 5 +- .run/Generate Demo Baseline Profile.run.xml | 2 +- benchmarks/build.gradle.kts | 13 ---- .../AndroidApplicationConventionPlugin.kt | 2 + .../kotlin/AndroidFeatureConventionPlugin.kt | 3 + .../kotlin/AndroidLibraryConventionPlugin.kt | 2 + .../kotlin/AndroidTestConventionPlugin.kt | 2 + .../apps/nowinandroid/GradleManagedDevices.kt | 62 +++++++++++++++++++ feature/bookmarks/build.gradle.kts | 14 ----- feature/foryou/build.gradle.kts | 14 ----- feature/interests/build.gradle.kts | 14 ----- feature/settings/build.gradle.kts | 14 ----- feature/topic/build.gradle.kts | 14 ----- 13 files changed, 76 insertions(+), 85 deletions(-) create mode 100644 build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt diff --git a/.github/workflows/AndroidCIWithGmd.yaml b/.github/workflows/AndroidCIWithGmd.yaml index 6721d3aa0..eb890c4d5 100644 --- a/.github/workflows/AndroidCIWithGmd.yaml +++ b/.github/workflows/AndroidCIWithGmd.yaml @@ -10,6 +10,9 @@ jobs: android-ci: runs-on: macos-12 + strategy: + matrix: + device-config: [ "pixel4api30aospatd" ] steps: - uses: actions/setup-java@v3 @@ -23,7 +26,7 @@ jobs: - name: Run instrumented tests with GMD run: ./gradlew cleanManagedDevices --unused-only && - ./gradlew pixel4api30DemoDebugAndroidTest -Dorg.gradle.workers.max=1 + ./gradlew ${{ matrix.device-config }}DemoDebugAndroidTest -Dorg.gradle.workers.max=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true --info - name: Upload test reports diff --git a/.run/Generate Demo Baseline Profile.run.xml b/.run/Generate Demo Baseline Profile.run.xml index 4c34e5a76..a4b0de892 100644 --- a/.run/Generate Demo Baseline Profile.run.xml +++ b/.run/Generate Demo Baseline Profile.run.xml @@ -34,7 +34,7 @@