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