Skip to content

Commit

Permalink
Improve Gradle scripts (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 authored Dec 19, 2024
1 parent 2c7e37f commit 9aa8f3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ class PillarboxAndroidApplicationPlugin : Plugin<Project> {

defaultConfig {
applicationId = namespace
resourceConfigurations += "en"
targetSdk = AppConfig.targetSdk
versionCode = VersionConfig().versionCode()
versionName = VersionConfig().versionName()
vectorDrawables.useSupportLibrary = true
}

signingConfigs {
create("release") {
register("release") {
val password = System.getenv("DEMO_KEY_PASSWORD") ?: extra.properties["pillarbox.keystore.password"] as String?

storeFile = file("./demo.keystore")
Expand All @@ -60,7 +61,7 @@ class PillarboxAndroidApplicationPlugin : Plugin<Project> {
}

release {
signingConfig = signingConfigs.named("release").get()
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = false
isDebuggable = true

Expand Down
21 changes: 7 additions & 14 deletions pillarbox-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ android {
val versionDimension = "version"
flavorDimensions += versionDimension
productFlavors {
create("prod") {
register("prod") {
dimension = versionDimension
}

create("nightly") {
dimension = versionDimension
applicationIdSuffix = ".nightly"
versionNameSuffix = "-nightly"
if (System.getenv("CI") == "true") {
register("nightly") {
dimension = versionDimension
applicationIdSuffix = ".nightly"
versionNameSuffix = "-nightly"
}
}
}

Expand All @@ -30,15 +32,6 @@ android {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

// Hide nightly flavors from BuildVariants in AndroidStudio
androidComponents {
beforeVariants { variant ->
val isCI = System.getenv("CI")?.toBooleanStrictOrNull() ?: false

variant.enable = isCI || variant.flavorName != "nightly"
}
}
}

dependencies {
Expand Down

0 comments on commit 9aa8f3c

Please sign in to comment.