Skip to content

Commit

Permalink
Only store the git commit file in the build
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCreosote committed Feb 9, 2024
1 parent 2d1f2f9 commit 8fce168
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ repositories {
def JAR_TEMPLATE_DIR = 'kbase_auth2_templates'
def TEMPLATE_LIST_FILE_NAME = "templates.manifest"

task getGitCommitId {
task buildGitCommitFile {
doLast {
def commitId = grgit.head().id
file('src/us/kbase/auth2/gitcommit').text = commitId
// is there a varible for builddir/classe/java/main?
file("$buildDir/classes/java/main/us/kbase/auth2/gitcommit").text = commitId
}
}

compileJava {
dependsOn getGitCommitId
if (JavaVersion.current() <= JavaVersion.VERSION_1_8) {
// TODO BUILD remove when we no longer support java 8
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
} else {
options.release = 8
}
finalizedBy buildGitCommitFile
}

test {
Expand Down

0 comments on commit 8fce168

Please sign in to comment.