Actually, this is the snippet I want to work on, as it’s closest to the way I want it to work. Also, it will help me to understand the ant-mechanics you spoke about above…
task genHibernateClasses() <<
{
ant.echo(message:'Generating Hibernate Classes')
ant.taskdef(
name: 'xdoclet',
classname: 'org.xdoclet.ant.XDocletTask',
classpath {
fileset( dir: 'libs', include: '*.jar' )
}
)
ant.xdoclet(
destDir: '${buildDir}/classes',
fileset( dir: 'src/main/java', include: '**/bl/data/dataObjects/**/*.java' )
)
}
This fails with:
FAILURE: Build failed with an exception.
-
Where: Build file ‘/opt/app/building/git/egp-portals/projects/2012-poc/src/ib-business-logic/build.gradle’ line: 92
-
What went wrong: Execution failed for task ‘:genHibernateClasses’. > Could not find method classpath() for arguments [build_2kt3598fqgbh33a7l94b05pi0o$_run_closure4_closure9@3dbf3ce6] on root project ‘ib-business-logic’.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
So, a couple of things. I’ve seen examples of that taskdef piece and they’re all a little different. Sometimes with curly brackets sometimes without. The classpath sub element which is a sub-xmlelement I would’ve expected to be listed differently, but then I saw it close to this example in the checkstyle piece I mentioned at the top. So I’m just confused how it’s supposed to be: when do I use a ‘{’ vs a ‘(’ and so on.
Again… Thanks for all the help!
/geir