buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <ar...@intalio.com>
Subject Re: svn commit: r707477 - in /incubator/buildr/trunk: CHANGELOG lib/buildr/packaging/artifact.rb spec/core/compile_spec.rb spec/packaging/artifact_spec.rb
Date Mon, 27 Oct 2008 21:19:43 GMT
On Sat, Oct 25, 2008 at 9:02 AM, lacton <lacton@users.sourceforge.net> wrote:
> On Fri, Oct 24, 2008 at 12:59 AM, Assaf Arkin <arkin@intalio.com> wrote:
>>> Buildr (rake) interpreted "compile.from('sources')" as a dependency to
>>> the new 'sources' task instead of the 'sources' subdirectory.
>>
>> Short term, rename the task to something that's clearly not a
>> file/directory name, say artifact:sources, or download:sources.
>
> Done.
>
>> Long term, this has been bugging me for a while.  All tasks share the
>> same name, including file tasks and occasionally we get collisions.
>> There's a work around, using full paths as often as possible, which
>> works most of the time, but brings its own annoyance: console output
>> runs a mile long.
>
> I agree reading absolute paths is annoying.  What I'd like is for
> buildr to display paths relative to the project root dir whenever
> possible.
>
> Instead of
> Compiling foo:bar:mail into
> /home/lacton/projects/mycompany/foo/bar/mail/target/classes
> I'd rather have
> Compiling foo:bar:mail into bar/mail/target/classes
>
> For files in the project root dir, we could prefix the path with './'.
>  That way, 'sources' would be the task and './sources' would be the
> file task.

I think that would just be confusing.  All paths within the project
root should either use './' or not; it's enough to have it different
between project paths and absolute paths.

>> I'd like at some point to truncate these too-long paths, maybe the
>> solution would be to use namespaces for most other tasks?
>
> Do you mean like typing 'buildr buildr:clean buildr:build' instead of
> 'buildr clean build'?

Not every single task, that would just be too much ...

There are some benefits to absolute paths:
- Task files mostly don't conflict with named tasks, or as we found
out, not often enough to be a serious issue.
- It avoids the accidental duplicate; in Rake, file("foo") and
file("./foo") are different tasks even though they point to the same
file.
- You can use them when running rake from the command line, the same
path works in every directory.
- Way back in the past we needed a lot of expand_path in Buildr, and
it was just easier to have _() handle it.  (Last because it's no
longer an issue)

Assaf

>
> Lacton
>
>> Assaf
>>
>>>
>>> Any better idea?
>>>
>>> Lacton
>>>
>>>> Modified: incubator/buildr/trunk/spec/core/compile_spec.rb
>>>> URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/compile_spec.rb?rev=707477&r1=707476&r2=707477&view=diff
>>>> ==============================================================================
>>>> --- incubator/buildr/trunk/spec/core/compile_spec.rb (original)
>>>> +++ incubator/buildr/trunk/spec/core/compile_spec.rb Thu Oct 23 14:17:25
2008
>>>> @@ -379,7 +379,7 @@
>>>>   it 'should complain if source directories and no compiler selected' do
>>>>     mkpath 'sources'
>>>>     define 'bar' do
>>>> -      lambda { compile.from('sources').invoke }.should raise_error(RuntimeError,
/no compiler selected/i)
>>>> +      lambda { compile.from(_('sources')).invoke }.should raise_error(RuntimeError,
/no compiler selected/i)
>>>>     end
>>>>   end
>>>>  end
>>>
>>
>

Mime
View raw message