-2
// query git for the SHA, Tag and commit count. Use these to automate versioning.
25: def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
26: def gitTag = 'git describe --tags'.execute([], project.rootDir).text.trim()
27: def gitCommitCount = 100 +Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim())

after gradle:

Error:(27, 0) For input string: "" \plaid-master\app\build.gradle

willkernel
  • 31
  • 6

1 Answers1

2

1.click here how to get git commit count?

2.i think there is no .git folder in my project,and throw an error caused by Integer parseInt("")

3.just change

def gitCommitCount = 100 +Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim())

to

def gitCommitCount = 100 +Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim()+"0") 

or def gitCommitCount =100

Community
  • 1
  • 1
willkernel
  • 31
  • 6