plugins { // No version for AGP: `com.android.application` in :app has already put it on the build's plugin // classpath. The version is the one in the catalog. id("com.android.test") alias(libs.plugins.androidx.baselineprofile) } /** * Generates the app's baseline profile from a device run. * * The profile is a list of the classes and methods that the first journey touches, so the platform can * AOT-compile exactly those at install time instead of guessing. `:app` bundles whatever ends up in * `app/src/main/baseline-prof.txt`; this module is how that file is produced, and how it is produced * again when the startup path changes. * * ./gradlew :baselineprofile:generateBaselineProfile * * It profiles the app's `benchmark` build type rather than `release`: same sources and the same R8 * rules, so the same class names, but with `` in its manifest, which * profiling requires and which a shipped release build does not carry. */ android { namespace = "de.softwareapp_hb.filemanager.baselineprofile" compileSdk = 36 defaultConfig { minSdk = 26 targetSdk = 36 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } targetProjectPath = ":app" // Test modules pick their target variant by name in AGP 9 (see :benchmark's build file), so // declaring one called `benchmark` is what makes this profile :app's benchmark build. buildTypes { create("benchmark") { // A declared build type starts unsigned; an unsigned test APK cannot be installed. initWith(getByName("debug")) } } experimentalProperties["android.experimental.self-instrumenting"] = true compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } } dependencies { implementation(libs.androidx.benchmark.macro.junit4) implementation(libs.androidx.test.ext.junit) implementation(libs.androidx.test.uiautomator) implementation(libs.androidx.test.runner) }