Skip to content
Merged
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
6 changes: 2 additions & 4 deletions baselineprofile/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@file:Suppress("UnstableApiUsage")

import com.android.build.api.dsl.ManagedVirtualDevice

plugins {
alias(libs.plugins.android.test)
alias(libs.plugins.kotlin.android)
Expand Down Expand Up @@ -52,8 +50,8 @@ android {
// This code creates the gradle managed device used to generate baseline profiles.
// To use GMD please invoke generation through the command line:
// ./gradlew :examples:paywall-tester:generateBaselineProfile
testOptions.managedDevices.devices {
create<ManagedVirtualDevice>("pixel6Api34") {
testOptions.managedDevices.localDevices {
create("pixel6Api34") {
device = "Pixel 6"
apiLevel = 34
systemImageSource = "aosp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,25 @@ internal fun Project.configureAndroidLibrary() {

defaultConfig {
minSdk = obtainMinSdkVersion()
targetSdk = targetSdkVersion
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
// AGP 9 defaults this to compileSdk, tightening the published floor from 1 to 36.
aarMetadata.minCompileSdk = 1
Comment thread
AlvaroBrey marked this conversation as resolved.
}

// AGP 9 removes targetSdk from a library's defaultConfig.
testOptions {
targetSdk = targetSdkVersion
unitTests.isIncludeAndroidResources = true
unitTests.all {
it.maxHeapSize = "1024m"
}
}

lint {
targetSdk = targetSdkVersion
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand Down
4 changes: 2 additions & 2 deletions examples/purchase-tester/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ android {
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
testProguardFiles(
getDefaultProguardFile("proguard-android.txt"),
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-test-rules.pro",
)
signingConfig = signingConfigs.getByName("release")
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ android {
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
testProguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
testProguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("release")
}
}
Expand Down
8 changes: 8 additions & 0 deletions integration-tests/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@
# Needed due to robolectric update
-dontwarn javax.lang.model.element.Modifier
-dontwarn com.google.errorprone.annotations.IncompatibleModifiers

# The app and androidTest APKs are minified separately but share a single classloader at
# runtime, and the test APK links against the Kotlin runtime and AndroidX test plumbing that
# ship inside the app APK. R8 optimization prunes whatever the app itself stops referencing,
# so the runner dies with NoSuchMethodError/NoClassDefFoundError before any test executes.
# This is an internal test app, so the size cost of keeping them does not matter.
-keep class kotlin.** { *; }
-keep class androidx.tracing.** { *; }