On Mon, Jun 25, 2012 at 2:51 PM, Luke Daley <[email protected]> wrote:
> > > > > > So ... should I simply delete the output directory inside my doCompile() > method? > > > Yes, see the Compile task for example. > I've changed over to this, deleting the output directory and regenerating all from source, and it seems to work. I want to double check the "deleted a source file" scenario, to make sure the Copy and Jar tasks do the right thing as well. I suspect that I'll only end up with a few (dozen) CoffeeScript files totally a couple of thousand lines, so I expect this to not be a terrible problem. BTW; is it valid to start a thread pool and do a lot of this compilation in parallel, as long as the pool is shutdown before leaving the method? It seems to me that most of the time being spent is going to be disk I/O reading and writing the source files. Of course, what I really should do is compare timestamps on the output file to decide if I need to compile the input file at all. > > Given the message in the console output above, it seems like there could > be a notification to a task that an input file was deleted and it should > ensure the corresponding output file(s) are deleted. > > > That would prevent the task doing any fine grained incrementalness and > would be too presumptuous. > True, but the callback could be optional or advisory; an extra annotation on a method that says: "this source file was deleted"; the method would be responsible for identifying the corresponding output file. > > But if I want a more "incremental" style, am I expected to walk the output > directory and delete anything that doesn't have a corresponding source file? > > Yes, Gradle can't know the mapping here as it is specific to what the task > is doing. > > In the future, Gradle will be able to give you info on what changed but > you will still have to do some work. For cases like this though that are > one to one it will probably be little. > > And, is there a base class to extend from that handles more of this for > me? SourceTask doesn't seem to do quite what I want. > > > No, SourceTask is your best option right now. > > FYI - the nightlies have coffee script compilation support and this will > be experimental in 1.1. There is no commitment at this stage on when this > will be non experimental. > > > Thanks in advance for any guidance. > > $ gradle --version > > ------------------------------------------------------------ > Gradle 1.0 > ------------------------------------------------------------ > > Gradle build time: Tuesday, June 12, 2012 12:56:21 AM UTC > Groovy: 1.8.6 > Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010 > Ivy: 2.2.0 > JVM: 1.7.0_04 (Oracle Corporation 23.0-b21) > OS: Mac OS X 10.7.4 x86_64 > > > -- > Howard M. Lewis Ship > > Creator of Apache Tapestry > > The source for Tapestry training, mentoring and support. Contact me to > learn how I can get you up and productive in Tapestry fast! > > (971) 678-5210 > http://howardlewisship.com > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com
