Add version back into build.gradle for fdroid and

made singing releases optional (only when keys.properties exists)
captchafix
Florens Douwes 11 years ago
parent 6b4ef28063
commit aebcaf8605
  1. 32
      Clover/app/build.gradle

@ -2,22 +2,14 @@ apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1"
Properties versionProps = new Properties()
versionProps.load(new FileInputStream(file('version.properties')))
/* in app/version.properties:
code=10
name=v1.0
*/
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionName versionProps['name']
versionCode versionProps['code'].toInteger()
versionName "v1.1"
versionCode 24
}
compileOptions {
@ -25,16 +17,21 @@ android {
targetCompatibility JavaVersion.VERSION_1_7
}
Properties props = new Properties()
props.load(new FileInputStream(file('keys.properties')))
/* in app/keys.properties:
keystoreFile=key.keystore
/*
If you want to sign releases, make a file in app/keys.properties with the following content:
keystoreFile=yourkey.store
keystorePass=pass
keyAlias=alias
keyPass=pass
*/
File f = file('keys.properties')
boolean doSign = f.exists();
if (doSign) {
Properties props = new Properties()
props.load(new FileInputStream(f))
signingConfigs {
release {
storeFile file(props['keystoreFile'])
@ -43,11 +40,14 @@ android {
keyPassword props['keyPass']
}
}
}
buildTypes {
release {
if (doSign) {
signingConfig signingConfigs.release
}
}
beta.initWith(buildTypes.release)
beta {

Loading…
Cancel
Save