@@ -2,6 +2,8 @@ import org.gradle.internal.os.OperatingSystem
22
33plugins {
44 id " com.github.breadmoirai.github-release" version " 2.2.12"
5+ // id "me.qoomon.git-versioning" version "6.4.4"
6+ // id "org.meiskalt7.gradle.version" version "0.6.0"
57}
68
79apply plugin : " java"
@@ -45,10 +47,22 @@ ext {
4547 releaseVersion = releaseVersion. replaceAll(" [\\ .\\ (\\ )]" , " " ). replaceAll(" [\\ s]" , " -" ). toLowerCase()
4648}
4749
50+ System . out. println (" START Version ${ version} " );
51+
52+ // System.out.println("TEST Version ${gitVersion.buildNumber}");
53+
4854version = fullVersion
55+ /*
56+ gitVersioning.apply {
57+ // see configuration documentation below
58+ rev {
59+ version = "\${describe.distance}"
60+ }
61+ }
62+ */
4963
5064// Just printing out the SAGETV build version for informational purposes
51- // System.out.println("SAGETV VERSION ${versionArch}");
65+ System . out. println (" SAGETV VERSION ${ versionArch} " );
5266
5367// set gradle's buildDir to something other than the default 'build', or
5468// we'll end up deleting EVERYTHING in 'build' when we ./gradlew clean
@@ -332,6 +346,14 @@ def getBuildNumber() {
332346
333347 buildVer = ant.sagebuildnum
334348 */
349+ new ByteArrayOutputStream (). withStream { outputStream ->
350+ exec {
351+ executable ' git'
352+ args ' rev-list' , ' HEAD' , ' --count'
353+ standardOutput = outputStream
354+ }
355+ buildVer = outputStream. toString(). trim()
356+ }
335357 } else if (OperatingSystem . current(). isWindows()) {
336358 // ensure full path to git\bin is in the Path Environment variable on windows
337359 // 04-24-2017 JS: I changed this to remove the dependency on sh. Also we should note that
0 commit comments