Skip to content

Commit

Permalink
Added signing.properties according to https://gist.github.com/gabriel…
Browse files Browse the repository at this point in the history
  • Loading branch information
zdavatz committed Feb 2, 2018
1 parent f0c42b6 commit e16af6f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
*.iws
*.jar
*.war

signing.properties
28 changes: 25 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ apply plugin: 'com.android.application'

android {
signingConfigs {
}
release

}
compileSdkVersion 26
defaultConfig {
applicationId "oddb.org.generika"
Expand All @@ -16,10 +18,10 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.config
signingConfig signingConfigs.release
}
}

Expand All @@ -38,3 +40,23 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

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
}

0 comments on commit e16af6f

Please sign in to comment.