On 24/03/10 4:23 PM, Geronimo M. H. wrote:
Hello,
thanks to the sample of Phil Swenson I tried to compile a first sample of
build-sources outside the project source tree.
My test-Project has the layout
test
build.gradle
buildSrc
build.gradle
SRDALib
build.gradle
the file buildSrc/build.gradle looks like:
apply id: 'groovy'
sourceSets {
main {
groovy {
srcDir '../common/buildSrc/groovy'
}
}
}
... and at the path test/../common/buildSrc/groovy starts the package of the
groovy-sources (file with extension 'groovy').
Paths in a build file are resolved relative to the project directory. In
the case of the buildSrc/build.gradle, the project is buildSrc, and its
project directory is test/buildSrc
So, you've asked for test/buildSrc/../common/buildSrc/groovy as the
source directory, which would resolve to test/common/buildSrc/groovy. Is
that what you intended?
the run of gradle produces an empty jarfile at test/buildSrc/build/libs and so
the build fails with 'ClassNotFoundException'.
The log talks about no source files found - but the sourcefiles are there, so
I guess, a path may be wrong, but I checked all path settings twice ...
Can anybody shine me a light about my error?
kind regards
Geronimo
P.S. the output of gradle -d
---------------<snip>---------------------
05:55:11.375 [main] INFO org.gradle.launcher.Main - Starting Build
05:55:11.380 [main] DEBUG org.gradle.launcher.Main - Gradle
home: /opt/java/gradle-0.9-20100323082727+0100
05:55:11.380 [main] DEBUG org.gradle.launcher.Main - Current
dir: /var/develop/java/SR/test
05:55:11.380 [main] DEBUG org.gradle.launcher.Main - Settings file: null
05:55:11.380 [main] DEBUG org.gradle.launcher.Main - Build file: null
05:55:11.382 [main] DEBUG org.gradle.launcher.Main - Select default project:
with project directory '/var/develop/java/SR/test'
05:55:11.382 [main] DEBUG org.gradle.launcher.Main - Default imports
file: /opt/java/gradle-0.9-20100323082727+0100/gradle-imports
05:55:11.385 [main] DEBUG o.g.i.BuildSourceBuilder - Starting to build the
build sources.
05:55:11.385 [main] INFO o.g.i.BuildSourceBuilder -
================================================ Start building buildSrc
05:55:11.390 [main] DEBUG o.g.i.BuildSourceBuilder - Starting to build the
build sources.
05:55:11.390 [main] DEBUG o.g.i.BuildSourceBuilder - Gradle source dir does
not exist. We leave.
05:55:11.392 [main] DEBUG o.g.i.DefaultGradlePropertiesLoader - Found env
project properties: []
05:55:11.396 [main] DEBUG o.g.i.DefaultGradlePropertiesLoader - Found system
project properties: []
05:55:11.747 [main] DEBUG o.g.i.ScriptEvaluatingSettingsProcessor - Timing:
Processing settings took: 0.351 secs
05:55:11.748 [main] DEBUG o.gradle.initialization.BuildLoader - Loading
Project objects
05:55:11.825 [main] DEBUG o.gradle.initialization.BuildLoader - Looking for
project properties from: /var/develop/java/SR/test/buildSrc/gradle.properties
05:55:11.826 [main] DEBUG o.gradle.initialization.BuildLoader - project
property file does not exists. We continue!
05:55:11.827 [main] DEBUG o.gradle.initialization.BuildLoader - Timing:
Loading projects took: 0.079 secs
05:55:11.834 [main] DEBUG o.g.configuration.BuildConfigurer - Configuring
Project objects
05:55:11.840 [main] INFO o.g.c.BuildScriptProcessor - Evaluating root
project 'buildSrc' using build
file '/var/develop/java/SR/test/buildSrc/build.gradle'.
05:55:13.296 [main] DEBUG o.g.g.scripts.DefaultScriptMetaData - Method
sourceSets not found in script! Delegating to root project 'buildSrc'.
05:55:13.377 [main] DEBUG o.g.c.BuildScriptProcessor - Timing: Running the
build script took 1.537 secs
05:55:13.381 [main] DEBUG o.g.configuration.BuildConfigurer - Timing:
Configuring projects took 1.545 secs
05:55:13.387 [main] DEBUG o.g.e.DefaultTaskGraphExecuter - Timing: Creating
the DAG took 0.0010 secs
05:55:13.425 [main] DEBUG o.g.e.DefaultTaskGraphExecuter - Timing: Creating
the DAG took 0.038 secs
05:55:13.426 [main] INFO org.gradle.GradleLauncher - Starting build for
primary tasks 'clean', 'build'.
05:55:13.427 [main] INFO org.gradle.TaskExecutionLogger - :buildSrc:clean
05:55:13.427 [main] DEBUG o.g.a.i.tasks.SkipTaskExecuter - Starting to execute
task ':clean'
05:55:13.428 [main] DEBUG o.g.a.i.p.t.ExecutionShortCircuitTaskExecuter -
Determining if task ':clean' is up-to-date
05:55:13.472 [main] INFO o.g.a.i.c.DefaultTaskArtifactStateRepository -
Executing task ':clean' due to:
Task does not produce any output files
05:55:13.472 [main] DEBUG o.g.a.i.p.t.ExecutionShortCircuitTaskExecuter -
task ':clean' is not up-to-date
05:55:13.473 [main] DEBUG o.g.a.i.tasks.DefaultTaskExecuter - Executing
actions for task ':clean'.
05:55:13.474 [main] DEBUG o.g.a.i.tasks.SkipTaskExecuter - Finished executing
task ':clean'
05:55:13.475 [main] INFO org.gradle.TaskExecutionLogger -
05:55:13.475 [main] INFO
org.gradle.TaskExecutionLogger - :buildSrc:compileJava
05:55:13.475 [main] DEBUG o.g.a.i.tasks.SkipTaskExecuter - Starting to execute
task ':compileJava'
05:55:13.475 [main] DEBUG o.g.a.i.p.t.ExecutionShortCircuitTaskExecuter -
Determining if task ':compileJava' is up-to-date
05:55:13.510 [main] INFO o.g.a.i.c.DefaultTaskArtifactStateRepository -
Executing task ':compileJava' due to:
No history is available
for /var/develop/java/SR/test/buildSrc/build/classes/main.
No history is available
for /var/develop/java/SR/test/buildSrc/build/dependency-cache.
05:55:13.510 [main] DEBUG o.g.a.i.p.t.ExecutionShortCircuitTaskExecuter -
task ':compileJava' is not up-to-date
05:55:13.514 [main] DEBUG o.g.a.i.tasks.DefaultTaskExecuter - Executing
actions for task ':compileJava'.
05:55:13.515 [main] INFO o.g.a.i.tasks.DefaultTaskExecuter - Execution
stopped by some action with message: Main Java source does not contain any
files.
05:55:13.539 [main] DEBUG o.g.a.i.tasks.SkipTaskExecuter - Finished executing
task ':compileJava'
05:55:13.539 [main] INFO org.gradle.TaskExecutionLogger -
05:55:13.539 [main] INFO
org.gradle.TaskExecutionLogger - :buildSrc:compileGroovy
05:55:13.539 [main] DEBUG o.g.a.i.tasks.SkipTaskExecuter - Starting to execute
task ':compileGroovy'
05:55:13.539 [main] DEBUG o.g.a.i.p.t.ExecutionShortCircuitTaskExecuter -
Determining if task ':compileGroovy' is up-to-date
05:55:13.543 [main] INFO o.g.a.i.c.DefaultTaskArtifactStateRepository -
Executing task ':compileGroovy' due to:
Task did not produce /var/develop/java/SR/test/buildSrc/build/classes/main.
Task did not
produce /var/develop/java/SR/test/buildSrc/build/dependency-cache.
05:55:13.543 [main] DEBUG o.g.a.i.p.t.ExecutionShortCircuitTaskExecuter -
task ':compileGroovy' is not up-to-date
05:55:13.546 [main] DEBUG o.g.a.i.tasks.DefaultTaskExecuter - Executing
actions for task ':compileGroovy'.
05:55:13.547 [main] INFO o.g.a.i.tasks.DefaultTaskExecuter - Execution
stopped by some action with message: Main Groovy source does not contain any
files.
05:55:13.552 [main] DEBUG o.g.a.i.tasks.SkipTaskExecuter - Finished executing
task ':compileGroovy'
------------------<snap>--------------------------
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email