Topic Text   Topic Comments (0)   Topic Properties   Topic Information lego@iin...
Topic title: Test Wednesday February 22, 2017 14:32:15

Download topic text | View in monospace font | Tab width set to 8 (change to 4)

Files in topic:  
[Jump to] b/TestGradle/build.gradle   {+15,-14}

[Add General Comment] to topic.

File b/TestGradle/build.gradle (Revision 0.1) [Add File Comment] [Top]
 
Line 32 Line 32
32 32
33 def getVersionName = { -> 33 def getVersionName = { ->
34 34
35 def majorNum = 1
36
37 def minorNum = 0
35 def revStdOut = new ByteArrayOutputStream() 38 def revStdOut = new ByteArrayOutputStream()
36 exec { 39 exec {
37 commandLine "hg", "rev-parse", "--short", "HEAD" 40 commandLine "hg", "id", "--num"
38 standardOutput = hashStdOut 41 standardOutput = revStdOut
39 } 42 }
40 43
41 def hashStdOut = new ByteArrayOutputStream() 44 return majorNum.toString().trim() + '.' + minorNum.toString().trim() + '.' + revStdOut.toString().trim()
42 exec { 45 }
43 commandLine "git", "rev-parse", "--short", "HEAD" 46
44 standardOutput = hashStdOut 47 task printVersionName {
48 doLast {
49 println getVersionName()
50
45 } 51 }
46 52 }
47 def buildNumberStdOut = new ByteArrayOutputStream() 53
48 exec { 54 // execute as "./gradlew -q printGitVersionName -PBUILD_NUMBER=457"
49 commandLine 'echo', "$BUILD_NUMBER"
50 standardOutput = buildNumberStdOut
51 }
52 return buildNumberStdOut.toString().trim() + '-' + hashStdOut.toString().trim()
53 }
 
  
Legend:
Removed 
Changed
 Added

[Add General Comment] to topic.