You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by lacton <la...@users.sourceforge.net> on 2008/08/17 15:31:50 UTC

[buildr] Inconsistency in Buildr::artifacts?

Looking at the Buildr::artifacts method, I noticed that it returns an
array of tasks, except for String arguments which are expanded as path
but stay as Strings.

Is there a reason for not converting the String arguments to FileTasks?

Lacton

Re: [buildr] Inconsistency in Buildr::artifacts?

Posted by Assaf Arkin <ar...@intalio.com>.
On Mon, Aug 18, 2008 at 1:06 PM, lacton <la...@users.sourceforge.net> wrote:
> On Mon, Aug 18, 2008 at 9:29 PM, Assaf Arkin <ar...@intalio.com> wrote:
>> On Sun, Aug 17, 2008 at 6:31 AM, lacton <la...@users.sourceforge.net> wrote:
>>> Looking at the Buildr::artifacts method, I noticed that it returns an
>>> array of tasks, except for String arguments which are expanded as path
>>> but stay as Strings.
>>>
>>> Is there a reason for not converting the String arguments to FileTasks?
>>
>> silence = probably for a reason, but I don't remember
>
> To find out whether it was important or not, I changed the artifacts
> method to return a FileTask instead of a String, and then I ran all
> the specs.  One of them failed for a very good reason.  If the user
> writes "compile.with 'no-such.jar'", we want the build to abort with
> the failure message "Don't know how to build no-such.jar".  With my
> change, compile.with converted the string 'no-such.jar' to a FileTask
> and rake believed it knew how to build the file and there was no
> error.  I reverted my change.
>
> Now I have a new puzzle.  I don't understand why Rake accepts that a
> file task's execution ends without the file existing.  It seems a
> reasonable post-condition to me.

That only rake-devel can answer:
http://rubyforge.org/mailman/listinfo/rake-devel

Assaf

>
> Lacton
>

Re: [buildr] Inconsistency in Buildr::artifacts?

Posted by lacton <la...@users.sourceforge.net>.
On Mon, Aug 18, 2008 at 9:29 PM, Assaf Arkin <ar...@intalio.com> wrote:
> On Sun, Aug 17, 2008 at 6:31 AM, lacton <la...@users.sourceforge.net> wrote:
>> Looking at the Buildr::artifacts method, I noticed that it returns an
>> array of tasks, except for String arguments which are expanded as path
>> but stay as Strings.
>>
>> Is there a reason for not converting the String arguments to FileTasks?
>
> silence = probably for a reason, but I don't remember

To find out whether it was important or not, I changed the artifacts
method to return a FileTask instead of a String, and then I ran all
the specs.  One of them failed for a very good reason.  If the user
writes "compile.with 'no-such.jar'", we want the build to abort with
the failure message "Don't know how to build no-such.jar".  With my
change, compile.with converted the string 'no-such.jar' to a FileTask
and rake believed it knew how to build the file and there was no
error.  I reverted my change.

Now I have a new puzzle.  I don't understand why Rake accepts that a
file task's execution ends without the file existing.  It seems a
reasonable post-condition to me.

Lacton

Re: [buildr] Inconsistency in Buildr::artifacts?

Posted by Assaf Arkin <ar...@intalio.com>.
On Sun, Aug 17, 2008 at 6:31 AM, lacton <la...@users.sourceforge.net> wrote:
> Looking at the Buildr::artifacts method, I noticed that it returns an
> array of tasks, except for String arguments which are expanded as path
> but stay as Strings.
>
> Is there a reason for not converting the String arguments to FileTasks?

silence = probably for a reason, but I don't remember

>
> Lacton
>