Hi Allan,

what is happening in the :koios-unit-test:resources task? It looks like you are doing a resolve there which includes resolving the project dependency to mda and standalone. At the time the resolve is executed those two projects haven't been build yet. Therefore the jars can't be found and the build fails. If you declare a library dependencies between projects this dependency belongs to a certain configuration which again is associated with a certain task. For example the compile configuration is associated with the compile task. The mechanism is such that only if the compile task is executed the libraries of the project dependencies of the compile configuration are actually produced.

One could argue that an explicit resolve request should trigger the generation of the libraries in any case. We plan to do some fine tuning of our dependency management in 0.4. For now one way of solving this is to say in koios-unit-test:

dependencies {
        linkConfWithTask('compile', 'resources')
}

My advise is based on a remote diagnosis. Hopefully it targets the right thing.

- Hans

On Aug 13, 2008, at 3:23 AM, Allan Lewis wrote:


Hans,

I'm giving your suggestion a try, but without much success. As soon as I
add dependsOnChildren() to my root build.gradle:

dependsOnChildren()

allprojects {
        usePlugin('groovy')
        sourceCompatibility = 1.5
        targetCompatibility = 1.5
        group = 'org.koiosframework'
        version = '0.1'
        
        dependencies {
                addFlatDirResolver('lib', new File(rootDir, 'lib'))
                
                compile 'commons-lang:commons-lang:[EMAIL PROTECTED]',
                        'commons-logging:commons-logging:[EMAIL PROTECTED]',
                        'commons-digester:commons-digester:[EMAIL PROTECTED]',
                        'commons-collections:commons-collections:[EMAIL 
PROTECTED]',
                        'commons-beanutils:commons-beanutils:[EMAIL PROTECTED]'
                
                testCompile 'junit:junit:[EMAIL PROTECTED]'
        }
}

If I do nothing else and try to run 'gradle clean test', I get the following error (using last week's snapshot). A little background on my setup - I
have the following projects:

root
    koios-generator
    koios-mda
    koios-model
    koios-standalone (depends on generator and model)
    koios-unit-test (depends on mda and standalone)

Build Output:

Buildfilename: build.gradle
Timing: Loading script from cache took: 0.0 secs
Timing: Evaluating settings file took: 0.0 secs
No build sources found.
:: loading settings :: url =
jar:file:/C:/Program%20Files/gradle-0.3-080809150030+0200/lib/ ivy-2.0.0.rc1_20080716132100_r677238.ja
r!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: org.gradle#build;SNAPSHOT
        confs: [build]
Adding to classpath: C:\Program Files\Java\jdk1.6.0_06\lib\tools.jar
++ Loading Project objects
Timing: Loading projects took: 0.047 secs
++ Configuring Project objects
Timing: Loading script from cache took: 0.015 secs
Timing: Running the build script took 0.969 secs
Project= : evaluated.
Timing: Project evaluation took 0.969 secs
Timing: Loading script from cache took: 0.0 secs
Timing: Running the build script took 0.015 secs
Project= :koios-generator evaluated.
Timing: Project evaluation took 0.015 secs
Timing: Loading script from cache took: 0.0 secs
Timing: Running the build script took 0.016 secs
Project= :koios-mda evaluated.
Timing: Project evaluation took 0.016 secs
Timing: Loading script from cache took: 0.015 secs
Timing: Running the build script took 0.015 secs
Project= :koios-model evaluated.
Timing: Project evaluation took 0.015 secs
Timing: Loading script from cache took: 0.016 secs
Timing: Running the build script took 0.016 secs
Project= :koios-standalone evaluated.
Timing: Project evaluation took 0.032 secs
Timing: Loading script from cache took: 0.0 secs
Timing: Running the build script took 0.015 secs
Project= :koios-unit-test evaluated.
Timing: Project evaluation took 0.015 secs
Timing: Configuring projects took 1.062 secs
++++ Starting build for primary task 'clean'.
Timing: Creating the DAG took 0.0 secs
Executing: :koios-generator:clean
Executing: :koios-mda:clean
Executing: :koios-model:clean
Executing: :koios-standalone:clean
Executing: :koios-unit-test:clean
Executing: :clean
Timing: Executing the DAG took 0.0 secs
DAG must not be rebuild as the task chain before was dag neutral!
++++ Starting build for primary task 'test'.
Timing: Creating the DAG took 0.031 secs
Executing: :koios-generator:init
Executing: :koios-mda:init
Executing: :koios-model:init
Executing: :koios-standalone:init
Executing: :koios-unit-test:init
Executing: :init
Executing: :koios-generator:resources
Executing: :koios-mda:resources
     [copy] Copying 21 files to C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\koios-mda\build\classes
Executing: :koios-model:resources
Executing: :koios-standalone:resources
Executing: :koios-unit-test:resources
:: resolving dependencies :: org.koiosframework#koios-unit-test;0.1
        confs: [testRuntime]
        found commons-lang#commons-lang;2.4 in lib
        found commons-logging#commons-logging;1.1.1 in lib
        found commons-digester#commons-digester;1.8 in lib
        found commons-collections#commons-collections;3.2.1 in lib
        found commons-beanutils#commons-beanutils;1.7.0 in lib
        found junit#junit;4.4 in lib
        found hsqldb#hsqldb;1.8.0.7 in lib

:: problems summary ::
:::: WARNINGS
                module not found: org.koiosframework#koios-mda;0.1

        ==== clientModule: tried

        ==== build-resolver: tried

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\.gradle\build- resolver/org.koiosframework/koios-mda/0.1/
ivys/ivy.xml

          -- artifact org.koiosframework#koios-mda;0.1!koios-mda.jar:

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\.gradle\build- resolver/org.koiosframework/koios-mda/0.1/
jars/koios-mda.jar

        ==== lib: tried

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\lib/ivy-0.1.xml

          -- artifact org.koiosframework#koios-mda;0.1!koios-mda.jar:

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\lib/koios-mda-0.1.jar

module not found: org.koiosframework#koios- standalone;0.1

        ==== clientModule: tried

        ==== build-resolver: tried

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\.gradle\build- resolver/org.koiosframework/koios-standalo
ne/0.1/ivys/ivy.xml

          -- artifact
org.koiosframework#koios-standalone;0.1!koios-standalone.jar:

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\.gradle\build- resolver/org.koiosframework/koios-standalo
ne/0.1/jars/koios-standalone.jar

        ==== lib: tried

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\lib/ivy-0.1.xml

          -- artifact
org.koiosframework#koios-standalone;0.1!koios-standalone.jar:

          C:\Documents and
Settings\Allan\Workspace\koios-framework-trunk\lib/koios- standalone-0.1.jar
--
View this message in context: http://www.nabble.com/Creating-a- dists-task-for-a-multi-project-build-tp18901701p18955451.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



--
Hans Dockter
Gradle Project lead
http://www.gradle.org





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

   http://xircles.codehaus.org/manage_email


Reply via email to