Skip to content

Commit

Permalink
Rename branch in support of .jar generation
Browse files Browse the repository at this point in the history
- This tackles a tiny regression which saw us lose -dev- handled in the generated .jar filename
- We also handle the odd case of building in a git branch which includes a forward slash
  • Loading branch information
scroix committed Apr 4, 2024
1 parent 138c477 commit de67ed4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ ext {
hostname = InetAddress.getLocalHost().getHostName().toUpperCase()
now = DateTime.now().toString()
rev = gitInfo.rev.replaceAll(/[^a-zA-Z0-9]/, '')

branch = gitInfo.branch
if (branch == 'master') {
branch = 'dev'
} else if (branch.contains('/')) {
branch = branch.substring(branch.indexOf('/') + 1)
}

version = gitInfo.branch != 'stable' ? "${project.version}-${branch}_r${rev}" : project.version
}

Expand Down

0 comments on commit de67ed4

Please sign in to comment.