Edited 2023-01-16
Android Gradle Plugin 8.0.0-alpha10 and higher comes with new functionality that allows you to have Baseline Profiles in each build variant.
You can now have the rules in these files:
src/main/baseline-prof.txt
(as before)
src/main/baselineProfiles/*.txt
src/[variant]/baselineProfiles/*.txt
You can also have multiple files with generated rules, so for example in addition to the generated rules, you can have couple of manually specified.
There's also option to specify custom folder in build.gradle(.kts) by using (which can be overriden in a buildType or a product flavor)
sourceSets {
main {
baselineProfiles.srcDirs("[path to folder]")
}
}
Original answer
Currently this feature is not supported, the profile is accepted only from src/main/baseline-prof.txt
.
As a workaround, theoretically you could hook a Gradle task into the build tasks, which would copy the desired profile into the required location.
We're aware this can be a blocker, so stay tuned for future updates.