I'm a minecraft modder, and I use the ForgeGradle plugin to build my mods.
I'm currently attempting to setup a versioning scheme based on my git revisions and hash. Under arch linux's PKGBUILD system I would use:
pkgver() {
cd $_pkgbase
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
which would end up with something along the lines of r392.2cc2ebc
I'm attempting with the following:
ext.revision = 'git rev-list --count HEAD'.execute()
ext.hash = 'git rev-parse --short HEAD'.execute()
version = "r${revision.text}.${hash.text}"
which gets me almost what I need, r70?.11ae542?
; not sure how to get rid of the ?
in each portion of the version.
Gradle 2.0, suggestions?
Further investigation due to Peter Niederwieser's comment lead me to run build with the info flag, and it does seem newlines are getting stuck into the file name:
Executing task ':reobf' (up-to-date check took 0.004 secs) due to:
Output file build/libs/CreepyPastaCraft-1.7.x-r70
.11ae542
-universal.jar has changed.
.execute().text.remove?
or whatever the actual code would be.?
for you. Looks like some encoding problem.version
string. You can try something likeversion = version.replace("\n", "").replace("\r", "")
.