Skip to content

Commit a533e9e

Browse files
committed
Configured release signing.
Signed-off-by: Rohan Khayech <rohankhayech@gmail.com> (cherry picked from commit a7fe5ed)
1 parent 431c8a3 commit a533e9e

3 files changed

Lines changed: 44 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
/captures
99
.externalNativeBuild
1010
.cxx
11-
/.kotlin
11+
/.kotlin
12+
*.jks
13+
keystore.properties

app/build.gradle.kts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818

19+
import java.util.Properties
20+
import com.mikepenz.aboutlibraries.plugin.DuplicateRule
1921
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2022

2123
plugins {
@@ -26,6 +28,12 @@ plugins {
2628
alias(libs.plugins.kotlin.serialization.plugin)
2729
}
2830

31+
val keystorePropertiesFile: File = rootProject.file("keystore.properties")
32+
val keystoreProperties = Properties()
33+
if (keystorePropertiesFile.exists()) {
34+
keystoreProperties.load(keystorePropertiesFile.inputStream())
35+
}
36+
2937
android {
3038
namespace = "com.rohankhayech.choona.app"
3139

@@ -40,11 +48,23 @@ android {
4048
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4149
}
4250

51+
signingConfigs {
52+
create("release") {
53+
if (keystoreProperties.isNotEmpty()) {
54+
keyAlias = keystoreProperties["keyAlias"] as String
55+
keyPassword = keystoreProperties["keyPassword"] as String
56+
storeFile = file(keystoreProperties["storeFile"] as String)
57+
storePassword = keystoreProperties["storePassword"] as String
58+
}
59+
}
60+
}
61+
4362
buildTypes {
4463
release {
4564
isMinifyEnabled = true
4665
isShrinkResources = true
4766
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
67+
signingConfig = signingConfigs.getByName("release")
4868
}
4969
debug {
5070
applicationIdSuffix = ".dev"
@@ -141,13 +161,13 @@ aboutLibraries {
141161
}
142162

143163
export {
144-
// Allows to exclude some fields from the generated meta data field.
164+
// Allows to exclude some fields from the generated metadata field.
145165
// If the class name is specified, the field is only excluded for that class; without a class name, the exclusion is global.
146166
excludeFields.addAll("generated", "funding", "scm", "website")
147167
}
148168

149169
library {
150170
// Configure the duplication rule, to match "duplicates" with
151-
duplicationRule = com.mikepenz.aboutlibraries.plugin.DuplicateRule.SIMPLE
171+
duplicationRule = DuplicateRule.SIMPLE
152172
}
153173
}

wear/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818

19+
import java.util.Properties
1920
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2021

2122
plugins {
@@ -26,6 +27,12 @@ plugins {
2627
alias(libs.plugins.kotlin.serialization.plugin)
2728
}
2829

30+
val keystorePropertiesFile: File = rootProject.file("keystore.properties")
31+
val keystoreProperties = Properties()
32+
if (keystorePropertiesFile.exists()) {
33+
keystoreProperties.load(keystorePropertiesFile.inputStream())
34+
}
35+
2936
android {
3037
namespace = "com.rohankhayech.choona.wear"
3138

@@ -39,11 +46,23 @@ android {
3946
versionName = "1.6.1-beta.1"
4047
}
4148

49+
signingConfigs {
50+
create("release") {
51+
if (keystoreProperties.isNotEmpty()) {
52+
keyAlias = keystoreProperties["keyAlias"] as String
53+
keyPassword = keystoreProperties["keyPassword"] as String
54+
storeFile = file(keystoreProperties["storeFile"] as String)
55+
storePassword = keystoreProperties["storePassword"] as String
56+
}
57+
}
58+
}
59+
4260
buildTypes {
4361
release {
4462
isMinifyEnabled = true
4563
isShrinkResources = true
4664
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
65+
signingConfig = signingConfigs.getByName("release")
4766
}
4867
debug {
4968
applicationIdSuffix = ".dev"

0 commit comments

Comments
 (0)