On 24/10/2010, at 1:58 AM, Thomas R. Corbin wrote:
> On Sat, 2010-10-23 at 13:08 +1100, Adam Murdoch wrote:
>>> Yes, but this just lists all the source in the source tree, not just
>> the
>>> source files that are going to be compiled.
>>
>> This should print out just the files that are going to be compiled by
>> the compileGroovy task. Are you seeing something different?
>
> Thanks for your help.
>
> As far as I can tell, and I'm not sure about it... It looks like only
> one file is being compiled, but the code you gave me just prints out all
> the source files in the source set.
>
> compileGroovy.doFirst {
> source.each { File f ->
> println f
> }
> }
>
> I get the impression from section 21.7 of the docs that the source
> property is the list of all files:
The source property is a property of the compileGroovy task. Each task which
takes source files as input has one. In the case of the compileGroovy task, it
contains only the source files for the compileGroovy task.
>
> source FileTree . Can set using anything described in Section
> 15.5, “Specifying a set of input files”.
>
>
>
>>
>>>
>>> I sure would like a way to see what's triggering actions w/o having
>> to
>>> poke through enormous amounts of logging.
>>
>> There's a few things you might be referring to by 'what's triggering
>> actions', so I'm not entirely sure what you need. Could you give some
>> details about the problem you're having where you want to see a list
>> of the source files?
>
> Sometimes people copy a groovy file as a seed for a new class, but then
> forget to fix the package name, or sometimes someone has a mismatch
> between the class name and the file name.
>
> In those cases, the groovy file is compiled every time we run a build.
That's how the <groovyc> ant task works. Gradle's compileGroovy task uses a
much more sophisticated up-to-date check than <groovyc> does. It will deal with
this case fine.
However, it is a problem. Perhaps this would be a good check to add to
CodeNarc? (see http://codenarc.sourceforge.net/)
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz