On Tue, Feb 9, 2010 at 9:18 PM, Kevin Smith <kevi...@qualitycode.com> wrote:

> Thanks again. Comments below.
>
> On Tue, 2010-02-09 at 20:48 -0800, Antoine Toulme wrote:
>
> >         It would be great if you could add something like this to the
> >         user guide.
> > Could you help us by opening a bug on this ?
>
> Yes, I will do that.
>
> > You want to convert an artifact into a file ? It's more the other way
> > around:
> >
> Buildr::artifact("group:artifact:extension:version").from(_("target/myfile.zip")
>
> No, I really do want to convert an artifact to a file, and not the other
> way around. For example, I want to copy a third-party jar (artifact)
> directly into an ISO image.
>

An artifact is (Rake) FileTask, its name is the path to the jar in your
maven repository.
And the method Task#to_s returns the name of the task. So what you're
looking for is Artifact#to_s

So to copy the jar, you can do:
cp artifact('...').to_s dest

Note that the artifact must have been installed first.

Hope it helps,

Alexis



>
> > The enhance method comes from rake. Everything in buildr is based on
> > rake.
>
> Yes, that is one of the frustrations of the buildr documentation. I have
> used rake extensively in the past, but it was several years ago. It
> would be great to have one document that covers buildr+rake. I know it
> would be difficult. Hopefully you can at least continue to add examples
> and other documentation to mention the useful parts of rake as they
> apply in a buildr context.
>
> With javadocs, at least when you are looking at a class, you get to see
> all the methods that were inherited. rubydocs would be much nicer if
> they could do that as well.
>
> > That sounds like custom stuff. I would rather define a task with a
> > different name for that.
>
> Ok. So let's say I want to create 'justjars' and 'fullrelease' tasks in
> my master project.
>
> >         The final outcome of my project is a jar with an associated
> >         sha1 file,
> >         a .iso file, a .exe file, a zip file, another zip file, and a
> >         few other
> >         files. In my mind, running 'buildr build' shouldn't actually
> >         create all
> >         those final files. I would think I would run 'buildr package',
> >         but that
> >         doesn't seem to work.
>
> > You could define an other subproject that would call those.
> > That's what I would do, and it would depend on the other subprojects.
> > The main project is not called because it contains "nothing", no
> > source files in particular.
>
> Ah, got it. I actually had it before, but was looking in the wrong place
> for the output. Something like this, which seems to work:
>
>  task 'justjars' => [project('part1').package(:jar),
>         project('part2').package(:jar)]
>
> And hopefully this (which I haven't been able to test yet):
>
>  task 'fullrelease' => [project('iso').iso, project('exe').exe]
>
> Assuming I create custom iso and exe tasks in the sub-projects. Does
> that sound about right?
>
> Kevin
>
>
>

Reply via email to