Often you want to do general configurations in all your projects. In ant you would import another build file.
In gradle you could do it like this:
def configFileName = ...
new GroovyShell(new Binding(project:project)).evaluate(new File(configFileName))
It would be nice to have a function in the Project class to do this in an easier way:
void include(String filename)
{
new GroovyShell(new Binding(project:this)).evaluate(new File(filename))
}
Or better even: also handle URL strings like
include('http://myserver/config.gradle")
If it's no an URL, it is handled as file name.
|