I have a simple test project that has 2 modules: 'subA' and 'subB'.  I'd like
to add a task 'generateSources' that will run for each project before the
'resources' task.  Here's what I have in my main build.gradle:

allprojects {
        usePlugin('groovy')
        sourceCompatibility = 1.5
        targetCompatibility = 1.5
        group = 'com.irunninglog'
        version = '1.0'
}

subprojects {
        task('resources').dependsOn('generateSources')

        createTask('generateSources') {
                logger.error('My name is: ' + project.name);
        }       
}

And the following in settings.gradle: include 'subA', 'subB'

I expected that if I ran this, I'd see different output for each subproject
- instead, I see:

C:\Temp>gradle clean resources
:clean
:subA:clean
:subB:clean
:init
:resources
:subA:generateSources
My name is: subB
:subA:init
:subA:resources
:subB:generateSources
My name is: subB
:subB:init
:subB:resources

Why does the first call to generateSources think that the project is subB? 

-- 
View this message in context: 
http://www.nabble.com/Multi-project-build-question-tp22302724p22302724.html
Sent from the gradle-user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to