Call some function from another gradle file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Call some function from another gradle file

cupello
Given two files:

build.gradle with :

aplly from: main.gradle

task someTask << {
     myMainMethod()
}

main.gradle with:

def myMainMethod(){
     println "Main Method"
}

Why does this not work? Why did the file build.gradle not see my method?