@@ -52,41 +52,32 @@ idea {
52
52
// -----------------------------------------------------
53
53
// Publishing
54
54
55
- def latestCommitHash () {
56
- def byteOut = new ByteArrayOutputStream ()
57
- exec {
58
- commandLine ' git' , ' rev-parse' , ' --short' , ' HEAD'
59
- standardOutput = byteOut
60
- }
61
- return byteOut. toString(' UTF-8' ). trim()
55
+ Provider<String > latestCommitHash () {
56
+ return providers. exec {
57
+ commandLine = [" git" , " rev-parse" , " --short" , " HEAD" ]
58
+ }. standardOutput. getAsText(). map(String ::trim)
62
59
}
63
60
64
- def latestCommitMessage () {
65
- def byteOut = new ByteArrayOutputStream ()
66
- exec {
67
- commandLine ' git' , ' log' , ' -1' , ' --pretty=%B'
68
- standardOutput = byteOut
69
- }
70
- return byteOut. toString(' UTF-8' ). trim()
61
+ Provider<String > latestCommitMessage () {
62
+ return providers. exec {
63
+ commandLine = [" git" , " log" , " -1" , " --pretty=%B" ]
64
+ }. standardOutput. getAsText(). map(String ::trim)
71
65
}
72
66
73
- def branchName () {
74
- def byteOut = new ByteArrayOutputStream ()
75
- exec {
76
- commandLine ' git' , ' rev-parse' , ' --abbrev-ref' , ' HEAD'
77
- standardOutput = byteOut
78
- }
79
- return byteOut. toString(' UTF-8' ). trim()
67
+ Provider<String > branchName () {
68
+ return providers. exec {
69
+ commandLine = [" git" , " rev-parse" , " --abbrev-ref" , " HEAD" ]
70
+ }. standardOutput. getAsText(). map(String ::trim)
80
71
}
81
72
82
- def branch = branchName()
73
+ def branch = branchName(). get()
83
74
def baseVersion = project. maven_version
84
75
def isRelease = ! baseVersion. contains(' -' )
85
76
def isMainBranch = branch == " master"
86
77
if (! isRelease || isMainBranch) { // Only publish releases from the main branch
87
78
def suffixedVersion = isRelease ? baseVersion : baseVersion + " +" + System . getenv(" GITHUB_RUN_NUMBER" )
88
- def commitHash = latestCommitHash()
89
- def changelogContent = " [${ commitHash} ](https://github.com/ViaVersion/ViaRewind/commit/${ commitHash} ) ${ latestCommitMessage()} "
79
+ def commitHash = latestCommitHash(). get()
80
+ def changelogContent = " [${ commitHash} ](https://github.com/ViaVersion/ViaRewind/commit/${ commitHash} ) ${ latestCommitMessage().get() } "
90
81
modrinth {
91
82
def mcVersions = project. mcVersions
92
83
.split(' ,' )
0 commit comments