Skip to content

Commit

Permalink
Build: Add task to generate a git properties file (apache#5228)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbendick authored Jul 10, 2022
1 parent f281ec0 commit f8d1249
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ buildscript {
classpath 'me.champeau.jmh:jmh-gradle-plugin:0.6.6'
classpath "com.github.alisiikh:gradle-scalastyle-plugin:3.4.1"
classpath 'com.palantir.gradle.revapi:gradle-revapi:1.7.0'
classpath 'com.gorylenko.gradle-git-properties:gradle-git-properties:2.4.1'
}
}

Expand All @@ -42,8 +43,17 @@ plugins {
}

try {
// apply this plugin in a try-catch block so that we can handle cases without .git directory
// apply these plugins in a try-catch block so that we can handle cases without .git directory
apply plugin: 'com.palantir.git-version'
apply plugin: 'com.gorylenko.gradle-git-properties'
// git properties file for the root project for adding to the source tarball
gitProperties {
gitPropertiesName = 'iceberg-build.properties'
gitPropertiesResourceDir = file("${rootDir}/build")
extProperty = 'gitProps'
failOnNoGitDirectory = false
}
generateGitProperties.outputs.upToDateWhen { false }
} catch (Exception e) {
project.logger.error(e.getMessage())
}
Expand Down

0 comments on commit f8d1249

Please sign in to comment.