Skip to content

Commit 34d8262

Browse files
authored
Merge branch 'main' into room-gradle-plugin
2 parents 5f7d4ea + 9234331 commit 34d8262

File tree

32 files changed

+896
-385
lines changed

32 files changed

+896
-385
lines changed

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
- package-ecosystem: "gradle"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
registries: "*"
13+
labels: [ "version update" ]
14+
groups:
15+
kotlin-ksp-compose:
16+
patterns:
17+
- "org.jetbrains.kotlin:*"
18+
- "org.jetbrains.kotlin.jvm"
19+
- "com.google.devtools.ksp"
20+
- "androidx.compose.compiler:compiler"
21+
open-pull-requests-limit: 10
22+
registries:
23+
maven-google:
24+
type: "maven-repository"
25+
url: "https://maven.google.com"
26+
replaces-base: true

.github/renovate.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/Build.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ jobs:
3131
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
3232

3333
- name: Set up JDK 17
34-
uses: actions/setup-java@v3
34+
uses: actions/setup-java@v4
3535
with:
3636
distribution: 'zulu'
3737
java-version: 17
3838

3939
- name: Setup Gradle
4040
uses: gradle/gradle-build-action@v2
4141

42+
- name: Check build-logic
43+
run: ./gradlew check -p build-logic
44+
4245
- name: Check spotless
4346
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
4447

@@ -72,7 +75,7 @@ jobs:
7275
# Run local tests after screenshot tests to avoid wrong UP-TO-DATE. TODO: Ignore screenshots.
7376
- name: Run local tests
7477
if: always()
75-
run: ./gradlew testDemoDebug testProdDebug :lint:test
78+
run: ./gradlew testDemoDebug :lint:test
7679
# Replace task exclusions with `-Pandroidx.baselineprofile.skipgeneration` when
7780
# https://android-review.googlesource.com/c/platform/frameworks/support/+/2602790 landed in a
7881
# release build
@@ -88,14 +91,14 @@ jobs:
8891
-x collectProdNonMinifiedBenchmarkBaselineProfile
8992

9093
- name: Upload build outputs (APKs)
91-
uses: actions/upload-artifact@v3
94+
uses: actions/upload-artifact@v4
9295
with:
9396
name: APKs
9497
path: '**/build/outputs/apk/**/*.apk'
9598

9699
- name: Upload test results (XML)
97100
if: always()
98-
uses: actions/upload-artifact@v3
101+
uses: actions/upload-artifact@v4
99102
with:
100103
name: test-results
101104
path: '**/build/test-results/test*UnitTest/**.xml'
@@ -105,7 +108,7 @@ jobs:
105108

106109
- name: Upload lint reports (HTML)
107110
if: always()
108-
uses: actions/upload-artifact@v3
111+
uses: actions/upload-artifact@v4
109112
with:
110113
name: lint-reports
111114
path: '**/build/reports/lint-results-*.html'
@@ -128,7 +131,7 @@ jobs:
128131
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
129132

130133
- name: Set up JDK 17
131-
uses: actions/setup-java@v3
134+
uses: actions/setup-java@v4
132135
with:
133136
distribution: 'zulu'
134137
java-version: 17
@@ -151,7 +154,7 @@ jobs:
151154

152155
- name: Upload test reports
153156
if: always()
154-
uses: actions/upload-artifact@v3
157+
uses: actions/upload-artifact@v4
155158
with:
156159
name: test-reports-${{ matrix.api-level }}
157160
path: '**/build/reports/androidTests'

.github/workflows/Release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
2222

2323
- name: Set up JDK 17
24-
uses: actions/setup-java@v3
24+
uses: actions/setup-java@v4
2525
with:
2626
distribution: 'zulu'
2727
java-version: 17

README.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The app is currently in development. The `prodRelease` variant is [available on
2222
**Now in Android** displays content from the
2323
[Now in Android](https://developer.android.com/series/now-in-android) series. Users can browse for
2424
links to recent videos, articles and other content. Users can also follow topics they are interested
25-
in.
25+
in, and be notified when new content is published which matches interests they are following.
2626

2727
## Screenshots
2828

@@ -109,12 +109,42 @@ Examples:
109109
manipulate the state of the `Test` repository and verify the resulting behavior, instead of
110110
checking that specific repository methods were called.
111111

112-
## Screenshot tests
112+
To run the tests execute the following gradle tasks:
113+
114+
- `testDemoDebug` run all local tests against the `demoDebug` variant.
115+
- `connectedDemoDebugAndroidTest` run all instrumented tests against the `demoDebug` variant.
113116

114-
**Now In Android** uses [Roborazzi](https://github.com/takahirom/roborazzi) to do screenshot tests
115-
of certain screens and components. To run these tests, run the `verifyRoborazziDemoDebug` or
116-
`recordRoborazziDemoDebug` tasks. Note that screenshots are recorded on CI, using Linux, and other
117-
platforms might generate slightly different images, making the tests fail.
117+
**Note:** You should not run `./gradlew test` or `./gradlew connectedAndroidTest` as this will execute
118+
tests against _all_ build variants which is both unecessary and will result in failures as only the
119+
`demoDebug` variant is supported. No other variants have any tests (although this might change in future).
120+
121+
## Screenshot tests
122+
A screenshot test takes a screenshot of a screen or a UI component within the app, and compares it
123+
with a previously recorded screenshot which is known to be rendered correctly.
124+
125+
For example, Now in Android has [screenshot tests](https://github.com/android/nowinandroid/blob/main/app/src/testDemoDebug/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppScreenSizesScreenshotTests.kt)
126+
to verify that the navigation is displayed correctly on different screen sizes
127+
([known correct screenshots](https://github.com/android/nowinandroid/tree/main/app/src/testDemoDebug/screenshots)).
128+
129+
Now In Android uses [Roborazzi](https://github.com/takahirom/roborazzi) to run screenshot tests
130+
of certain screens and UI components. When working with screenshot tests the following gradle tasks are useful:
131+
132+
- `verifyRoborazziDemoDebug` run all screenshot tests, verifying the screenshots against the known
133+
correct screenshots.
134+
- `recordRoborazziDemoDebug` record new "known correct" screenshots. Use this command when you have
135+
made changes to the UI and manually verified that they are rendered correctly. Screenshots will be
136+
stored in `modulename/src/test/screenshots`.
137+
- `compareRoborazziDemoDebug` create comparison images between failed tests and the known correct
138+
images. These can also be found in `modulename/src/test/screenshots`.
139+
140+
**Note:** The known correct screenshots stored in this repository are recorded on CI using Linux. Other
141+
platforms may (and probably will) generate slightly different images, making the screenshot tests fail.
142+
When working on a non-Linux platform, a workaround to this is to run `recordRoborazziDemoDebug` on the
143+
`main` branch before starting work. After making changes, `verifyRoborazziDemoDebug` will identify only
144+
legitimate changes.
145+
146+
For more information about screenshot testing
147+
[check out this talk](https://www.droidcon.com/2023/11/15/easy-screenshot-testing-with-compose/).
118148

119149
# UI
120150
The app was designed using [Material 3 guidelines](https://m3.material.io/). Learn more about the design process and

app-nia-catalog/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ dependencies {
6969
implementation(projects.core.ui)
7070
implementation(libs.androidx.activity.compose)
7171
}
72+
73+
dependencyGuard {
74+
configuration("releaseRuntimeClasspath")
75+
}
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
androidx.activity:activity-compose:1.8.0
2+
androidx.activity:activity-ktx:1.8.0
3+
androidx.activity:activity:1.8.0
4+
androidx.annotation:annotation-experimental:1.3.0
5+
androidx.annotation:annotation-jvm:1.6.0
6+
androidx.annotation:annotation:1.6.0
7+
androidx.appcompat:appcompat-resources:1.6.1
8+
androidx.arch.core:core-common:2.2.0
9+
androidx.arch.core:core-runtime:2.2.0
10+
androidx.autofill:autofill:1.0.0
11+
androidx.browser:browser:1.6.0
12+
androidx.collection:collection:1.2.0
13+
androidx.compose.animation:animation-android:1.5.4
14+
androidx.compose.animation:animation-core-android:1.5.4
15+
androidx.compose.animation:animation-core:1.5.4
16+
androidx.compose.animation:animation:1.5.4
17+
androidx.compose.foundation:foundation-android:1.5.4
18+
androidx.compose.foundation:foundation-layout-android:1.5.4
19+
androidx.compose.foundation:foundation-layout:1.5.4
20+
androidx.compose.foundation:foundation:1.5.4
21+
androidx.compose.material3:material3:1.1.2
22+
androidx.compose.material:material-icons-core-android:1.5.4
23+
androidx.compose.material:material-icons-core:1.5.4
24+
androidx.compose.material:material-icons-extended-android:1.5.4
25+
androidx.compose.material:material-icons-extended:1.5.4
26+
androidx.compose.material:material-ripple-android:1.5.4
27+
androidx.compose.material:material-ripple:1.5.4
28+
androidx.compose.runtime:runtime-android:1.5.4
29+
androidx.compose.runtime:runtime-livedata:1.5.4
30+
androidx.compose.runtime:runtime-saveable-android:1.5.4
31+
androidx.compose.runtime:runtime-saveable:1.5.4
32+
androidx.compose.runtime:runtime:1.5.4
33+
androidx.compose.ui:ui-android:1.5.4
34+
androidx.compose.ui:ui-geometry-android:1.5.4
35+
androidx.compose.ui:ui-geometry:1.5.4
36+
androidx.compose.ui:ui-graphics-android:1.5.4
37+
androidx.compose.ui:ui-graphics:1.5.4
38+
androidx.compose.ui:ui-text-android:1.5.4
39+
androidx.compose.ui:ui-text:1.5.4
40+
androidx.compose.ui:ui-tooling-preview-android:1.5.4
41+
androidx.compose.ui:ui-tooling-preview:1.5.4
42+
androidx.compose.ui:ui-unit-android:1.5.4
43+
androidx.compose.ui:ui-unit:1.5.4
44+
androidx.compose.ui:ui-util-android:1.5.4
45+
androidx.compose.ui:ui-util:1.5.4
46+
androidx.compose.ui:ui:1.5.4
47+
androidx.compose:compose-bom:2023.10.01
48+
androidx.concurrent:concurrent-futures:1.1.0
49+
androidx.core:core-ktx:1.12.0
50+
androidx.core:core:1.12.0
51+
androidx.customview:customview-poolingcontainer:1.0.0
52+
androidx.customview:customview:1.0.0
53+
androidx.datastore:datastore-core:1.0.0
54+
androidx.datastore:datastore:1.0.0
55+
androidx.documentfile:documentfile:1.0.0
56+
androidx.emoji2:emoji2:1.4.0
57+
androidx.exifinterface:exifinterface:1.3.6
58+
androidx.fragment:fragment:1.5.1
59+
androidx.interpolator:interpolator:1.0.0
60+
androidx.legacy:legacy-support-core-utils:1.0.0
61+
androidx.lifecycle:lifecycle-common-java8:2.6.1
62+
androidx.lifecycle:lifecycle-common:2.6.1
63+
androidx.lifecycle:lifecycle-livedata-core:2.6.1
64+
androidx.lifecycle:lifecycle-livedata:2.6.1
65+
androidx.lifecycle:lifecycle-process:2.6.1
66+
androidx.lifecycle:lifecycle-runtime-ktx:2.6.1
67+
androidx.lifecycle:lifecycle-runtime:2.6.1
68+
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1
69+
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1
70+
androidx.lifecycle:lifecycle-viewmodel:2.6.1
71+
androidx.loader:loader:1.0.0
72+
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
73+
androidx.metrics:metrics-performance:1.0.0-alpha04
74+
androidx.print:print:1.0.0
75+
androidx.privacysandbox.ads:ads-adservices-java:1.0.0-beta05
76+
androidx.privacysandbox.ads:ads-adservices:1.0.0-beta05
77+
androidx.profileinstaller:profileinstaller:1.3.1
78+
androidx.room:room-common:2.6.0
79+
androidx.room:room-ktx:2.6.0
80+
androidx.room:room-runtime:2.6.0
81+
androidx.savedstate:savedstate-ktx:1.2.1
82+
androidx.savedstate:savedstate:1.2.1
83+
androidx.sqlite:sqlite-framework:2.4.0
84+
androidx.sqlite:sqlite:2.4.0
85+
androidx.startup:startup-runtime:1.1.1
86+
androidx.tracing:tracing-ktx:1.1.0
87+
androidx.tracing:tracing:1.1.0
88+
androidx.vectordrawable:vectordrawable-animated:1.1.0
89+
androidx.vectordrawable:vectordrawable:1.1.0
90+
androidx.versionedparcelable:versionedparcelable:1.1.1
91+
androidx.viewpager:viewpager:1.0.0
92+
com.caverock:androidsvg-aar:1.4
93+
com.google.accompanist:accompanist-drawablepainter:0.30.1
94+
com.google.android.datatransport:transport-api:3.0.0
95+
com.google.android.datatransport:transport-backend-cct:3.1.8
96+
com.google.android.datatransport:transport-runtime:3.1.8
97+
com.google.android.gms:play-services-ads-identifier:18.0.0
98+
com.google.android.gms:play-services-base:18.0.1
99+
com.google.android.gms:play-services-basement:18.1.0
100+
com.google.android.gms:play-services-cloud-messaging:17.0.1
101+
com.google.android.gms:play-services-measurement-api:21.4.0
102+
com.google.android.gms:play-services-measurement-base:21.4.0
103+
com.google.android.gms:play-services-measurement-impl:21.4.0
104+
com.google.android.gms:play-services-measurement-sdk-api:21.4.0
105+
com.google.android.gms:play-services-measurement-sdk:21.4.0
106+
com.google.android.gms:play-services-measurement:21.4.0
107+
com.google.android.gms:play-services-stats:17.0.2
108+
com.google.android.gms:play-services-tasks:18.0.2
109+
com.google.code.findbugs:jsr305:3.0.2
110+
com.google.dagger:dagger-lint-aar:2.48.1
111+
com.google.dagger:dagger:2.48.1
112+
com.google.dagger:hilt-android:2.48.1
113+
com.google.dagger:hilt-core:2.48.1
114+
com.google.errorprone:error_prone_annotations:2.11.0
115+
com.google.firebase:firebase-analytics-ktx:21.4.0
116+
com.google.firebase:firebase-analytics:21.4.0
117+
com.google.firebase:firebase-annotations:16.2.0
118+
com.google.firebase:firebase-bom:32.4.0
119+
com.google.firebase:firebase-common-ktx:20.4.2
120+
com.google.firebase:firebase-common:20.4.2
121+
com.google.firebase:firebase-components:17.1.5
122+
com.google.firebase:firebase-datatransport:18.1.7
123+
com.google.firebase:firebase-encoders-json:18.0.0
124+
com.google.firebase:firebase-encoders-proto:16.0.0
125+
com.google.firebase:firebase-encoders:17.0.0
126+
com.google.firebase:firebase-iid-interop:17.1.0
127+
com.google.firebase:firebase-installations-interop:17.1.1
128+
com.google.firebase:firebase-installations:17.2.0
129+
com.google.firebase:firebase-measurement-connector:19.0.0
130+
com.google.firebase:firebase-messaging-ktx:23.3.0
131+
com.google.firebase:firebase-messaging:23.3.0
132+
com.google.guava:failureaccess:1.0.1
133+
com.google.guava:guava:31.1-android
134+
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
135+
com.google.j2objc:j2objc-annotations:1.3
136+
com.google.protobuf:protobuf-javalite:3.24.4
137+
com.google.protobuf:protobuf-kotlin-lite:3.24.4
138+
com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0
139+
com.squareup.okhttp3:logging-interceptor:4.12.0
140+
com.squareup.okhttp3:okhttp:4.12.0
141+
com.squareup.okio:okio-jvm:3.6.0
142+
com.squareup.okio:okio:3.6.0
143+
com.squareup.retrofit2:retrofit:2.9.0
144+
io.coil-kt:coil-base:2.4.0
145+
io.coil-kt:coil-compose-base:2.4.0
146+
io.coil-kt:coil-compose:2.4.0
147+
io.coil-kt:coil-svg:2.4.0
148+
io.coil-kt:coil:2.4.0
149+
javax.inject:javax.inject:1
150+
org.checkerframework:checker-qual:3.12.0
151+
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
152+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
153+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
154+
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
155+
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3
156+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
157+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
158+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
159+
org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3
160+
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.4.1
161+
org.jetbrains.kotlinx:kotlinx-datetime:0.4.1
162+
org.jetbrains.kotlinx:kotlinx-serialization-bom:1.6.0
163+
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.6.0
164+
org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.0
165+
org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.6.0
166+
org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0
167+
org.jetbrains:annotations:23.0.0

app/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,7 @@ baselineProfile {
144144
// Instead enable generation directly for the release build variant.
145145
automaticGenerationDuringBuild = false
146146
}
147+
148+
dependencyGuard {
149+
configuration("prodReleaseRuntimeClasspath")
150+
}

0 commit comments

Comments
 (0)