Skip to content

Commit

Permalink
build: organize build and sign commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Oct 25, 2024
1 parent bcbd497 commit e194232
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ android {
}
}

// Automatic pipeline build
// build with '-Psign assembleRelease'
// output at 'app/build/outputs/apk/release/app-release.apk'
// build with '-Psign bundleRelease'
// output at 'app/build/outputs/bundle/release/app-release.aab'
if (project.hasProperty("sign")) {
android {
signingConfigs {
Expand All @@ -77,19 +82,27 @@ if (project.hasProperty("sign")) {
}
android.buildTypes.getByName("release").signingConfig =
android.signingConfigs.getByName("release")
}

// Manual Accrescent build
// build with '-Pmanual_upload_oss buildApksRelease'
// output at 'app/build/outputs/apkset/release/app-release.apks'
if (project.hasProperty("manual_upload_oss")) {
bundletool {
val properties = Properties()
properties.load(project.rootProject.file("local.properties").inputStream())
signingConfig {
storeFile = file(System.getenv("KEYSTORE_FILE"))
storePassword = System.getenv("KEYSTORE_PASSWD")
keyAlias = System.getenv("KEYSTORE_KEY_ALIAS")
keyPassword = System.getenv("KEYSTORE_KEY_PASSWD")
storeFile = file(properties.getProperty("uploadsigning_oss.file"))
storePassword = properties.getProperty("uploadsigning_oss.password")
keyAlias = properties.getProperty("uploadsigning_oss.key.alias")
keyPassword = properties.getProperty("uploadsigning_oss.key.password")
}
}

}

// Manual Google Play Store and Accrescent builds
// Manual Google Play Store build
// build with '-Pmanual_upload bundleRelease'
// output at 'app/build/outputs/bundle/release/app-release.aab'
if (project.hasProperty("manual_upload")) {
val properties = Properties()
properties.load(project.rootProject.file("local.properties").inputStream())
Expand All @@ -104,15 +117,6 @@ if (project.hasProperty("manual_upload")) {
}
}
android.buildTypes.getByName("release").signingConfig = android.signingConfigs.getByName("upload")

bundletool {
signingConfig {
storeFile = file(properties.getProperty("uploadsigning.file"))
storePassword = properties.getProperty("uploadsigning.password")
keyAlias = properties.getProperty("uploadsigning.key.alias")
keyPassword = properties.getProperty("uploadsigning.key.password")
}
}
}

dependencies {
Expand Down

0 comments on commit e194232

Please sign in to comment.