Could you guys clarify why
def getBuildSuffix() {
return 'git rev-list HEAD | wc -l | tr -d " "'.execute().text.trim()
}
returns nothing to me taking into consideration there is data when you run git command from a command line:
prototype (master) $ git rev-list HEAD | wc -l | tr -d " "
72
May be I'm just executing a git command from my build.gradle
in a wrong way?
From the main menu, select Run | Edit Configurations to open the run/debug configuration for your project. icon. In the list that opens, select Run Gradle task. In the Select Gradle Task dialog, specify the project and the task that you want to execute before launching the project.
Press ⌃⌃ (macOS), or Ctrl+Ctrl (Windows/Linux), type "gradle" followed by the gradle task name or names. We can, of course, run Gradle commands from the terminal window inside IntelliJ IDEA. Open this with ⌥F12 (macOS), or Alt+F12 (Windows/Linux).
Gradle makes it easy to build common types of project — say Java libraries — by adding a layer of conventions and prebuilt functionality through plugins. You can even create and publish custom plugins to encapsulate your own conventions and build functionality.
gradle-git is a set of Gradle plugins: org.
Pipe is a shell feature so you need to go like:
['sh', '-c', 'git rev-list HEAD | wc -l | tr -d " "'].execute().text.trim()
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