On Sat, Oct 25, 2008 at 9:02 AM, lacton <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 12:59 AM, Assaf Arkin <[EMAIL PROTECTED]> 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 >>> >> >