mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 02:25:50 +01:00
Use provider.exec for process execution during build
Required to enable configuration-cache, as per https://docs.gradle.org/8.8/userguide/configuration_cache.html#config_cache:requirements:external_processes
This commit is contained in:
parent
d7242c1f12
commit
79de641fe8
@ -11,29 +11,25 @@ tasks.withType(Test) {
|
|||||||
|
|
||||||
def getVersionCode = { ->
|
def getVersionCode = { ->
|
||||||
try {
|
try {
|
||||||
def stdout = new ByteArrayOutputStream()
|
def commitCount = providers.exec {
|
||||||
exec {
|
commandLine('git', 'rev-list', 'HEAD', '--count')
|
||||||
commandLine 'git', 'rev-list', 'HEAD', '--count'
|
}.standardOutput.asText.get().trim()
|
||||||
standardOutput = stdout
|
return Integer.valueOf(commitCount)
|
||||||
}
|
|
||||||
return Integer.valueOf(stdout.toString().trim())
|
|
||||||
} catch (ignored) {
|
} catch (ignored) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def buildGitChangelog = {
|
def buildGitChangelog = {
|
||||||
def stdout = new ByteArrayOutputStream()
|
def allCommits = providers.exec {
|
||||||
exec {
|
commandLine('git', 'log', '--pretty=format:%h %s')
|
||||||
commandLine 'git', 'log', '--pretty=format:%h %s'
|
}.standardOutput.asText.get()
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
|
|
||||||
def commitVersionCode = getVersionCode()
|
def commitVersionCode = getVersionCode()
|
||||||
def includedCommits = 0
|
def includedCommits = 0
|
||||||
def changelogNode = new Node(null, 'changelog')
|
def changelogNode = new Node(null, 'changelog')
|
||||||
|
|
||||||
stdout.toString().trim().eachLine { line ->
|
allCommits.trim().eachLine { line ->
|
||||||
if (includedCommits > 100) {
|
if (includedCommits > 100) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -55,12 +51,9 @@ def buildGitChangelog = {
|
|||||||
|
|
||||||
def getGitHashShort = { ->
|
def getGitHashShort = { ->
|
||||||
try {
|
try {
|
||||||
def stdout = new ByteArrayOutputStream()
|
return providers.exec {
|
||||||
exec {
|
commandLine('git', 'rev-parse', '--short', 'HEAD')
|
||||||
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
}.standardOutput.asText.get().trim()
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
return stdout.toString().trim()
|
|
||||||
} catch (ignored) {
|
} catch (ignored) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user