How can I reuse a method which is declared in an other gradle script ? With the expression « apply from: “.gradle” », the script doesn’t work because the method is not found. An idea ? Thanks a lot. F.
You can use a standard Groovy trick:
script.gradle
hello = { String name -> println "Hello $name" }
build.gradle
apply from: "script.gradle"
hello("fred")
can you give example for eliminate following warning?
Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read ExtraPropertiesExtension - Gradle DSL Version 8.4 for information on the replacement for dynamic properties. … >Deprecated dynamic property: “hello”
How I can pass more then one parameters?
For eliminate the warning, “ext” namespace should be added:
script.gradle
ext.hello = { String name -> println "Hello $name" }