Guest User

Untitled

a guest
Dec 15th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import org.ajoberstar.grgit.Grgit
  2.  
  3. apply plugin: 'com.android.application'
  4.  
  5. lastCommitHash = { ->
  6. git = Grgit.open()
  7. def lastHash = git.head().getAbbreviatedId()
  8. println("INFO: Last Git Hash $lastHash")
  9. return lastHash
  10. }
  11.  
  12. defaultConfig {
  13. def gitHash = lastCommitHash()
  14. buildConfigField "String", "GIT_HASH", "\"$gitHash\""
  15. }
Add Comment
Please, Sign In to add comment