I am trying to include my application's version through git using gradle build system. I want to run the following command to get the version info from git:
git describe --tags --match "v[0-9]*"
After reading the reference from here, I am using the following gradle syntax:
commandLine 'git', 'describe', '--tags', '--long', '--match "v[0-9]*"'
but it gives error in execution.
error: unknown option `match v[0-9]*'
I have tried escaping the double quote with backslash, but that does not work either. Can someone please point me towards a correct way of executing above command through gradle?
I guess it should be:
commandLine 'git', 'describe', '--tags', '--long', '--match', 'v[0-9]*'
I think '--match "v[0-9]*"'
the version number should be part of the command. So you can put them in an own section something like this:
commandLine 'git', 'describe', '--tags', '--long', '--match', 'v[0-9]*'
https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html
When you look here at the description
commandLine The full command line, including the executable plus its arguments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With