diff --git a/.gitignore b/.gitignore index e0b45ef7..dba5cc47 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,5 @@ example/proguard-project.txt *proguard-project.txt .gradle/ +gradle/* +gradlew* diff --git a/ListViewAnimationsExample.apk b/ListViewAnimationsExample.apk index 03efb3ed..ae38cba2 100644 Binary files a/ListViewAnimationsExample.apk and b/ListViewAnimationsExample.apk differ diff --git a/README.md b/README.md index 913ef583..ead66a33 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,13 @@ Setup Add the following to your `build.gradle`: repositories { + + mavenCentral() } dependencies{ - compile 'com.nhaarman.listviewanimations:library:2.5.2' + compile 'com.nhaarman.listviewanimations:library:2.6.0' } **Or**: @@ -63,7 +65,7 @@ Add the following to your `pom.xml`: com.nhaarman.listviewanimations library - 2.5.2 + 2.6.0 Usage @@ -105,7 +107,7 @@ License [1]: https://play.google.com/store/apps/details?id=com.haarman.listviewanimations [2]: http://nineoldandroids.com/ [3]: http://en.wikipedia.org/wiki/Decorator_pattern - [4]: https://github.com/nhaarman/ListViewAnimations/blob/master/com.haarman.listviewanimations-2.5.2.jar?raw=true + [4]: https://github.com/nhaarman/ListViewAnimations/blob/master/com.haarman.listviewanimations-2.6.0.jar?raw=true [5]: https://gist.github.com/romannurik/2980593 [6]: https://play.google.com/store/apps/details?id=com.haarman.treinverkeer [7]: https://www.twitter.com/niekfct @@ -123,3 +125,5 @@ License [20]: https://play.google.com/store/apps/details?id=com.cafetaso.foodinfo [21]: https://play.google.com/store/apps/details?id=sa.voorleesVerhaaltjes [22]: https://play.google.com/store/apps/details?id=com.seedform.counter + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index de08a015..0fe6e91c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,23 @@ +import java.util.regex.Pattern + buildscript { repositories { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:0.6.1+' + classpath 'com.android.tools.build:gradle:0.8.+' } } +def isReleaseBuild() { + println version + return version.contains("SNAPSHOT") == false +} + allprojects { - group = 'com.haarman.listviewanimations' + group = 'com.nhaarman.listviewanimations' + version = VERSION_NAME repositories { mavenCentral() @@ -19,3 +27,61 @@ allprojects { options.encoding = 'UTF-8' } } + + +task('increaseVersionCode') << { + def files = new File[2]; + files[0] = file("library/AndroidManifest.xml") + files[1] = file("example/AndroidManifest.xml") + def pattern = Pattern.compile("versionCode=\"(\\d+)\"") + for (int i = 0; i < files.length; ++i) { + def manifestText = files[i].getText() + def matcher = pattern.matcher(manifestText) + matcher.find() + def currentVersionCode = Long.parseLong(matcher.group(1)); + def versionCode = Long.parseLong(new Date().format('yyyyMMdd') + "1") + while (versionCode <= currentVersionCode) { + ++versionCode + } + println(versionCode) + def manifestContent = matcher.replaceAll("versionCode=\"" + versionCode + "\"") + files[i].write(manifestContent) + } +} + +task('syncVersionName') << { + def manifestFiles = new File[2]; + manifestFiles[0] = file("library/AndroidManifest.xml") + manifestFiles[1] = file("example/AndroidManifest.xml") + def pattern = Pattern.compile("versionName=\"(.+)\"") + for (int i = 0; i < manifestFiles.length; ++i) { + def manifestText = manifestFiles[i].getText() + def matcher = pattern.matcher(manifestText) + matcher.find() + def manifestContent = matcher.replaceAll("versionName=\"" + version + "\"") + manifestFiles[i].write(manifestContent) + } + + def readmeFile = file("README.md") + def readmeText = readmeFile.getText() + def matcher = pattern.matcher(readmeText) + matcher.find() + def previousVersion = matcher.group(1) + def readmeContent = readmeText.replaceAll(previousVersion, version) + + pattern = Pattern.compile("repostart -->(.+)" + repo + "