I have created a task (called “get”) as a DSL extension that’s defined for all projects within some gradle code in the init.d folder. This task pulls source code from a Subversion repository.
Some of my projects will be standalone and the get task will be fired at the project level. Other projects will have multiple subprojects and the get task will be fired by each subproject, not at the project level.
In each case, I want to have a singe build.gradle file for each project.
On a project by project basis, I want to be able to either fire the get task at the project level, or do nothing at the project level and have the get task run by the subprojects.
Seems like my problem is that I need to get “in front” of this code because the build fails because localDir is not initialized at the project level:
But I want to be able within the project’s build.gradle to specify that when I run “gradle get” to skip the “get” call at the project level and just delegate to the subprojects.
dohenry@ubuntu-donhenry:~/atom_products/ms2$ gradle get
Initialization script '/home/dohenry/gradle_init.d/bpsrepos.gradle': line 25
The ArtifactRepositoryContainer.add(DependencyResolver, Closure) method has been deprecated and is scheduled to be removed in Gradle 2.0.
:svnInit
:get SKIPPED
:mscore:svnInit
:mscore:get
Getting http://bps-svn.turner.com/mediasource/mscore/trunk
:omneonserver:svnInit
:omneonserver:get
Getting http://bps-svn.turner.com/mediasource/omneonserver/trunk
:webapp:svnInit
:webapp:get
Getting http://bps-svn.turner.com/mediasource/webapp/trunk
BUILD SUCCESSFUL