diff --git a/.github/workflows/macrobenchmark.yml b/.github/workflows/macrobenchmark.yml index cbc22596..e9cc1d11 100644 --- a/.github/workflows/macrobenchmark.yml +++ b/.github/workflows/macrobenchmark.yml @@ -55,10 +55,13 @@ jobs: - name: Build Macrobenchmark Sample run: > ./gradlew assemble \ + -x :macrobenchmark:pixel6Api31Setup \ -x :macrobenchmark:pixel6Api31NonMinifiedReleaseAndroidTest \ -x :macrobenchmark:collectNonMinifiedReleaseBaselineProfile \ - -Pandroidx.benchmark.enabledRules=BaselineProfile \ + -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules="none" \ -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" \ -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=180 \ -Pandroid.experimental.androidTest.numManagedDeviceShards=1 \ - -Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1 + -Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1 \ + -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true + diff --git a/MacrobenchmarkSample/app/benchmark-rules.pro b/MacrobenchmarkSample/app/benchmark-rules.txt similarity index 100% rename from MacrobenchmarkSample/app/benchmark-rules.pro rename to MacrobenchmarkSample/app/benchmark-rules.txt diff --git a/MacrobenchmarkSample/app/build.gradle.kts b/MacrobenchmarkSample/app/build.gradle.kts index 23beb2ca..6563650c 100644 --- a/MacrobenchmarkSample/app/build.gradle.kts +++ b/MacrobenchmarkSample/app/build.gradle.kts @@ -22,7 +22,7 @@ plugins { } android { - compileSdk = 35 + compileSdk = 36 namespace = "com.example.macrobenchmark.target" defaultConfig { @@ -30,7 +30,7 @@ android { versionCode = 1 versionName = "1.0" minSdk = 24 - targetSdk = 35 + targetSdk = 36 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -41,15 +41,16 @@ android { // [START macrobenchmark_setup_app_build_type] buildTypes { - getByName("release") { + release { isMinifyEnabled = true isShrinkResources = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "keep-rules.pro" ) // In real app, this would use its own release keystore signingConfig = signingConfigs.getByName("debug") + baselineProfile.automaticGenerationDuringBuild = true } } // [END macrobenchmark_setup_app_build_type] @@ -58,12 +59,6 @@ android { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - freeCompilerArgs = freeCompilerArgs + listOf( - "-opt-in=kotlin.RequiresOptIn" - ) - } } dependencies { diff --git a/MacrobenchmarkSample/app/keep-rules.pro b/MacrobenchmarkSample/app/keep-rules.pro new file mode 100644 index 00000000..7d6786e0 --- /dev/null +++ b/MacrobenchmarkSample/app/keep-rules.pro @@ -0,0 +1,6 @@ +# Add project specific Keep Rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle.kts. +# +# For more details, see +# http://developer.android.com/r8 \ No newline at end of file diff --git a/MacrobenchmarkSample/app/proguard-rules.pro b/MacrobenchmarkSample/app/proguard-rules.pro deleted file mode 100644 index 2a5cc63d..00000000 --- a/MacrobenchmarkSample/app/proguard-rules.pro +++ /dev/null @@ -1,27 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -# TODO can be removed when https://github.com/square/curtains/issues/36 is fixed and 1.2.5+ is released -# Fixes missing method crash --keepclassmembers class android.view.JavaViewSpy { - static int windowAttachCount(android.view.View); -} diff --git a/MacrobenchmarkSample/app/src/main/AndroidManifest.xml b/MacrobenchmarkSample/app/src/main/AndroidManifest.xml index ab34acde..6536dfe1 100644 --- a/MacrobenchmarkSample/app/src/main/AndroidManifest.xml +++ b/MacrobenchmarkSample/app/src/main/AndroidManifest.xml @@ -14,7 +14,7 @@ android:theme="@style/Theme.Macrobenchmarktarget"> + tools:targetApi="29" />