I have 2 gradle scripts:
build.gradle and other.gradle
In my build.gradle I have: apply from: 'other.gradle'
task callotherscript << { thevar = "Thevariableiwanttogetsomeplaceelse" dosomecommand
In my friend .gradle, I have:
task dosomecommand(type: Exec) { executable "someexe" args "aa", "<myarg>" + <thevar>, "<intomydir>" }
My question is: how do I get "thevar" from build.gradle so that I can use it in other.gradle.
I run: gradle callotherscript
The error message that I see is:
Could not find property 'thevar' on task ': dosomecommand'.
I looked through the cookbook, and every gradle document that I found relevant, and I just don't see how to do it.
thanks
source share