Skip to content

Commit b5d3424

Browse files
committed
Merge remote-tracking branch 'fork/main' into patch/assets-as-json-files
2 parents 0e6f16e + 28ffbb0 commit b5d3424

File tree

52 files changed

+196
-126
lines changed

Some content is hidden

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

52 files changed

+196
-126
lines changed

.github/workflows/Build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ jobs:
3434
uses: gradle/gradle-build-action@v2
3535

3636
- name: Check spotless
37-
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
37+
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
3838

3939
- name: Check lint
40-
run: ./gradlew lintDemoDebug --stacktrace
40+
run: ./gradlew lintDemoDebug
4141

4242
- name: Build all build type and flavor permutations
43-
run: ./gradlew assemble --stacktrace
43+
run: ./gradlew assemble
4444

4545
- name: Run local tests
46-
run: ./gradlew testDemoDebug testProdDebug --stacktrace
46+
run: ./gradlew testDemoDebug testProdDebug
4747

4848
- name: Upload build outputs (APKs)
4949
uses: actions/upload-artifact@v3
@@ -90,7 +90,7 @@ jobs:
9090
disable-animations: true
9191
disk-size: 6000M
9292
heap-size: 600M
93-
script: ./gradlew connectedProdDebugAndroidTest -x :benchmark:connectedProdBenchmarkAndroidTest --stacktrace
93+
script: ./gradlew connectedProdDebugAndroidTest -x :benchmark:connectedProdBenchmarkAndroidTest
9494

9595
- name: Upload test reports
9696
if: always()

.google/packaging.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,31 @@
1818
# End users may safely ignore this file. It has no relevance to other systems.
1919
---
2020
status: PUBLISHED
21-
technologies: [Android]
21+
technologies: [Android, JetpackCompose, Coroutines]
2222
categories:
2323
- AndroidTesting
2424
- AndroidArchitecture
2525
- AndroidArchitectureUILayer
2626
- AndroidArchitectureDomainLayer
2727
- AndroidArchitectureDataLayer
28+
- AndroidArchitectureStateProduction
29+
- AndroidArchitectureStateHolder
30+
- JetpackComposeTesting
31+
- JetpackComposeA11y
32+
- JetpackComposeArchitectureAndState
33+
- JetpackComposeDesignSystems
34+
- JetpackComposeNavigation
35+
- JetpackComposeAnimation
36+
solutions:
37+
- Mobile
38+
- Flow
39+
- JetpackHilt
40+
- JetpackDataStore
41+
- JetpackRoom
42+
- JetpackNavigation
43+
- JetpackWorkManager
44+
- JetpackLifecycle
2845
languages: [Kotlin]
29-
solutions: [Mobile]
3046
github: android/nowinandroid
3147
level: ADVANCED
3248
license: apache2
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2022 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<component name="ProjectRunConfigurationManager">
18+
<!--
19+
Baseline Profiles improve code execution speed by around 30% from the first launch by avoiding interpretation and just-in-time (JIT) compilation steps for included code paths.
20+
More information at http://d.android.com/baseline-profiles.
21+
-->
22+
<configuration default="false" name="Generate Demo Baseline Profile" type="GradleRunConfiguration" factoryName="Gradle">
23+
<ExternalSystemSettings>
24+
<option name="executionName" />
25+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
26+
<option name="externalSystemIdString" value="GRADLE" />
27+
<!-- TODO Once we use Gradle wrapper 7.6, we can use rerun instead of rerun-tasks that will skip cache only for one task -->
28+
<option name="scriptParameters" value="--rerun-tasks -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile" />
29+
<option name="taskDescriptions">
30+
<list />
31+
</option>
32+
<option name="taskNames">
33+
<list>
34+
<option value=":benchmark:pixel6Api31DemoBenchmarkAndroidTest" />
35+
</list>
36+
</option>
37+
<option name="vmOptions" />
38+
</ExternalSystemSettings>
39+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
40+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
41+
<DebugAllEnabled>false</DebugAllEnabled>
42+
<method v="2" />
43+
</configuration>
44+
</component>

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ dependencies {
9191
implementation(project(":core:model"))
9292

9393
implementation(project(":sync:work"))
94-
implementation(project(":sync:sync-test"))
9594

9695
androidTestImplementation(project(":core:testing"))
9796
androidTestImplementation(project(":core:datastore-test"))
9897
androidTestImplementation(project(":core:data-test"))
9998
androidTestImplementation(project(":core:network"))
10099
androidTestImplementation(libs.androidx.navigation.testing)
100+
androidTestImplementation(kotlin("test"))
101101
debugImplementation(libs.androidx.compose.ui.testManifest)
102102

103103
implementation(libs.accompanist.systemuicontroller)

app/src/androidTest/java/com/google/samples/apps/nowinandroid/ui/NiaAppStateTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ import androidx.navigation.compose.composable
3131
import androidx.navigation.createGraph
3232
import androidx.navigation.testing.TestNavHostController
3333
import com.google.samples.apps.nowinandroid.core.testing.util.TestNetworkMonitor
34+
import kotlin.test.assertEquals
35+
import kotlin.test.assertFalse
36+
import kotlin.test.assertTrue
3437
import kotlinx.coroutines.flow.collect
3538
import kotlinx.coroutines.launch
3639
import kotlinx.coroutines.test.UnconfinedTestDispatcher
3740
import kotlinx.coroutines.test.runTest
38-
import org.junit.Assert.assertEquals
39-
import org.junit.Assert.assertFalse
40-
import org.junit.Assert.assertTrue
4141
import org.junit.Rule
4242
import org.junit.Test
4343

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232

3333
<activity
3434
android:name=".MainActivity"
35-
android:exported="true"
36-
android:label="@string/app_name">
35+
android:exported="true">
3736
<intent-filter>
3837
<action android:name="android.intent.action.MAIN" />
3938

app/src/main/res/values/colors.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
limitations under the License.
1616
-->
1717
<resources>
18-
<color name="purple_200">#FFBB86FC</color>
19-
<color name="purple_500">#FF6200EE</color>
20-
<color name="purple_700">#FF3700B3</color>
21-
<color name="teal_200">#FF03DAC5</color>
22-
<color name="teal_700">#FF018786</color>
23-
2418
<!-- Status bar -->
2519
<color name="black30">#4D000000</color>
2620
</resources>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ plugins {
2121
}
2222

2323
android {
24-
namespace = "com.google.samples.apps.nowinandroid.benchmark"
24+
namespace = "com.google.samples.apps.nowinandroid.benchmarks"
2525

2626
defaultConfig {
2727
minSdk = 23
@@ -55,9 +55,9 @@ android {
5555
testOptions {
5656
managedDevices {
5757
devices {
58-
create<ManagedVirtualDevice>("pixel5Api30") {
59-
device = "Pixel 5"
60-
apiLevel = 30
58+
create<ManagedVirtualDevice>("pixel6Api31") {
59+
device = "Pixel 6"
60+
apiLevel = 31
6161
systemImageSource = "aosp"
6262
}
6363
}

benchmark/src/main/java/com/google/samples/apps/nowinandroid/Utils.kt renamed to benchmarks/src/main/java/com/google/samples/apps/nowinandroid/Utils.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@
1616

1717
package com.google.samples.apps.nowinandroid
1818

19-
import com.google.samples.apps.nowinandroid.benchmark.BuildConfig
19+
import com.google.samples.apps.nowinandroid.benchmarks.BuildConfig
2020

2121
/**
2222
* Convenience parameter to use proper package name with regards to build type and build flavor.
2323
*/
24-
const val PACKAGE_NAME =
25-
"com.google.samples.apps.nowinandroid.${BuildConfig.FLAVOR}.${BuildConfig.BUILD_TYPE}"
24+
val PACKAGE_NAME = StringBuilder("com.google.samples.apps.nowinandroid").apply {
25+
if (BuildConfig.FLAVOR != "prod") {
26+
append(".${BuildConfig.FLAVOR}")
27+
}
28+
if (BuildConfig.BUILD_TYPE != "release") {
29+
append(".${BuildConfig.BUILD_TYPE}")
30+
}
31+
}.toString()

0 commit comments

Comments
 (0)