diff options
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | app/build.gradle | 37 | ||||
-rw-r--r-- | app/src/main/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | app/src/main/assets/.gitignore | 2 | ||||
-rw-r--r-- | app/src/main/templates/about.html (renamed from app/src/main/assets/about.html) | 6 |
5 files changed, 44 insertions, 4 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9e6042bf4..65d29f75a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1,5 +1,6 @@ Code contributions: +danieloeh patheticpat toggles ligi diff --git a/app/build.gradle b/app/build.gradle index d85803538..bb1fa26b7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,3 +1,5 @@ +import org.apache.tools.ant.filters.ReplaceTokens + apply plugin: 'com.android.application' repositories { @@ -24,6 +26,20 @@ dependencies { compile project(':library:drag-sort-listview') } +def getMyVersionName() { + def parsedManifestXml = (new XmlSlurper()) + .parse('app/src/main/AndroidManifest.xml') + .declareNamespace(android:"http://schemas.android.com/apk/res/android") + return parsedManifestXml.'@android:versionName' +} + +def getMyVersionCode() { + def parsedManifestXml = (new XmlSlurper()) + .parse('app/src/main/AndroidManifest.xml') + .declareNamespace(android:"http://schemas.android.com/apk/res/android") + return parsedManifestXml.'@android:versionCode'.toInteger() +} + android { compileSdkVersion 21 buildToolsVersion "21.1.2" @@ -31,6 +47,8 @@ android { defaultConfig { minSdkVersion 10 targetSdkVersion 21 + versionCode getMyVersionCode() + versionName "${getMyVersionName()}" testApplicationId "de.test.antennapod" testInstrumentationRunner "de.test.antennapod.AntennaPodTestRunner" } @@ -89,4 +107,21 @@ android { lintOptions { abortOnError false } -}
\ No newline at end of file +} + +// about.html is templatized so that we can automatically insert +// our version string in to it at build time. +task filterAbout { + inputs.files files(['src/main/templates/about.html', + 'src/main/AndroidManifest.xml']) + outputs.file 'src/main/assets/about.html' +} << { + copy { + from 'src/main/templates/about.html' + into 'src/main/assets' + filter(ReplaceTokens, tokens: [versionname: android.defaultConfig.versionName, + versioncode: android.defaultConfig.versionCode.toString()]) + } +} + +preBuild.dependsOn filterAbout
\ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7a4c8366e..97f8bbdad 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.danoeh.antennapod" android:versionCode="51" - android:versionName="1.1.1"> + android:versionName="1.2"> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> diff --git a/app/src/main/assets/.gitignore b/app/src/main/assets/.gitignore new file mode 100644 index 000000000..328840cfc --- /dev/null +++ b/app/src/main/assets/.gitignore @@ -0,0 +1,2 @@ +# this file is generated automatically +about.html diff --git a/app/src/main/assets/about.html b/app/src/main/templates/about.html index af7297564..3a48eeec1 100644 --- a/app/src/main/assets/about.html +++ b/app/src/main/templates/about.html @@ -41,9 +41,11 @@ <div id="header" align="center"> <img src="logo.png" alt="Logo" width="100px" height="100px"/> - <p>AntennaPod, Version 1.1</p> + <p>AntennaPod, Version @versionname@, Build @versioncode@</p> - <p>Copyright © 2014 Daniel Oeh</p> + <p>Created by Daniel Oeh</p> + + <p>Copyright © 2015 AntennaPod Contributors <a href="https://github.com/AntennaPod/AntennaPod/blob/master/CONTRIBUTORS">(View)</a></p> <p>Licensed under the MIT License <a href="LICENSE.html">(View)</a></p> </div> |