Sweet! To take one of your commenters even further, that blog should be
added verbatim to the user guide :)
On 05/04/2011 02:56 PM, Rene Groeschke wrote:
Hi there,
I've described up-to-date checks on adhoc tasks a while ago at my blog
http://www.breskeby.com/2010/03/speed-up-your-build-with-gradle/
regards,
René
Am 04.05.11 21:49, schrieb Philip Crotwell:
I think you may also need to not use the<< thingy (damned confusing
imho) as it means "doLast" and gradle needs to know the inputs and
outputs in the configuration phase as opposed to the run phase in
order to do the up to date checking.
Philip
On Wed, May 4, 2011 at 3:44 PM, Philip Crotwell<[email protected]>
wrote:
I feel your pain... :)
http://issues.gradle.org/browse/GRADLE-918
I think something like
inputs.dir jaxbTargetDir
or individual files with
inputs.files bla.bla.bla
and similar for outputs
Philip
On Wed, May 4, 2011 at 3:32 PM, Steve Ebersole<[email protected]>
wrote:
I apologize, I know this has been asked before, but I cannot find the
relevant posts.
I am curious about how to properly set up up-to-date checks for a
"ad hoc"
task. For example, we define a JAXB task which leverages the Ant XJC
tool
(https://github.com/hibernate/hibernate-core/blob/master/hibernate-core/hibernate-core.gradle#L50):
task jaxb<< {
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
jaxbTargetDir.mkdirs()
ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask',
classpath: configurations.jaxb.asPath)
ant.jaxbTargetDir = jaxbTargetDir
ant.xjc(destdir: '${jaxbTargetDir}', package:
'org.hibernate.metamodel.source.hbm.xml.config', binding:
'src/main/xjb/hbm-configuration-bindings.xjb') {
schema(dir: 'src/main/resources/org/hibernate', includes:
'hibernate-configuration-4.0.xsd')
}
ant.xjc(destdir: '${jaxbTargetDir}', package:
'org.hibernate.metamodel.source.hbm.xml.mapping', binding:
'src/main/xjb/hbm-mapping-bindings.xjb') {
schema(dir: 'src/main/resources/org/hibernate', includes:
'hibernate-mapping-4.0.xsd')
}
ant.xjc(destdir: '${jaxbTargetDir}', package:
'org.hibernate.metamodel.source.annotation.xml', binding:
'src/main/xjb/orm-bindings.xjb') {
schema(dir: 'src/main/resources/org/hibernate/ejb', includes:
'orm_2_0.xsd')
}
}
compileJava.dependsOn jaxb
This task always dirties the build. So what is the proper way to define
inputs/outputs for such a task?
--
Steve Ebersole<[email protected]>
http://hibernate.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
--
Steve Ebersole <[email protected]>
http://hibernate.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email