Thanks for the answer. I'm not sure how to use inputs and outputs in this situation, because I'm not sure what the inputs would be. I only want to generate the stubs if they haven't already been generated, so the inputs and the outputs locations are the same. Is that acceptable? That's why I was trying to use onlyIf instead.
Ken On Fri, Mar 4, 2011 at 11:38 PM, Peter Niederwieser <[email protected]>wrote: > > Kenneth Kousen wrote: > > > > This is all working, but it feels brittle because of the explicit source > > directory name. Is there a better, more general way to do this? > > > > The Java source directories can be queried with > "sourceSets.main.java.srcDirs". However, I suggest to separate generated > sources from the rest. I'd probably put them into a subdirectory of the > build output directory: > > sourceSets.main.java.srcDir "$buildDir/generatedSources" // add directory > for generated sources > > This avoids troubles with source control, and allows to clean the generated > sources with "gradle clean". To only regenerate sources if necessary, you > could use Gradle's incremental build capabilities and specify the inputs > and > outputs of the generation task. > > > -- > 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-tp3410389p3410432.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 > > > -- Kenneth A. Kousen President Kousen IT, Inc. Email: [email protected] Site: http://www.kousenit.com Blog: http://kousenit.wordpress.com Twitter: @kenkousen Making Java Groovy<http://affiliate.manning.com/idevaffiliate.php?id=1084_254>
