Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.ajoberstar.grgit.Grgit
- apply plugin: 'com.android.application'
- lastCommitHash = { ->
- git = Grgit.open()
- def lastHash = git.head().getAbbreviatedId()
- println("INFO: Last Git Hash $lastHash")
- return lastHash
- }
- defaultConfig {
- def gitHash = lastCommitHash()
- buildConfigField "String", "GIT_HASH", "\"$gitHash\""
- }
Add Comment
Please, Sign In to add comment