Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Gradle scripts #840

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading