Added ability to build releases with gradle

This commit is contained in:
daniel oeh 2013-08-17 12:06:36 +02:00
parent 5fb6f376c0
commit aa135093af
3 changed files with 31 additions and 5 deletions

1
.gitignore vendored
View File

@ -41,3 +41,4 @@ proguard
libs libs
*.DS_Store *.DS_Store
src/de/danoeh/antennapod/util/flattr/FlattrConfig.java src/de/danoeh/antennapod/util/flattr/FlattrConfig.java
gradle.properties

View File

@ -35,6 +35,31 @@ android {
testInstrumentationRunner "instrumentationTest.de.test.antennapod.AntennaPodTestRunner" testInstrumentationRunner "instrumentationTest.de.test.antennapod.AntennaPodTestRunner"
} }
signingConfigs {
releaseConfig {
if (project.hasProperty('releaseStoreFile')) {
storeFile file(releaseStoreFile)
} else {
storeFile file('keystore')
}
if (project.hasProperty('releaseStorePassword')) {
storePassword releaseStorePassword
} else {
storePassword "password"
}
if (project.hasProperty('releaseKeyAlias')) {
keyAlias releaseKeyAlias
} else {
keyAlias "alias"
}
if (project.hasProperty('releaseKeyPassword')) {
keyPassword releaseKeyPassword
} else {
keyPassword "password"
}
}
}
sourceSets { sourceSets {
main { main {
manifest.srcFile 'AndroidManifest.xml' manifest.srcFile 'AndroidManifest.xml'
@ -51,5 +76,10 @@ android {
debug { debug {
packageNameSuffix ".debug" packageNameSuffix ".debug"
} }
release {
runProguard true
proguardFile 'proguard.cfg'
signingConfig signingConfigs.releaseConfig
}
} }
} }

View File

@ -8,11 +8,6 @@
-optimizations !code/simplification/arithmetic -optimizations !code/simplification/arithmetic
-keepattributes *Annotation* -keepattributes *Annotation*
#-libraryjars libs/android-support-v4.jar
#-libraryjars libs/commons-lang3-3.1.jar
#-libraryjars libs/flattr4j-core-2.4.jar
#-libraryjars libs/commons-io-2.4.jar
-keep public class * extends android.app.Activity -keep public class * extends android.app.Activity
-keep public class * extends android.app.Application -keep public class * extends android.app.Application
-keep public class * extends android.app.Service -keep public class * extends android.app.Service