I want to use variables in section Plugins (from gradle.properties)
plugins {
id 'java'
id 'war'
id 'eclipse-wtp'
id "com.moowork.grunt" version $grunt_version
id "org.akhikhl.gretty" version $gretty_version
}
but this won't work. Any suggestions?
By digging deeper in the gradle docs I found this:
The form is:
plugins { id «plugin id» version «plugin version» }
Where «plugin version» and «plugin id» must be constant, literal, strings. No other statements are allowed; their presence will cause a compilation error.
The plugins {} block must also be a top level statement in the buildscript. It cannot be nested inside another construct (e.g. an if-statement or for-loop).
...
If the restrictions of the new syntax are prohibitive, the recommended approach is to apply plugins using the buildscript {} block.
I think I'll give it a try...
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