Skip to content

Commit

Permalink
Use gradle configuration cache
Browse files Browse the repository at this point in the history
  • Loading branch information
bmalinowsky committed Oct 24, 2024
1 parent 459f3fb commit cb9be8f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 8 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@ tasks.withType(Javadoc).configureEach {
options.addStringOption("Xdoclint:-missing", '-quiet')
}


def gitHash = "git -C $projectDir rev-parse --verify --short HEAD".execute().text.trim()
def buildDate = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss z")
.withZone(ZoneId.of("UTC"))
.format(Instant.now())

jar {
manifest {
def gitHash = providers.exec {
commandLine("git", "-C", "$projectDir", "rev-parse", "--verify", "--short", "HEAD")
}.standardOutput.asText.map { it.trim() }
def buildDate = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss z")
.withZone(ZoneId.of("UTC"))
.format(Instant.now())

attributes(
'Main-Class': application.mainClass,
'Implementation-Version': project.version,
'Revision': "${gitHash}",
'Revision': gitHash.get(),
'Build-Date': "${buildDate}"
)
}
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.caching=true

0 comments on commit cb9be8f

Please sign in to comment.