diff --git a/.gitignore b/.gitignore index cbf04e1bd..12a398578 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ proguard libs *.DS_Store src/de/danoeh/antennapod/util/flattr/FlattrConfig.java +gradle.properties diff --git a/build.gradle b/build.gradle index 052d9ee27..1d33ad5cc 100644 --- a/build.gradle +++ b/build.gradle @@ -35,6 +35,31 @@ android { 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 { main { manifest.srcFile 'AndroidManifest.xml' @@ -51,5 +76,10 @@ android { debug { packageNameSuffix ".debug" } + release { + runProguard true + proguardFile 'proguard.cfg' + signingConfig signingConfigs.releaseConfig + } } } diff --git a/proguard.cfg b/proguard.cfg index 489af0536..ddeaeff81 100644 --- a/proguard.cfg +++ b/proguard.cfg @@ -8,11 +8,6 @@ -optimizations !code/simplification/arithmetic -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.Application -keep public class * extends android.app.Service