diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 97ac7b621..7915ff8c3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -45,15 +45,25 @@ android { signingConfigs { val properties = configProperties - val certificateFile = properties?.getProperty("playStore.storeFile") - if (properties != null && certificateFile != null) { + val playStoreCertificateFile = properties?.getProperty("playStore.storeFile") + if (properties != null && playStoreCertificateFile != null) { signingConfigs.create("playStore") { - storeFile(File(certificateFile)) + storeFile(File(playStoreCertificateFile)) storePassword(properties.getProperty("playStore.storePassword")) keyAlias(properties.getProperty("playStore.keyAlias")) keyPassword(properties.getProperty("playStore.keyPassword")) } } + + val alternativeCertificateFile = properties?.getProperty("alternative.storeFile") + if (properties != null && alternativeCertificateFile != null) { + signingConfigs.create("alternative") { + storeFile(File(alternativeCertificateFile)) + storePassword(properties.getProperty("alternative.storePassword")) + keyAlias(properties.getProperty("alternative.keyAlias")) + keyPassword(properties.getProperty("alternative.keyPassword")) + } + } } buildTypes { @@ -67,10 +77,18 @@ android { create("releasePlayStore") { initWith(getByName("release")) - signingConfig = try { signingConfigs.getByName("playStore") - } catch (e: UnknownDomainObjectException) { + } catch (error: UnknownDomainObjectException) { + signingConfigs.getByName("debug") + } + } + + create("releaseAlternative") { + initWith(getByName("release")) + signingConfig = try { + signingConfigs.getByName("alternative") + } catch (error: UnknownDomainObjectException) { signingConfigs.getByName("debug") } } @@ -81,6 +99,11 @@ android { java.srcDirs("src/release/kotlin") res.srcDirs("src/release/res") } + + named("releaseAlternative") { + java.srcDirs("src/release/kotlin") + res.srcDirs("src/release/res") + } } buildFeatures {