Kenneth Kousen wrote:
>
> In the meantime, can you suggest what the "onlyIf" statement would look
> like?
>
onlyIf { !(new File(buildDir, "generatedResources").exists()) } // seems you
forgot the '.exists()'
Kenneth Kousen wrote:
>
> I'll look into that, though if you have a pointer to an example I'd
> appreciate it.
>
Best examples are probably the tasks in the Gradle codebase. Here is how it
could look like in your case:
task wsimport(type: WsImport) {
wsdl = ...
destDir = ...
sourceDestDir = ...
}
class WsImport extends DefaultTask {
@Input
String wsdl
// from looking at other tasks, it seems that @Input isn't needed here
@OutputDirectory
File destDir
@OutputDirectory
File sourceDestDir
@TaskAction
void execute() {
ant.taskdef ...
ant.wsimport ...
}
}
Alternatively, you could specify the task inputs and outputs dynamically:
task wsimport {
wsdl = ...
destDir = ...
sourceDestDir = ...
ant { ... } // use wsdl, destDir, sourceDestDir in here
inputs.property("wsdl", wsdl)
outputs.dir(destDir)
outputs.dir(sourceDestDir)
}
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradleware
http://www.gradleware.com
Creator, Spock Framework
http://spockframework.org
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Referring-to-main-source-dir-tp3410389p3410618.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