Switch versioning to use git

This commit is contained in:
Jonas Kalderstam 2015-11-08 21:26:04 +01:00
parent 10be732d92
commit f441c1673c
3 changed files with 24 additions and 35 deletions

View File

@ -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

View File

@ -16,10 +16,14 @@ apply plugin: 'com.android.library'
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// 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"
}

View File

@ -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 {