Skip to content

Commit ddabba8

Browse files
authored
Merge branch 'main' into jvmToolchain
2 parents e1f8c51 + 553f55f commit ddabba8

File tree

207 files changed

+5926
-979
lines changed

Some content is hidden

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

207 files changed

+5926
-979
lines changed

.github/workflows/AndroidCIWithGmd.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ jobs:
1010

1111
android-ci:
1212
runs-on: macos-12
13-
strategy:
14-
matrix:
15-
device-config: [ "pixel4api30aospatd", "pixelcapi30aospatd" ]
1613

1714
steps:
15+
- uses: actions/checkout@v3
1816
- uses: actions/setup-java@v3
1917
with:
2018
distribution: 'zulu'
21-
java-version: '11'
22-
- uses: actions/checkout@v3
19+
java-version: 17
20+
- uses: gradle/gradle-build-action@v2
2321

2422
- name: Setup Android SDK
2523
uses: android-actions/setup-android@v2
2624

25+
- name: Build AndroidTest apps
26+
run: ./gradlew packageDemoDebug packageDemoDebugAndroidTest
27+
2728
- name: Run instrumented tests with GMD
2829
run: ./gradlew cleanManagedDevices --unused-only &&
29-
./gradlew ${{ matrix.device-config }}DemoDebugAndroidTest -Dorg.gradle.workers.max=1
30-
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true --info
30+
./gradlew ciDemoDebugAndroidTest -Dorg.gradle.workers.max=1
31+
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
3132

3233
- name: Upload test reports
3334
if: success() || failure()
3435
uses: actions/upload-artifact@v3
3536
with:
3637
name: test-reports
37-
path: |
38-
'**/*/build/reports/androidTests/'
38+
path: '**/build/reports/androidTests'

.github/workflows/Build.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
- name: Copy CI gradle.properties
2525
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
2626

27-
- name: Set up JDK 11
27+
- name: Set up JDK 17
2828
uses: actions/setup-java@v3
2929
with:
3030
distribution: 'zulu'
31-
java-version: 11
31+
java-version: 17
3232

3333
- name: Setup Gradle
3434
uses: gradle/gradle-build-action@v2
@@ -48,15 +48,22 @@ jobs:
4848
- name: Upload build outputs (APKs)
4949
uses: actions/upload-artifact@v3
5050
with:
51-
name: build-outputs
52-
path: app/build/outputs
51+
name: APKs
52+
path: '**/build/outputs/apk/**/*.apk'
5353

54-
- name: Upload build reports
54+
- name: Upload lint reports (HTML)
5555
if: always()
5656
uses: actions/upload-artifact@v3
5757
with:
58-
name: build-reports
59-
path: app/build/reports
58+
name: lint-reports
59+
path: '**/build/reports/lint-results-*.html'
60+
61+
- name: Upload test results (XML)
62+
if: always()
63+
uses: actions/upload-artifact@v3
64+
with:
65+
name: test-results
66+
path: '**/build/test-results/test*UnitTest/**.xml'
6067

6168
androidTest:
6269
needs: build
@@ -73,15 +80,18 @@ jobs:
7380
- name: Copy CI gradle.properties
7481
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
7582

76-
- name: Set up JDK 11
83+
- name: Set up JDK 17
7784
uses: actions/setup-java@v3
7885
with:
7986
distribution: 'zulu'
80-
java-version: 11
87+
java-version: 17
8188

8289
- name: Setup Gradle
8390
uses: gradle/gradle-build-action@v2
8491

92+
- name: Build AndroidTest apps
93+
run: ./gradlew packageDemoDebug packageDemoDebugAndroidTest --daemon
94+
8595
- name: Run instrumentation tests
8696
uses: reactivecircus/android-emulator-runner@v2
8797
with:
@@ -90,11 +100,11 @@ jobs:
90100
disable-animations: true
91101
disk-size: 6000M
92102
heap-size: 600M
93-
script: ./gradlew connectedProdDebugAndroidTest -x :benchmark:connectedProdBenchmarkAndroidTest
103+
script: ./gradlew connectedDemoDebugAndroidTest -x :benchmark:connectedDemoBenchmarkAndroidTest --daemon
94104

95105
- name: Upload test reports
96106
if: always()
97107
uses: actions/upload-artifact@v3
98108
with:
99109
name: test-reports-${{ matrix.api-level }}
100-
path: '*/build/reports/androidTests'
110+
path: '**/build/reports/androidTests'

.github/workflows/Release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- name: Copy CI gradle.properties
2121
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
2222

23-
- name: Set up JDK 11
23+
- name: Set up JDK 17
2424
uses: actions/setup-java@v3
2525
with:
2626
distribution: 'zulu'
27-
java-version: 11
27+
java-version: 17
2828

2929
- name: Build app
3030
run: ./gradlew :app:assembleDemoRelease

.google/BUILDME

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file can be used to trigger an internal build by changing the number below
2+
3

app-nia-catalog/build.gradle.kts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ android {
4747
missingDimensionStrategy(FlavorDimension.contentType.name, NiaFlavor.demo.name)
4848
}
4949

50-
packagingOptions {
50+
packaging {
5151
resources {
5252
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
5353
}
5454
}
5555
namespace = "com.google.samples.apps.niacatalog"
5656

5757
buildTypes {
58-
val release by getting {
58+
release {
5959
// To publish on the Play store a private signing key is required, but to allow anyone
6060
// who clones the code to sign and run the release variant, use the debug signing key.
6161
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
@@ -65,9 +65,7 @@ android {
6565
}
6666

6767
dependencies {
68-
implementation(project(":core:ui"))
6968
implementation(project(":core:designsystem"))
70-
69+
implementation(project(":core:ui"))
7170
implementation(libs.androidx.activity.compose)
72-
implementation(libs.accompanist.flowlayout)
7371
}

app-nia-catalog/src/main/java/com/google/samples/apps/niacatalog/ui/Catalog.kt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package com.google.samples.apps.niacatalog.ui
1818

1919
import androidx.compose.foundation.layout.Arrangement
20+
import androidx.compose.foundation.layout.ExperimentalLayoutApi
21+
import androidx.compose.foundation.layout.FlowRow
2022
import androidx.compose.foundation.layout.WindowInsets
2123
import androidx.compose.foundation.layout.add
2224
import androidx.compose.foundation.layout.asPaddingValues
@@ -36,7 +38,6 @@ import androidx.compose.runtime.setValue
3638
import androidx.compose.ui.Modifier
3739
import androidx.compose.ui.res.painterResource
3840
import androidx.compose.ui.unit.dp
39-
import com.google.accompanist.flowlayout.FlowRow
4041
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaButton
4142
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip
4243
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaIconToggleButton
@@ -54,6 +55,7 @@ import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
5455
/**
5556
* Now in Android component catalog.
5657
*/
58+
@OptIn(ExperimentalLayoutApi::class)
5759
@Composable
5860
fun NiaCatalog() {
5961
NiaTheme {
@@ -75,7 +77,7 @@ fun NiaCatalog() {
7577
}
7678
item { Text("Buttons", Modifier.padding(top = 16.dp)) }
7779
item {
78-
FlowRow(mainAxisSpacing = 16.dp) {
80+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
7981
NiaButton(onClick = {}) {
8082
Text(text = "Enabled")
8183
}
@@ -89,7 +91,7 @@ fun NiaCatalog() {
8991
}
9092
item { Text("Disabled buttons", Modifier.padding(top = 16.dp)) }
9193
item {
92-
FlowRow(mainAxisSpacing = 16.dp) {
94+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
9395
NiaButton(
9496
onClick = {},
9597
enabled = false,
@@ -112,7 +114,7 @@ fun NiaCatalog() {
112114
}
113115
item { Text("Buttons with leading icons", Modifier.padding(top = 16.dp)) }
114116
item {
115-
FlowRow(mainAxisSpacing = 16.dp) {
117+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
116118
NiaButton(
117119
onClick = {},
118120
text = { Text(text = "Enabled") },
@@ -138,7 +140,7 @@ fun NiaCatalog() {
138140
}
139141
item { Text("Disabled buttons with leading icons", Modifier.padding(top = 16.dp)) }
140142
item {
141-
FlowRow(mainAxisSpacing = 16.dp) {
143+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
142144
NiaButton(
143145
onClick = {},
144146
enabled = false,
@@ -168,7 +170,7 @@ fun NiaCatalog() {
168170
item { Text("Dropdown menus", Modifier.padding(top = 16.dp)) }
169171
item { Text("Chips", Modifier.padding(top = 16.dp)) }
170172
item {
171-
FlowRow(mainAxisSpacing = 16.dp) {
173+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
172174
var firstChecked by remember { mutableStateOf(false) }
173175
NiaFilterChip(
174176
selected = firstChecked,
@@ -197,7 +199,7 @@ fun NiaCatalog() {
197199
}
198200
item { Text("Icon buttons", Modifier.padding(top = 16.dp)) }
199201
item {
200-
FlowRow(mainAxisSpacing = 16.dp) {
202+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
201203
var firstChecked by remember { mutableStateOf(false) }
202204
NiaIconToggleButton(
203205
checked = firstChecked,
@@ -270,7 +272,7 @@ fun NiaCatalog() {
270272
}
271273
item { Text("View toggle", Modifier.padding(top = 16.dp)) }
272274
item {
273-
FlowRow(mainAxisSpacing = 16.dp) {
275+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
274276
var firstExpanded by remember { mutableStateOf(false) }
275277
NiaViewToggleButton(
276278
expanded = firstExpanded,
@@ -296,7 +298,7 @@ fun NiaCatalog() {
296298
}
297299
item { Text("Tags", Modifier.padding(top = 16.dp)) }
298300
item {
299-
FlowRow(mainAxisSpacing = 16.dp) {
301+
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
300302
NiaTopicTag(
301303
followed = true,
302304
onClick = {},

app/benchmark-rules.pro

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,16 @@
33
# Obsfuscation must be disabled for the build variant that generates Baseline Profile, otherwise
44
# wrong symbols would be generated. The generated Baseline Profile will be properly applied when generated
55
# without obfuscation and your app is being obfuscated.
6-
-dontobfuscate
6+
-dontobfuscate
7+
8+
# Please add these rules to your existing keep rules in order to suppress warnings.
9+
# This is generated automatically by the Android Gradle plugin.
10+
-dontwarn org.bouncycastle.jsse.BCSSLParameters
11+
-dontwarn org.bouncycastle.jsse.BCSSLSocket
12+
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
13+
-dontwarn org.conscrypt.Conscrypt$Version
14+
-dontwarn org.conscrypt.Conscrypt
15+
-dontwarn org.conscrypt.ConscryptHostnameVerifier
16+
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
17+
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
18+
-dontwarn org.openjsse.net.ssl.OpenJSSE

app/build.gradle.kts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@
1414
* limitations under the License.
1515
*/
1616
import com.google.samples.apps.nowinandroid.NiaBuildType
17-
import com.android.build.api.dsl.ManagedVirtualDevice
1817

1918
plugins {
2019
id("nowinandroid.android.application")
2120
id("nowinandroid.android.application.compose")
21+
id("nowinandroid.android.application.flavors")
2222
id("nowinandroid.android.application.jacoco")
2323
id("nowinandroid.android.hilt")
2424
id("jacoco")
25-
id("nowinandroid.firebase-perf")
25+
id("nowinandroid.android.application.firebase")
2626
}
2727

2828
android {
2929
defaultConfig {
3030
applicationId = "com.google.samples.apps.nowinandroid"
31-
versionCode = 4
32-
versionName = "0.0.4" // X.Y.Z; X = Major, Y = minor, Z = Patch level
31+
versionCode = 5
32+
versionName = "0.0.5" // X.Y.Z; X = Major, Y = minor, Z = Patch level
3333

3434
// Custom test runner to set up Hilt dependency graph
3535
testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner"
@@ -39,7 +39,7 @@ android {
3939
}
4040

4141
buildTypes {
42-
val debug by getting {
42+
debug {
4343
applicationIdSuffix = NiaBuildType.DEBUG.applicationIdSuffix
4444
}
4545
val release by getting {
@@ -52,7 +52,7 @@ android {
5252
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
5353
signingConfig = signingConfigs.getByName("debug")
5454
}
55-
val benchmark by creating {
55+
create("benchmark") {
5656
// Enable all the optimizations from release build through initWith(release).
5757
initWith(release)
5858
matchingFallbacks.add("release")
@@ -65,7 +65,7 @@ android {
6565
}
6666
}
6767

68-
packagingOptions {
68+
packaging {
6969
resources {
7070
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
7171
}
@@ -74,17 +74,6 @@ android {
7474
unitTests {
7575
isIncludeAndroidResources = true
7676
}
77-
// TODO: Convert it as a convention plugin once Flamingo goes out (https://github.com/android/nowinandroid/issues/523)
78-
managedDevices {
79-
devices {
80-
maybeCreate<ManagedVirtualDevice>("pixel4api30").apply {
81-
device = "Pixel 4"
82-
apiLevel = 30
83-
// ATDs currently support only API level 30.
84-
systemImageSource = "aosp-atd"
85-
}
86-
}
87-
}
8877
}
8978
namespace = "com.google.samples.apps.nowinandroid"
9079
}
@@ -94,13 +83,15 @@ dependencies {
9483
implementation(project(":feature:foryou"))
9584
implementation(project(":feature:bookmarks"))
9685
implementation(project(":feature:topic"))
86+
implementation(project(":feature:search"))
9787
implementation(project(":feature:settings"))
9888

9989
implementation(project(":core:common"))
10090
implementation(project(":core:ui"))
10191
implementation(project(":core:designsystem"))
10292
implementation(project(":core:data"))
10393
implementation(project(":core:model"))
94+
implementation(project(":core:analytics"))
10495

10596
implementation(project(":sync:work"))
10697

@@ -129,7 +120,6 @@ dependencies {
129120
implementation(libs.androidx.profileinstaller)
130121

131122
implementation(libs.coil.kt)
132-
implementation(libs.coil.kt.svg)
133123
}
134124

135125
// androidx.test is forcing JUnit, 4.12. This forces it to use 4.13

0 commit comments

Comments
 (0)