On Wed, Apr 20, 2011 at 6:06 PM, Adam Murdoch
<[email protected]>wrote:

>
> On 21/04/2011, at 4:06 AM, John Murph wrote:
>
> Actually, this behavior change might be related to this (from the milestone
> 2 release notes):
>
> DSL Improvements
>
> You can now specify the *source files* for a task through the DSL.
> Previously this was only possible by using the @SkipWhenEmpty annotation
> on a custom task class. The source files of a task are treated as input
> files. In addition, the task is skipped if the set of source files is
> declared and empty.
>
> It looks like Gradle is considering the deploy tasks source files to be
> declared and empty (hence the "as it has no source files" as the reason for
> skipping).  However, it looks like Steve is not declaring any source files
> until the doFirst.
>
>
> Exactly right.
>
>
Adam,

I think I wasn't clear enough.  My observation was that the release notes
say "the task is skipped if the set of sources files is declared and
empty."  This makes me think that both conditions are required: declared &
empty.  In Steve's example, the deploy task has an empty set of sources
files, but I don't think he ever declared any source files.  Am I reading
too much into the release notes (I'm not trying to be a lawyer here, it's
just confusing me), or is it really intended as written?  In which case, why
does Steve's example fail (according to the rule)?

I understand what you said in the other post, so I get why it's not working
right now.  But, I'm wondering if the behavior shouldn't be "if declared and
empty, then let the skipWhenEmpty check skip it, but if NOT declared (and
therefore always empty), then don't let the skipWhenEmpty check skip it."
Does that make sense?  It seems like it's safer (but potentially slower for
some builds).

-- 
John Murph
Automated Logic Research Team

Reply via email to