diff --git a/gradle.properties b/gradle.properties index c7f296c..729cde9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,23 +16,3 @@ # # Project-wide Gradle settings. - -VERSION_NAME=2.4.2 -VERSION_CODE=25 -GROUP=com.nononsenseapps - -PROJECT_NAME=com.nononsenseapps:filepicker -POM_ARTIFACT_ID=filepicker -POM_DESCRIPTION=An extendable Android file/directory-picker you can include in your app -POM_URL=https://github.com/spacecowboy/NoNonsense-FilePicker -POM_SCM_URL=https://github.com/spacecowboy/NoNonsense-FilePicker -POM_SCM_CONNECTION=scm:git@github.com:spacecowboy/NoNonsense-FilePicker.git -POM_SCM_DEV_CONNECTION=scm:git@github.com:spacecowboy/NoNonsense-FilePicker.git -POM_LICENCE_NAME=LGPL-3.0 -POM_LICENCE_URL=https://www.gnu.org/licenses/lgpl.txt -POM_LICENCE_DIST=repo -POM_DEVELOPER_ID=neckbeard -POM_DEVELOPER_NAME=Jonas Kalderstam -POM_DEVELOPER_EMAIL=jonas@kalderstam.se - -POM_URL_ISSUES=https://github.com/spacecowboy/NoNonsense-FilePicker/issues diff --git a/library/build.gradle b/library/build.gradle index bbe40ca..0718b7e 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -16,10 +16,14 @@ apply plugin: 'com.android.library' * along with this program. If not, see . */ -// must be applied after your artifact generating plugin (eg. java / -// com.android.library) +// must be applied after your artifact generating plugin (eg. java / com.android.library) apply plugin: 'bintray-release' +// query git for the the SHA, Tag and commit count. Use these to automate versioning. +def gitTag = 'git describe --tags'.execute([], project.rootDir).text.trim() +def gitCommitCount = + Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim()) + android { compileSdkVersion 23 buildToolsVersion "23.0.1" @@ -27,8 +31,8 @@ android { defaultConfig { minSdkVersion 9 targetSdkVersion 23 - versionCode Integer.parseInt(project.VERSION_CODE) - versionName project.VERSION_NAME + versionCode gitCommitCount + versionName gitTag } } @@ -42,13 +46,13 @@ dependencies { } publish { - groupId = GROUP - artifactId = POM_ARTIFACT_ID - publishVersion = VERSION_NAME - description = POM_DESCRIPTION - website = POM_URL - licences = ['LGPL-3.0'] - uploadName = PROJECT_NAME - bintrayUser = project.hasProperty("BINTRAY_USER")? BINTRAY_USER: "Dummy" - bintrayKey = project.hasProperty("BINTRAY_KEY") ? BINTRAY_KEY: "Dummy" + groupId = 'com.nononsenseapps' + artifactId = 'filepicker' + publishVersion = gitTag + description = 'An extendable Android file/directory-picker you can include in your app' + website = 'https://github.com/spacecowboy/NoNonsense-FilePicker' + licences = ['LGPL-3.0'] + uploadName = 'com.nononsenseapps:filepicker' + bintrayUser = project.hasProperty("BINTRAY_USER")? BINTRAY_USER: "Dummy" + bintrayKey = project.hasProperty("BINTRAY_KEY") ? BINTRAY_KEY: "Dummy" } diff --git a/sample/build.gradle b/sample/build.gradle index 24b1d90..0220a85 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -17,6 +17,10 @@ apply plugin: 'com.android.application' +def gitTag = 'git describe --tags'.execute([], project.rootDir).text.trim() +def gitCommitCount = + Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim()) + android { compileSdkVersion 23 buildToolsVersion "23.0.1" @@ -29,8 +33,9 @@ android { defaultConfig { minSdkVersion 9 targetSdkVersion 23 - versionCode Integer.parseInt(project.VERSION_CODE) - versionName project.VERSION_NAME + versionCode gitCommitCount + versionName gitTag + archivesBaseName = "nononsensefilepicker-sample-${gitTag}".toString() } buildTypes {