prepare Release mode

This commit is contained in:
tibbi 2016-04-25 23:30:32 +02:00
parent f6f7ce3664
commit 8bffcaea20
3 changed files with 32 additions and 9 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/build
/captures
release.keystore
signing.properties

View File

@ -1,16 +1,9 @@
apply plugin: 'com.android.application'
android {
/*signingConfigs {
config {
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
storeFile file('../release.keystore')
storePassword RELEASE_STORE_PASSWORD
}
}*/
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.simplemobiletools.flashlight"
minSdkVersion 16
@ -18,11 +11,16 @@ android {
versionCode 1
versionName "1.0"
}
signingConfigs {
release
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//signingConfig signingConfigs.config
signingConfig signingConfigs.release
}
}
}
@ -31,3 +29,23 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
}
def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}

View File

@ -0,0 +1,4 @@
STORE_FILE=/path/to/your.keystore
STORE_PASSWORD=yourkeypass
KEY_ALIAS=projectkeyalias
KEY_PASSWORD=yourkeypass