Configure signed Android release builds
This commit is contained in:
@@ -1,6 +1,15 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'org.jetbrains.kotlin.android'
|
apply plugin: 'org.jetbrains.kotlin.android'
|
||||||
|
|
||||||
|
def apiBaseUrl = project.findProperty("API_BASE_URL") ?: "https://sign.linkedcorp.net/api"
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||||
|
def hasReleaseKeystore = keystorePropertiesFile.exists()
|
||||||
|
|
||||||
|
if (hasReleaseKeystore) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace 'net.linkedcorp.linkedsign'
|
namespace 'net.linkedcorp.linkedsign'
|
||||||
compileSdk 35
|
compileSdk 35
|
||||||
@@ -12,7 +21,18 @@ android {
|
|||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "0.1.0"
|
versionName "0.1.0"
|
||||||
|
|
||||||
buildConfigField "String", "API_BASE_URL", "\"http://192.168.222.72:4000\""
|
buildConfigField "String", "API_BASE_URL", "\"${apiBaseUrl}\""
|
||||||
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
if (hasReleaseKeystore) {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file(keystoreProperties['storeFile'])
|
||||||
|
storePassword keystoreProperties['storePassword']
|
||||||
|
keyAlias keystoreProperties['keyAlias']
|
||||||
|
keyPassword keystoreProperties['keyPassword']
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -22,6 +42,9 @@ android {
|
|||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
if (hasReleaseKeystore) {
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user