Getting closer, still something is missing:
task initDbForIntegrationTest << {
dependsOn: compileTestJava
CompilerConfiguration cc = new CompilerConfiguration();
List cp = cc.getClasspath()
cp.add(sourceSets.main.runtimeClasspath.getAsPath())
cp.add(sourceSets.test.runtimeClasspath.getAsPath())
cc.setClasspathList( cp)
println(cp)
GroovyShell shell = new GroovyShell(cc)
Script script = shell.parse(
'import the.pkg.of.DbTestData\n'
+ 'DbTestData d = new DbTestData()\n'
+ 'd.createDataForIntegrationTest()\n'
)
script.run()
}
Classpath contains dirs expected to be there and classes exist, still:
* What went wrong:
Execution failed for task ':initDbForIntegrationTest'.
Cause: startup failed, Script1.groovy: 1: unable to resolve class
the.pkg.of.DbTestData
@ line 1, column 1.Script1.groovy: 3: unable to resolve class
the.pkg.of.DbTestData
@ line 3, column 1.
--
View this message in context:
http://old.nabble.com/How-to-use-a-Java-class-from-build-script%2C-one-that-is-part-of-the-project--tp28852926p28854005.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