Skip to content

Commit 96d2a92

Browse files
Merge branch 'main' into dependabot/gradle/androidx.activity-activity-compose-1.8.2
2 parents 4cd0778 + 4b6da8d commit 96d2a92

File tree

154 files changed

+1398
-786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1398
-786
lines changed

.github/workflows/Build.yaml

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/checkout@v4
2626

2727
- name: Validate Gradle Wrapper
28-
uses: gradle/wrapper-validation-action@v1
28+
uses: gradle/wrapper-validation-action@v2
2929

3030
- name: Copy CI gradle.properties
3131
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
@@ -37,21 +37,48 @@ jobs:
3737
java-version: 17
3838

3939
- name: Setup Gradle
40-
uses: gradle/gradle-build-action@v2
40+
uses: gradle/gradle-build-action@v3
4141

4242
- name: Check build-logic
4343
run: ./gradlew check -p build-logic
4444

4545
- name: Check spotless
4646
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
4747

48+
- name: Check Dependency Guard
49+
id: dependencyguard_verify
50+
continue-on-error: true
51+
run: ./gradlew dependencyGuard
52+
53+
- name: Prevent updating Dependency Guard baselines if this is a fork
54+
id: checkfork_dependencyguard
55+
continue-on-error: false
56+
if: steps.dependencyguard_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
57+
run: |
58+
echo "::error::Dependency Guard failed, please update baselines with: ./gradlew dependencyGuardBaseline" && exit 1
59+
60+
# Runs if previous job failed
61+
- name: Generate new Dependency Guard baselines if verification failed and it's a PR
62+
id: dependencyguard_baseline
63+
if: steps.dependencyguard_verify.outcome == 'failure' && github.event_name == 'pull_request'
64+
run: |
65+
./gradlew dependencyGuardBaseline
66+
67+
- name: Push new Dependency Guard baselines if available
68+
uses: stefanzweifel/git-auto-commit-action@v5
69+
if: steps.dependencyguard_baseline.outcome == 'success'
70+
with:
71+
file_pattern: '**/dependencies/*.txt'
72+
disable_globbing: true
73+
commit_message: "🤖 Updates baselines for Dependency Guard"
74+
4875
- name: Run all local screenshot tests (Roborazzi)
4976
id: screenshotsverify
5077
continue-on-error: true
5178
run: ./gradlew verifyRoborazziDemoDebug
5279

5380
- name: Prevent pushing new screenshots if this is a fork
54-
id: checkfork
81+
id: checkfork_screenshots
5582
continue-on-error: false
5683
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
5784
run: |
@@ -82,13 +109,9 @@ jobs:
82109
- name: Build all build type and flavor permutations
83110
run: ./gradlew :app:assemble :benchmarks:assemble
84111
-x pixel6Api33ProdNonMinifiedReleaseAndroidTest
85-
-x pixel6Api33ProdNonMinifiedBenchmarkAndroidTest
86112
-x pixel6Api33DemoNonMinifiedReleaseAndroidTest
87-
-x pixel6Api33DemoNonMinifiedBenchmarkAndroidTest
88113
-x collectDemoNonMinifiedReleaseBaselineProfile
89-
-x collectDemoNonMinifiedBenchmarkBaselineProfile
90114
-x collectProdNonMinifiedReleaseBaselineProfile
91-
-x collectProdNonMinifiedBenchmarkBaselineProfile
92115

93116
- name: Upload build outputs (APKs)
94117
uses: actions/upload-artifact@v4
@@ -117,13 +140,31 @@ jobs:
117140
run: ./gradlew :app:checkProdReleaseBadging
118141

119142
androidTest:
120-
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
143+
runs-on: ubuntu-latest
121144
timeout-minutes: 55
122145
strategy:
123146
matrix:
124147
api-level: [26, 30]
125148

126149
steps:
150+
- name: Delete unnecessary tools 🔧
151+
uses: jlumbroso/[email protected]
152+
with:
153+
android: false # Don't remove Android tools
154+
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY"
155+
dotnet: true # rm -rf /usr/share/dotnet
156+
haskell: true # rm -rf /opt/ghc...
157+
swap-storage: true # rm -f /mnt/swapfile (4GiB)
158+
docker-images: false # Takes 16s, enable if needed in the future
159+
large-packages: false # includes google-cloud-sdk and it's slow
160+
161+
- name: Enable KVM group perms
162+
run: |
163+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
164+
sudo udevadm control --reload-rules
165+
sudo udevadm trigger --name-match=kvm
166+
ls /dev/kvm
167+
127168
- name: Checkout
128169
uses: actions/checkout@v4
129170

@@ -137,7 +178,7 @@ jobs:
137178
java-version: 17
138179

139180
- name: Setup Gradle
140-
uses: gradle/gradle-build-action@v2
181+
uses: gradle/gradle-build-action@v3
141182

142183
- name: Build projects before running emulator
143184
run: ./gradlew packageDemoDebug packageDemoDebugAndroidTest

.github/workflows/Release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@ on:
77

88
jobs:
99
build:
10-
runs-on: macos-latest
10+
runs-on: ubuntu-latest
1111
timeout-minutes: 120
1212

1313
steps:
14+
- name: Enable KVM group perms
15+
run: |
16+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
17+
sudo udevadm control --reload-rules
18+
sudo udevadm trigger --name-match=kvm
19+
ls /dev/kvm
20+
1421
- name: Checkout
1522
uses: actions/checkout@v4
1623

1724
- name: Validate Gradle Wrapper
18-
uses: gradle/wrapper-validation-action@v1
25+
uses: gradle/wrapper-validation-action@v2
1926

2027
- name: Copy CI gradle.properties
2128
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ tests against _all_ build variants which is both unecessary and will result in f
122122
A screenshot test takes a screenshot of a screen or a UI component within the app, and compares it
123123
with a previously recorded screenshot which is known to be rendered correctly.
124124

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)
125+
For example, Now in Android has [screenshot tests](https://github.com/android/nowinandroid/blob/main/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppScreenSizesScreenshotTests.kt)
126126
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)).
127+
([known correct screenshots](https://github.com/android/nowinandroid/tree/main/app/src/testDemo/screenshots)).
128128

129129
Now In Android uses [Roborazzi](https://github.com/takahirom/roborazzi) to run screenshot tests
130130
of certain screens and UI components. When working with screenshot tests the following gradle tasks are useful:

app-nia-catalog/dependencies/releaseRuntimeClasspath.txt

Lines changed: 71 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,103 @@
11
androidx.activity:activity-compose:1.8.0
22
androidx.activity:activity-ktx:1.8.0
33
androidx.activity:activity:1.8.0
4-
androidx.annotation:annotation-experimental:1.3.1
5-
androidx.annotation:annotation-jvm:1.7.0
6-
androidx.annotation:annotation:1.7.0
4+
androidx.annotation:annotation-experimental:1.4.0
5+
androidx.annotation:annotation-jvm:1.7.1
6+
androidx.annotation:annotation:1.7.1
77
androidx.appcompat:appcompat-resources:1.6.1
88
androidx.arch.core:core-common:2.2.0
99
androidx.arch.core:core-runtime:2.2.0
1010
androidx.autofill:autofill:1.0.0
11-
androidx.browser:browser:1.6.0
12-
androidx.collection:collection-jvm:1.3.0
13-
androidx.collection:collection:1.3.0
14-
androidx.compose.animation:animation-android:1.5.4
15-
androidx.compose.animation:animation-core-android:1.5.4
16-
androidx.compose.animation:animation-core:1.5.4
17-
androidx.compose.animation:animation:1.5.4
18-
androidx.compose.foundation:foundation-android:1.5.4
19-
androidx.compose.foundation:foundation-layout-android:1.5.4
20-
androidx.compose.foundation:foundation-layout:1.5.4
21-
androidx.compose.foundation:foundation:1.5.4
22-
androidx.compose.material3:material3:1.1.2
23-
androidx.compose.material:material-icons-core-android:1.5.4
24-
androidx.compose.material:material-icons-core:1.5.4
25-
androidx.compose.material:material-icons-extended-android:1.5.4
26-
androidx.compose.material:material-icons-extended:1.5.4
27-
androidx.compose.material:material-ripple-android:1.5.4
28-
androidx.compose.material:material-ripple:1.5.4
29-
androidx.compose.runtime:runtime-android: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
11+
androidx.browser:browser:1.8.0
12+
androidx.collection:collection-jvm:1.4.0
13+
androidx.collection:collection-ktx:1.4.0
14+
androidx.collection:collection:1.4.0
15+
androidx.compose.animation:animation-android:1.6.3
16+
androidx.compose.animation:animation-core-android:1.6.3
17+
androidx.compose.animation:animation-core:1.6.3
18+
androidx.compose.animation:animation:1.6.3
19+
androidx.compose.foundation:foundation-android:1.6.3
20+
androidx.compose.foundation:foundation-layout-android:1.6.3
21+
androidx.compose.foundation:foundation-layout:1.6.3
22+
androidx.compose.foundation:foundation:1.6.3
23+
androidx.compose.material3:material3-android:1.2.1
24+
androidx.compose.material3:material3:1.2.1
25+
androidx.compose.material:material-icons-core-android:1.6.3
26+
androidx.compose.material:material-icons-core:1.6.3
27+
androidx.compose.material:material-icons-extended-android:1.6.3
28+
androidx.compose.material:material-icons-extended:1.6.3
29+
androidx.compose.material:material-ripple-android:1.6.3
30+
androidx.compose.material:material-ripple:1.6.3
31+
androidx.compose.runtime:runtime-android:1.6.3
32+
androidx.compose.runtime:runtime-saveable-android:1.6.3
33+
androidx.compose.runtime:runtime-saveable:1.6.3
34+
androidx.compose.runtime:runtime:1.6.3
35+
androidx.compose.ui:ui-android:1.6.3
36+
androidx.compose.ui:ui-geometry-android:1.6.3
37+
androidx.compose.ui:ui-geometry:1.6.3
38+
androidx.compose.ui:ui-graphics-android:1.6.3
39+
androidx.compose.ui:ui-graphics:1.6.3
40+
androidx.compose.ui:ui-text-android:1.6.3
41+
androidx.compose.ui:ui-text:1.6.3
42+
androidx.compose.ui:ui-tooling-preview-android:1.6.3
43+
androidx.compose.ui:ui-tooling-preview:1.6.3
44+
androidx.compose.ui:ui-unit-android:1.6.3
45+
androidx.compose.ui:ui-unit:1.6.3
46+
androidx.compose.ui:ui-util-android:1.6.3
47+
androidx.compose.ui:ui-util:1.6.3
48+
androidx.compose.ui:ui:1.6.3
49+
androidx.compose:compose-bom:2024.02.02
4850
androidx.concurrent:concurrent-futures:1.1.0
4951
androidx.core:core-ktx:1.12.0
5052
androidx.core:core:1.12.0
5153
androidx.customview:customview-poolingcontainer:1.0.0
5254
androidx.customview:customview:1.0.0
53-
androidx.emoji2:emoji2:1.4.0
54-
androidx.exifinterface:exifinterface:1.3.6
55+
androidx.emoji2:emoji2:1.3.0
56+
androidx.exifinterface:exifinterface:1.3.7
5557
androidx.fragment:fragment:1.5.1
5658
androidx.interpolator:interpolator:1.0.0
57-
androidx.lifecycle:lifecycle-common-java8:2.6.2
58-
androidx.lifecycle:lifecycle-common:2.6.2
59-
androidx.lifecycle:lifecycle-livedata-core:2.6.2
60-
androidx.lifecycle:lifecycle-livedata:2.6.2
61-
androidx.lifecycle:lifecycle-process:2.6.2
62-
androidx.lifecycle:lifecycle-runtime-ktx:2.6.2
63-
androidx.lifecycle:lifecycle-runtime:2.6.2
64-
androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2
65-
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2
66-
androidx.lifecycle:lifecycle-viewmodel:2.6.2
59+
androidx.lifecycle:lifecycle-common-java8:2.7.0
60+
androidx.lifecycle:lifecycle-common:2.7.0
61+
androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0
62+
androidx.lifecycle:lifecycle-livedata-core:2.7.0
63+
androidx.lifecycle:lifecycle-livedata:2.7.0
64+
androidx.lifecycle:lifecycle-process:2.7.0
65+
androidx.lifecycle:lifecycle-runtime-ktx:2.7.0
66+
androidx.lifecycle:lifecycle-runtime:2.7.0
67+
androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0
68+
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0
69+
androidx.lifecycle:lifecycle-viewmodel:2.7.0
6770
androidx.loader:loader:1.0.0
6871
androidx.metrics:metrics-performance:1.0.0-alpha04
6972
androidx.profileinstaller:profileinstaller:1.3.1
7073
androidx.savedstate:savedstate-ktx:1.2.1
7174
androidx.savedstate:savedstate:1.2.1
7275
androidx.startup:startup-runtime:1.1.1
73-
androidx.tracing:tracing:1.0.0
76+
androidx.tracing:tracing-ktx:1.3.0-alpha02
77+
androidx.tracing:tracing:1.3.0-alpha02
7478
androidx.vectordrawable:vectordrawable-animated:1.1.0
7579
androidx.vectordrawable:vectordrawable:1.1.0
7680
androidx.versionedparcelable:versionedparcelable:1.1.1
7781
androidx.viewpager:viewpager:1.0.0
7882
com.google.accompanist:accompanist-drawablepainter:0.32.0
7983
com.google.code.findbugs:jsr305:3.0.2
80-
com.google.dagger:dagger-lint-aar:2.50
81-
com.google.dagger:dagger:2.50
82-
com.google.dagger:hilt-android:2.50
83-
com.google.dagger:hilt-core:2.50
84+
com.google.dagger:dagger-lint-aar:2.51
85+
com.google.dagger:dagger:2.51
86+
com.google.dagger:hilt-android:2.51
87+
com.google.dagger:hilt-core:2.51
8488
com.google.guava:listenablefuture:1.0
8589
com.squareup.okhttp3:okhttp:4.12.0
86-
com.squareup.okio:okio-jvm:3.6.0
87-
com.squareup.okio:okio:3.6.0
88-
io.coil-kt:coil-base:2.5.0
89-
io.coil-kt:coil-compose-base:2.5.0
90-
io.coil-kt:coil-compose:2.5.0
91-
io.coil-kt:coil:2.5.0
90+
com.squareup.okio:okio-jvm:3.8.0
91+
com.squareup.okio:okio:3.8.0
92+
io.coil-kt:coil-base:2.6.0
93+
io.coil-kt:coil-compose-base:2.6.0
94+
io.coil-kt:coil-compose:2.6.0
95+
io.coil-kt:coil:2.6.0
9296
javax.inject:javax.inject:1
93-
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.21
94-
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
95-
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
96-
org.jetbrains.kotlin:kotlin-stdlib:1.9.21
97+
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.22
98+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.0
99+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0
100+
org.jetbrains.kotlin:kotlin-stdlib:1.9.22
97101
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3
98102
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
99103
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3

app/build.gradle.kts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ android {
4545
debug {
4646
applicationIdSuffix = NiaBuildType.DEBUG.applicationIdSuffix
4747
}
48-
val release = getByName("release") {
48+
release {
4949
isMinifyEnabled = true
5050
applicationIdSuffix = NiaBuildType.RELEASE.applicationIdSuffix
5151
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
@@ -57,17 +57,6 @@ android {
5757
// Ensure Baseline Profile is fresh for release builds.
5858
baselineProfile.automaticGenerationDuringBuild = true
5959
}
60-
create("benchmark") {
61-
// Enable all the optimizations from release build through initWith(release).
62-
initWith(release)
63-
matchingFallbacks.add("release")
64-
// Debug key signing is available to everyone.
65-
signingConfig = signingConfigs.getByName("debug")
66-
// Only use benchmark proguard rules
67-
proguardFiles("benchmark-rules.pro")
68-
isMinifyEnabled = true
69-
applicationIdSuffix = NiaBuildType.BENCHMARK.applicationIdSuffix
70-
}
7160
}
7261

7362
packaging {
@@ -100,16 +89,23 @@ dependencies {
10089
implementation(projects.sync.work)
10190

10291
implementation(libs.androidx.activity.compose)
92+
implementation(libs.androidx.compose.material3.adaptive)
93+
implementation(libs.androidx.compose.material3.adaptive.layout)
94+
implementation(libs.androidx.compose.material3.adaptive.navigation)
95+
implementation(libs.androidx.compose.material3.windowSizeClass)
96+
implementation(libs.androidx.compose.runtime.tracing)
10397
implementation(libs.androidx.core.ktx)
10498
implementation(libs.androidx.core.splashscreen)
105-
implementation(libs.androidx.tracing.ktx)
99+
implementation(libs.androidx.hilt.navigation.compose)
106100
implementation(libs.androidx.lifecycle.runtimeCompose)
107-
implementation(libs.androidx.compose.material3.windowSizeClass)
108101
implementation(libs.androidx.navigation.compose)
109102
implementation(libs.androidx.profileinstaller)
103+
implementation(libs.androidx.tracing.ktx)
110104
implementation(libs.kotlinx.coroutines.guava)
111105
implementation(libs.coil.kt)
112106

107+
ksp(libs.hilt.compiler)
108+
113109
debugImplementation(libs.androidx.compose.ui.testManifest)
114110
debugImplementation(projects.uiTestHiltManifest)
115111

@@ -123,10 +119,12 @@ dependencies {
123119

124120
testDemoImplementation(libs.robolectric)
125121
testDemoImplementation(libs.roborazzi)
122+
testDemoImplementation(projects.core.screenshotTesting)
126123

127124
androidTestImplementation(projects.core.testing)
128125
androidTestImplementation(projects.core.dataTest)
129126
androidTestImplementation(projects.core.datastoreTest)
127+
androidTestImplementation(libs.androidx.test.espresso.core)
130128
androidTestImplementation(libs.androidx.navigation.testing)
131129
androidTestImplementation(libs.accompanist.testharness)
132130
androidTestImplementation(libs.hilt.android.testing)

0 commit comments

Comments
 (0)