Skip to content

Commit 0c82d68

Browse files
committed
Update build.gradle
1 parent 2e540cd commit 0c82d68

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

build.gradle

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,13 @@ task versionInfoFile {
9393
String gitRevision = "unknown-version"
9494
String gitRevisionlong = "unknown-version"
9595

96-
new ByteArrayOutputStream().withStream { os ->
97-
exec {
98-
executable = 'git'
99-
args = ['describe', '--tags', '--always']
100-
standardOutput = os
101-
}
102-
gitRevision = os.toString().trim()
103-
}
96+
gitRevision = providers.exec {
97+
commandLine 'git', 'describe', '--tags', '--always'
98+
}.standardOutput.asText.get().trim()
10499

105-
new ByteArrayOutputStream().withStream { os ->
106-
exec {
107-
executable = 'git'
108-
args = ['describe', '--tags', '--always', '--abbrev=0']
109-
standardOutput = os
110-
}
111-
gitRevisionlong = os.toString().trim()
112-
}
100+
gitRevisionlong = providers.exec {
101+
commandLine 'git', 'describe', '--tags', '--always', '--abbrev=0'
102+
}.standardOutput.asText.get().trim()
113103

114104
String setupVersion = "${version}-${gitRevision}"
115105

0 commit comments

Comments
 (0)