Skip to content

Commit

Permalink
Configure baseline profiles in the baselineProfile lambda
Browse files Browse the repository at this point in the history
This is the correct and easiest way to set up baseline profiles
correctly. See b/313428246 for more context.

Change-Id: Iea68ba5bcdbf62f377cae146ff56603448458726
  • Loading branch information
keyboardsurfer committed Feb 12, 2024
1 parent f64f1c0 commit 9ffa270
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ android {
// who clones the code to sign and run the release variant, use the debug signing key.
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
signingConfig = signingConfigs.getByName("debug")
// Ensure Baseline Profile is fresh for release builds.
baselineProfile.automaticGenerationDuringBuild = true
}
}

Expand All @@ -72,6 +70,20 @@ android {
namespace = "com.google.samples.apps.nowinandroid"
}

baselineProfile {
saveInSrc = false
// Don't build on every iteration of a full assemble.
// Instead enable generation directly for the release build variant.
automaticGenerationDuringBuild = false
mergeIntoMain = true
variants {
create("release") {
// Ensure Baseline Profile is fresh for release builds.
automaticGenerationDuringBuild = true
}
}
}

dependencies {
implementation(projects.feature.interests)
implementation(projects.feature.foryou)
Expand Down

0 comments on commit 9ffa270

Please sign in to comment.