On 03/03/2011, at 10:50 AM, Steve Ebersole wrote:
> I am having an issue with compilation that I am not able to explain and I
> have
> found no reason for it. Below is the copied build script.
>
> This is in a project named 'hibernate-entitymanager'. Compiling the tests of
> this project causes gralde to try and compile the main sources from the
> dependent 'hibernate-core' module (even though they are already compiled),
> but
> it tries to do so as part of 'hibernate-entitymanager' (using its configs)
> which does not have all the needed deps to compile those classes.
So hibernate-entititymanager:compileTestJava is the task that is failing?
Do you configure any other compiler options for this task (in a parent project,
for example)?
Perhaps you could print out the compiler options and classpath of the task,
something like:
compileTestJava.doFirst {
println classpath.asPath
println options.compilerArgs
println options.optionMap()
}
>
> Any ideas?
>
>
> build script ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> apply plugin: 'java'
>
> dependencies {
> shrinkwrapVersion = '1.0.0-alpha-6'
>
> compile( project(':hibernate-core') )
> compile( libraries.dom4j )
> compile( libraries.commons_annotations )
> compile( libraries.jpa )
> compile( libraries.jta )
> compile( libraries.javassist )
> testCompile( project(':hibernate-core').sourceSets.test.classes )
> testCompile( libraries.junit )
> testCompile( libraries.jpa_modelgen )
> testCompile( libraries.shrinkwrap_api )
> testCompile( libraries.shrinkwrap )
> testCompile( libraries.validation )
> testCompile( libraries.slf4j_api )
> testRuntime( libraries.validator )
> }
>
> procTargetDirName = buildDirName + "/generated-src/jpamodelgen"
> procTargetDir = dir( procTargetDirName )
> compileTestJava {
> configure( options ) {
> compilerArgs = [ "-s", "$procTargetDir.dir.absolutePath" ]
> }
> }
> compileTestJava.dependsOn procTargetDir
>
> bundlesTargetDirName = "$buildDirName/bundles"
> bundlesTargetDir = dir( bundlesTargetDirName )
> task copyBundleResources (type: Copy) {
> from file('src/test/bundles')
> into bundlesTargetDir.dir
> filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
> buildDirName: buildDir.absolutePath,
> 'db.dialect': 'org.hibernate.dialect.H2Dialect',
> 'jdbc.driver': 'org.h2.Driver',
> 'jdbc.user': 'sa',
> 'jdbc.pass': '',
> 'jdbc.url': 'jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE',
> ])
> }
> copyBundleResources.dependsOn bundlesTargetDir
>
> // make sure that the bundles for the packaged test (PackagingTestCase) are
> copied as well
> processTestResources.dependsOn copyBundleResources
>
>
> ---
> Steve Ebersole <[email protected]>
> http://hibernate.org
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
Co-Founder and VP of Engineering, Gradleware Inc. - Gradle Training, Support,
Consulting
http://www.gradleware.com