On 26/08/10 6:39 AM, Eric Berry wrote:
I ran "gradle build -d" and found that that my compile task isn't
being executed because it's "UP TO DATE". I'm not sure how to tell it
that it's not up to date. I've deleted the build directory via "gradle
clean", but it still doesn't get executed.
Looking at your source, your task doesn't actually do anything. So, the
first time you run it, Gradle remembers the input files and notes the
fact that the task didn't produce any output files. Next time you run it
with the same inputs, Gradle will skip the task because it knows the
task does not do anything with those particular inputs - regardless of
whether the build dir exists or not.
You might change the task to create a dummy file in the destination
directory if you want it to be re-executed after a clean.
One thing that Gradle doesn't do, which it should, is to re-execute the
task if it's implementation class has changed. So, after you make the
change above, you should run gradle -C rebuild clean to clear up the
state that Gradle has cached. You only need to do this once.
I'm really not sure what I'm doing wrong at this point, shouldn't the
compile method be called? From looking at the Groovy, Scala and Antlr
plugins for reference, I think I've set it up correctly, and it should
be working.
On Tue, Aug 24, 2010 at 6:34 PM, Eric Berry <[email protected]
<mailto:[email protected]>> wrote:
Ok. I think I got it working (for the most part).
I had to apply the JavaPlugin instead of the JavaBasePlugin. This
allows me to take advantage of the JavaPlugin's SourceSets.
I'm running into an issue where the JavascriptCompile task is
evaluated - meaning I can see it printed in the tasks list and I
see it's name when I run 'gradle build', however I don't see it
actually being executed. I have a println in the compile method,
but I don't see the println in the output.
The source can be viewed here:
http://bazaar.launchpad.net/~elberry/+junk/JavascriptLibPlugin/files
<http://bazaar.launchpad.net/%7Eelberry/+junk/JavascriptLibPlugin/files>
If anyone wants to checkout the source, you can use Bazaar and:
bzr branch lp:~elberry/+junk/JavascriptLibPlugin
I'll be moving it to a proper project as soon as I can get the
compile method executing. Any help here would be greatly appreciated.
Thanks for any help,
Eric
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz