Skip to content

Commit

Permalink
add build type with different package name for fossAutomotive
Browse files Browse the repository at this point in the history
needed for Faurecia Aptoide
  • Loading branch information
johan12345 committed May 19, 2024
1 parent fe2f9d9 commit 64809bf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ android {
)
signingConfig = signingConfigs.getByName("release")
}
create("releaseAutomotivePackageName") {
// Faurecia Aptoide requires the automotive variant to use a separate package name
initWith(getByName("release"))
applicationIdSuffix = ".automotive"
}
debug {
applicationIdSuffix = ".debug"
isDebuggable = true
Expand Down Expand Up @@ -218,6 +223,22 @@ android {
}
}

androidComponents {
beforeVariants { variantBuilder ->
if (variantBuilder.buildType == "releaseAutomotivePackageName"
&& !variantBuilder.productFlavors.containsAll(
listOf(
"automotive" to "automotive",
"dependencies" to "foss"
)
)
) {
// releaseAutomotivePackageName type is only needed for fossAutomotive
variantBuilder.enable = false
}
}
}

configurations {
create("googleNormalImplementation") {}
create("googleAutomotiveImplementation") {}
Expand Down

0 comments on commit 64809bf

Please sign in to comment.