After some more digging, I think this issue is related to http://jira.codehaus.org/browse/GRADLE-909
At least if I do "gradle -C rebuild classes" then my subproject as well as ../buildSrc are built correctly. Philip On Fri, Apr 23, 2010 at 12:32 PM, Philip Crotwell <[email protected]> wrote: > Hi > > I have a multiproject with a buildSrc that worked under older versions > of gradle, including a git version from March, but now fails under > 0.9-preview-1. The problem seems to be that under 0.9-preview-1 the > custom task I have in buildSrc, CopyToLib, is not being compiled. I > have just the one custom task in > buildSrc/src/main/groovy/CopyToLib.groovy and have in my build.gradle > a line like: > task copyToLib(type: CopyToLib) {}. > > If I remove the build directory from buildSrc, and then run "gradle > classes" in the subproject I get: > Caused by: java.lang.NoClassDefFoundError: CopyToLib > and no build happens in the subproject or in ../buildSrc. > If I just run gradle -t in the subproject, I get: > Cause: Could not find property 'CopyToLib' on project ':seisFile'. > Both of these I assume are due to buildSrc not being compiled > automatically by gradle. > > However, if I first use an older version of gradle > (gradle-0.9-20100305144814-0500) to do "gradle -t", thus generating > the class in buildSrc, the subproject then will compile under > gradle-0.9-0preview-1, although I get an error related to the change > from "apply id: 'java'" to "apply plugin: 'java'". > > I have put a simplified example here: > http://www.seis.sc.edu/~crotwell/seistest.tgz > > And here is an example of the above steps. First "gradle classes" in > seisFile with ../buildSrc already compiled. Then remove > ../buildSrc/build and run "gradle classes" again, which fails. Then > regenerate buildSrc/build using the older gradle -t, then gradle > classes succeeds. > > Any ideas of if this is "pilot error" or if there is a problem with > gradle-0.9-preview-1? > > thanks, > Philip > > > > 4x4:~/dev/seistest/seisFile crotwell$ rm -r build > 4x4:~/dev/seistest/seisFile crotwell$ ls ../buildSrc/ > <- so here ../buildSrc has been compiled to > ../buildSrc/build > build src > 4x4:~/dev/seistest/seisFile crotwell$ gradle classes > <- here gradle classes within the subproject works > :seisFile:compileJava > :seisFile:processResources UP-TO-DATE > :seisFile:classes > > BUILD SUCCESSFUL > > Total time: 4.776 secs > 4x4:~/dev/seistest/seisFile crotwell$ rm -rf ../buildSrc/build > <- remove CopyToLib compiled into ../buildSrc/build > 4x4:~/dev/seistest/seisFile crotwell$ gradle classes > <- try again, fail as buildSrc is not compiled by "gradle > classes" > > FAILURE: Build failed with an exception. > > * Where: > Build file '/export/home/crotwell/dev/seistest/build.gradle' > > * What went wrong: > A problem occurred evaluating root project 'seistest'. > Cause: CopyToLib > > * Try: > Run with -s or -d option to get more details. Run with -S option to > get the full (very verbose) stacktrace. > > BUILD FAILED > > Total time: 3.228 secs > 4x4:~/dev/seistest/seisFile crotwell$ ls ../buildSrc/ > src > 4x4:~/dev/seistest/seisFile crotwell$ > 00305144814-0500/bin/gradle -totwell$ > /seis/local/noArch/versions/gradle-0.9-2010 <- now > recompile ../buildSrc using older gradle (20100305) > :buildSrc:clean > <- > fail is due to "apply plugin: 'java'" instead of "apply id:" > :buildSrc:compileJava > <- but > at least the groovy in ../buildSrc/build is compiled > :buildSrc:compileGroovy > :buildSrc:processResources > :buildSrc:classes > :buildSrc:jar > :buildSrc:assemble > :buildSrc:compileTestJava > :buildSrc:compileTestGroovy > :buildSrc:processTestResources UP-TO-DATE > :buildSrc:testClasses > :buildSrc:test UP-TO-DATE > :buildSrc:check > :buildSrc:build > > FAILURE: Build failed with an exception. > > * Where: > Build file '/export/home/crotwell/dev/seistest/build.gradle' line: 5 > > * What went wrong: > A problem occurred evaluating root project 'seistest'. > Cause: No such property: plugin for class: > org.gradle.api.internal.plugins.DefaultObjectConfigurationAction > > * Try: > Run with -s or -d option to get more details. Run with -S option to > get the full (very verbose) stacktrace. > > BUILD FAILED > > Total time: 6.3 secs > 4x4:~/dev/seistest/seisFile crotwell$ ls ../buildSrc/ > <- build failed, but did generate ../buildSrc/build > build src > 4x4:~/dev/seistest/seisFile crotwell$ gradle classes > <- gradle classes now succeeds > :seisFile:compileJava UP-TO-DATE > :seisFile:processResources UP-TO-DATE > :seisFile:classes UP-TO-DATE > > BUILD SUCCESSFUL > > Total time: 3.409 secs > 4x4:~/dev/seistest/seisFile crotwell$ > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
