Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Thanks for submitting a pull request. To accept your pull request we need you do
**Ensure tests pass and code is formatted correctly**

- Run local tests on the `DemoDebug` variant by running `./gradlew testDemoDebug`
- Fix code formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`
- Fix code formatting: `./gradlew spotlessApply`

**Add a description**

Expand All @@ -23,3 +23,5 @@ We need to know what you've done and why you've done it. Include a summary of wh
**What I have done and why**

\<add your PR description here\>

NEW FEATURE
2 changes: 2 additions & 0 deletions .github/workflows/PerformanceCheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
gradle-cache-readonly: false
baseline-branch: "main"
candidate-branch: "${{ github.head_ref }}"
runs: 10
args: "--verbose --all-methods --measures TID FFO MEM_RSS_MAX --aggregate median --fit 5"
instrument-args: "-e package com.google.samples.apps.nowinandroid.Generator"
artifact-name: "benchcomp-${{ matrix.name }}.json"
artifact-macrobenchmark-name: "${{ matrix.name }}-raw-macrobenchmark"
Expand Down
1 change: 0 additions & 1 deletion .run/spotlessApply.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--init-script=gradle/init.gradle.kts" />
<option name="taskDescriptions">
<list />
</option>
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The main Android app lives in the `app/` folder. Feature modules live in `featur
The app and Android libraries have two product flavors: `demo` and `prod`, and two build types: `debug` and `release`.

- Build: `./gradlew assemble{Variant}`. Typically `assembleDemoDebug`.
- Fix linting/formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`
- Fix linting/formatting: `./gradlew spotlessApply`
- Run local tests: `./gradlew {variant}Test`
- Run single test: `./gradlew {variant}Test --tests "com.example.myapp.MyTestClass"`
- Run local screenshot tests: `./gradlew verifyRoborazziDemoDebug`
Expand Down
2 changes: 1 addition & 1 deletion app-nia-catalog/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
</activity>
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</adaptive-icon>
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</adaptive-icon>
2 changes: 1 addition & 1 deletion app-nia-catalog/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
-->
<resources>
<string name="app_name">NiA Catalog</string>
</resources>
</resources>
2 changes: 1 addition & 1 deletion app-nia-catalog/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
-->
<resources>
<style name="Theme.NiaCatalog" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
</resources>
2 changes: 1 addition & 1 deletion app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
:core:datastore-proto[datastore-proto]:::android-library
:core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class NiaApplication : Application(), ImageLoaderFactory {
lateinit var profileVerifierLogger: ProfileVerifierLogger

override fun onCreate() {
// Note: Increase Time to Initial Display metric by 100ms
Thread.sleep(100)

super.onCreate()

setStrictModePolicy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package com.google.samples.apps.nowinandroid.util

import android.util.Log
import androidx.profileinstaller.ProfileVerifier
import com.google.samples.apps.nowinandroid.core.network.di.ApplicationScope
import com.google.samples.apps.nowinandroid.core.common.network.di.ApplicationScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.guava.await
import kotlinx.coroutines.launch
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</adaptive-icon>
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</adaptive-icon>
2 changes: 1 addition & 1 deletion app/src/prod/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
android:name="firebase_analytics_collection_deactivated"
android:value="false" />
</application>
</manifest>
</manifest>
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
:core:datastore-proto[datastore-proto]:::android-library
:core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.benchmark.macro.ExperimentalMetricApi
import androidx.benchmark.macro.FrameTimingMetric
import androidx.benchmark.macro.MemoryUsageMetric
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.StartupTimingMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.uiautomator.By
Expand All @@ -17,20 +16,20 @@ import org.junit.runner.RunWith

@OptIn(ExperimentalMetricApi::class)
@RunWith(AndroidJUnit4::class)
class BookmarkForYouArticle_MU {
class BookmarkForYouArticle_Bench {
@get:Rule
val benchmarkRule = MacrobenchmarkRule()

@Test
fun measure() = benchmarkRule.measureRepeated(
fun bookmarkForYouArticle() = benchmarkRule.measureRepeated(
packageName = "com.google.samples.apps.nowinandroid.demo",
metrics = listOf(MemoryUsageMetric(MemoryUsageMetric.Mode.Max)),
metrics = listOf(MemoryUsageMetric(MemoryUsageMetric.Mode.Max), FrameTimingMetric()),
startupMode = StartupMode.WARM,
compilationMode = CompilationMode.Partial(
baselineProfileMode = BaselineProfileMode.Disable,
warmupIterations = 3,
warmupIterations = 1,
),
iterations = 10,
iterations = 5,
setupBlock = {
pressHome()
startActivityAndWait()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.benchmark.macro.ExperimentalMetricApi
import androidx.benchmark.macro.FrameTimingMetric
import androidx.benchmark.macro.MemoryUsageMetric
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.StartupTimingMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.uiautomator.By
Expand All @@ -17,20 +16,20 @@ import org.junit.runner.RunWith

@OptIn(ExperimentalMetricApi::class)
@RunWith(AndroidJUnit4::class)
class FollowInterestTopic_MU {
class FollowInterestTopic_Bench {
@get:Rule
val benchmarkRule = MacrobenchmarkRule()

@Test
fun measure() = benchmarkRule.measureRepeated(
fun followInterestTopic() = benchmarkRule.measureRepeated(
packageName = "com.google.samples.apps.nowinandroid.demo",
metrics = listOf(MemoryUsageMetric(MemoryUsageMetric.Mode.Max)),
metrics = listOf(MemoryUsageMetric(MemoryUsageMetric.Mode.Max), FrameTimingMetric()),
startupMode = StartupMode.WARM,
compilationMode = CompilationMode.Partial(
baselineProfileMode = BaselineProfileMode.Disable,
warmupIterations = 3,
warmupIterations = 1,
),
iterations = 10,
iterations = 5,
setupBlock = {
pressHome()
startActivityAndWait()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GeneratedStartupBenchmark {
val benchmarkRule = MacrobenchmarkRule()

@Test
fun measure() = benchmarkRule.measureRepeated(
fun startupTime() = benchmarkRule.measureRepeated(
packageName = "com.google.samples.apps.nowinandroid.demo",
metrics = listOf(StartupTimingMetric()),
startupMode = StartupMode.COLD,
Expand Down
1 change: 1 addition & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies {
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
compileOnly(libs.room.gradlePlugin)
compileOnly(libs.spotless.gradlePlugin)
implementation(libs.truth)
lintChecks(libs.androidx.lint.gradle)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import com.android.build.api.dsl.ApplicationExtension
Expand Down
Loading
Loading