Or Chris could use the following hack,
# :call-seq:
# shorten("project-name")
#
# shorten("project1") makes all project1:project2:subtask's available as #
:call-seq:
def shorten(prj)
project(prj) # make sure project is evaluated
Buildr.application.tasks.each do |t|
parts = t.name.split(':')
if (parts[0] == prj) && (parts.size > 2)
task parts[1..-1].join(":") => [t]
end
end
end
shorten("root-project")
and then be able to write,
buildr webapp1:package
alex
On Tue, Jul 26, 2011 at 11:50 PM, Antoine Toulme <[email protected]>wrote:
> You want to alias the task root-project:webapp2:package with a shorter
> name.
>
> Since Buildr is that thin icing on Rake's cake, it's mostly a Rake trick.
>
> https://github.com/jimweirich/rake/issues/16
>
> desc "QUICK!!"
>
> task :quick => root-project:webapp2:package
>
> buildr -T will show you the task:
> ...
> buildr quick # QUICK!!
>
> On Wed, Jul 27, 2011 at 06:27, Chris Adams <[email protected]> wrote:
>
> > Hi,
> >
> > I'm making good progress migrating our build from ant to buildr, but
> > there's
> > one thing I'm still having a difficult time figuring out how to do.
> >
> > The way my project is laid out is in the following hierarchy (for
> example):
> > root-project
> > ---- library 1
> > ---- library 2
> > ---- webapp1
> > ---- webapp2
> >
> > Right now, to build and package webapp 2 from the root directory, the
> user
> > has to fully qualify it:
> > > buildr root-project:webapp2:package
> >
> > What I'd really like is for our developers to simply type the following
> > from
> > the root:
> > > buildr webapp2 package
> > > buildr webapp1 package
> > etc.
> >
> > Is this possible? Or do they always have to qualify it with
> > project:sub-project:package?
> >
> > Thanks.
> >
> > - Chris
> >
>