You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by dhpeterson <dh...@gmail.com> on 2008/01/21 02:23:33 UTC
Packaging non-maven deps using buildr
Hi everyone,
I've been playing around packaging a non-maven dependency for use within a
buildr project. Specifically, I'm using an SMTP library called Ristretto,
which is not available in a POM format.
An extract of my Rakefile is below:
===
...
RISTRETTO_URL =
"http://internap.dl.sourceforge.net/sourceforge/columba/ristretto-1.0-bin.zip"
...
define "proj" do
# ristretto packager
ristretto_zip = download("temp/ristretto.zip"=>RISTRETTO_URL)
ristretto_jar =
file("temp/ristretto/ristretto-1.0-bin/ristretto-1.0-all.jar"=>unzip("temp/ristretto"=>ristretto_zip))
RISTRETTO = artifact("ristretto:ristretto:jar:1.0").from(ristretto_jar)
define "delivery" do
...
compile.with RISTRETTO
end
end
===
After some trial and error, the above Rakefile is now working ... but I have
some questions in relation to what I have done:
1. Unzip paths
When I download into the (top-level) /temp directory, it seems that I can
only unzip when I specify a sub-directory within temp/, i.e.
unzip("temp/ristretto"=>ristretto_zip)
The ristretto zipfile unpacks with a top-level directory of
"ristretto-1.0-bin", but if I specify the following unzip command:
unzip("temp"=>ristretto_zip)
no unzip operation seems to occur within the temp/ directory.
Is this a bug in unzip() or something I am doing wrong?
2. Location of dependency scripting
I tried putting the ristretto building commands in several different scopes
before I had success.
When I tried to put them inside the define "delivery" block (i.e. within the
project that actually requires the dependency), I observed that the
download() command worked successfully (file downloaded into
/temp/ristretto.zip), but the unzip() command went looking for the files in
/delivery/temp/ instead.
I did try to experiment with _() (path-to) in order to build up the right
path strings but I did not have any success.
When I tried moving all the dep scripting outside of the main project task
altogether (i.e. at the top of the Rakefile where all my other artifacts are
defined), I ran into trouble also. The compile.with RISTRETTO task within
the sub-project wasn't able to understand some of the definitions.
The exact error I received when the tasks were moved outside the main define
block was:
rake aborted!
Don't know how to build task
'/home/peterson/workspace/returnity/temp/xyz/ristretto-1.0-bin/ristretto-1.0-all.jar'
In the end, I found that it worked when I put the scripting within the outer
project block (define "proj" do ... end), but outside of the actual
sub-project (define "delivery" do ... end) that uses the dep.
3. Cleanup
Any idea how I can clean-up the contents of temp/ after the script has built
and installed the custom dependency? Where should I hook this in to the
build process?
As I'm still very new to Buildr, any tips/hints on how to handle these
issues would be much appreciated!
Dave
--
View this message in context: http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p14989567.html
Sent from the Buildr - User mailing list archive at Nabble.com.
Re: Packaging non-maven deps using buildr
Posted by dhpeterson <dh...@gmail.com>.
Hi Nathan,
Thanks for the links to your Rakefile sample, it was a great help.
David
n8han wrote:
>
>
> dhpeterson wrote:
>>
>> I've been playing around packaging a non-maven dependency for use within
>> a buildr project. Specifically, I'm using an SMTP library called
>> Ristretto, which is not available in a POM format.
>>
>
> I went after the same problem a little while back, you may have found the
> thread in the archives. The quirk about my solution is that the artifacts
> have to be defined inside the project. Other than that it works to my
> satisfaction.
>
> http://databinder.net/wsvn/Databinder/typeturner/trunk/Rakefile?op=file
> http://databinder.net/wsvn/Databinder/databinder/trunk/tasks/databinder.rake?op=file
>
> Nathan
>
--
View this message in context: http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p15012446.html
Sent from the Buildr - User mailing list archive at Nabble.com.
Re: Packaging non-maven deps using buildr
Posted by n8han <na...@technically.us>.
dhpeterson wrote:
>
> I've been playing around packaging a non-maven dependency for use within a
> buildr project. Specifically, I'm using an SMTP library called Ristretto,
> which is not available in a POM format.
>
I went after the same problem a little while back, you may have found the
thread in the archives. The quirk about my solution is that the artifacts
have to be defined inside the project. Other than that it works to my
satisfaction.
http://databinder.net/wsvn/Databinder/typeturner/trunk/Rakefile?op=file
http://databinder.net/wsvn/Databinder/databinder/trunk/tasks/databinder.rake?op=file
Nathan
--
View this message in context: http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p14999847.html
Sent from the Buildr - User mailing list archive at Nabble.com.
Re: Packaging non-maven deps using buildr
Posted by Matthieu Riou <ma...@offthelip.org>.
To emphasize the point that Martijn and Assaf made, a wiki makes the
life of the writers easier but puts the project maintainers in a world
of pain. Putting you documentation as an attachment to a Jira issue on
the other hand is a bit more work but is also much easier to manage
later on (and also easier to review). It's also fairly easy to
contribute patches to existing documentation by attaching them to an
issue, that's how the documentation is handled for the incubator and
the whole apache main site.
So Jira attachments are highly appreciated :)
Thanks!
Matthieu
On Jan 22, 2008 3:00 PM, Assaf Arkin <ar...@intalio.com> wrote:
> I added a JIRA issue for adding recipes:
>
> https://issues.apache.org/jira/browse/BUILDR-28
>
> Assaf
>
>
> On 1/22/08, Assaf Arkin <ar...@intalio.com> wrote:
> >
> > On 1/22/08, Martijn Dashorst <ma...@gmail.com> wrote:
> > >
> > > Problem with wiki contents coming from non-committers is that they don't
> > > have a paper trail that enables Apache projects to package the
> > > documentation.
> > > So yes, it is nice to have user contributed documentation, and no, you
> > > can't
> > > include it in the distribution.
> > >
> > > Also note that you need to be careful with wiki contents that are part
> > > of
> > > the 'official' site. A PMC needs to make clear what is official and what
> > > is
> > > user generated content. The former is 'approved' and official for the
> > > ASF,
> > > the latter is, though under the supervision of the Buildr (P)PMC, not
> > > 'official ASF' documentation.
> >
> >
> > That's correct. If we had an open Wiki that anyone can add to, for legal
> > reasons, we would not be able to pull that into the official Buildr
> > documentation. I totally missed out on that before, that documentation is
> > still subject to copyright issues, not just the source code. So if you want
> > to contribute a recipe, and we want it to show up in the official
> > documentation, it would have to go through JIRA.
> >
> > It's possible to maintain two Wikis, which some projects do, one official
> > -- only committers can write to -- and one unofficial. Some projects use
> > that, and you'd put recipes and troubleshooting tips in the unofficial
> > Wiki. I prefer to include that in the official documentation as soon as it
> > shows up.
> >
> > So the best work around we found so far is to use Textile, which is as
> > easy to work with as any other Wiki markup. And creating/merging changes
> > against Textile files is actually easier than using a Wiki. Once the change
> > is committed, single rake task uploads it to the Web site. (It will only
> > show up the next day, when Apache synchronizes, but that's also true for
> > Wiki edits).
> >
> > Assaf
> >
> >
> > My $0.02
> > >
> > > Martijn
> > >
> > > On 1/22/08, Thomas Marek < thomasmarek_@web.de> wrote:
> > > >
> > > > dhpeterson wrote:
> > > > > I vote +1 for a mini rake intro in the buildr guide. :)
> > > > >
> > > > > It would be very useful to better understand tasks, file tasks, rake
> > >
> > > > deps
> > > > > etc, and their relationship to buildr. I have reviewed the docs on
> > > the
> > > > rake
> > > > > site already but I didn't find them to be overly useful.
> > > > >
> > > > > I would also like to see some buildr "samples" - e.g. single app
> > > > projects,
> > > > > multi-app projects, building WARs and JARs, and building a custom
> > > ZIP
> > > > (for a
> > > > > headless app) which is something I have just managed to do. I would
> > > be
> > > > happy
> > > > > to contribute whatever I can.
> > > > >
> > > > > Regs,
> > > > >
> > > > > Dave
> > > > >
> > > > +1
> > > >
> > > > Wouldn't it be great to have a wiki for creating such thing like
> > > intros
> > > > and receipts?
> > > > Does apache not provide wikis for their projects?
> > > > And assaf could merge the content with the svn docs?
> > > >
> > > > Regards,
> > > > Thomas
> > > >
> > >
> > >
> > >
> > > --
> > > Buy Wicket in Action: http://manning.com/dashorst
> > > Apache Wicket 1.3.0 is released
> > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
> > >
> >
> >
> >
> > --
> > CTO, Intalio
> > http://www.intalio.com
> >
>
>
>
> --
> CTO, Intalio
> http://www.intalio.com
>
Re: Packaging non-maven deps using buildr
Posted by Assaf Arkin <ar...@intalio.com>.
I added a JIRA issue for adding recipes:
https://issues.apache.org/jira/browse/BUILDR-28
Assaf
On 1/22/08, Assaf Arkin <ar...@intalio.com> wrote:
>
> On 1/22/08, Martijn Dashorst <ma...@gmail.com> wrote:
> >
> > Problem with wiki contents coming from non-committers is that they don't
> > have a paper trail that enables Apache projects to package the
> > documentation.
> > So yes, it is nice to have user contributed documentation, and no, you
> > can't
> > include it in the distribution.
> >
> > Also note that you need to be careful with wiki contents that are part
> > of
> > the 'official' site. A PMC needs to make clear what is official and what
> > is
> > user generated content. The former is 'approved' and official for the
> > ASF,
> > the latter is, though under the supervision of the Buildr (P)PMC, not
> > 'official ASF' documentation.
>
>
> That's correct. If we had an open Wiki that anyone can add to, for legal
> reasons, we would not be able to pull that into the official Buildr
> documentation. I totally missed out on that before, that documentation is
> still subject to copyright issues, not just the source code. So if you want
> to contribute a recipe, and we want it to show up in the official
> documentation, it would have to go through JIRA.
>
> It's possible to maintain two Wikis, which some projects do, one official
> -- only committers can write to -- and one unofficial. Some projects use
> that, and you'd put recipes and troubleshooting tips in the unofficial
> Wiki. I prefer to include that in the official documentation as soon as it
> shows up.
>
> So the best work around we found so far is to use Textile, which is as
> easy to work with as any other Wiki markup. And creating/merging changes
> against Textile files is actually easier than using a Wiki. Once the change
> is committed, single rake task uploads it to the Web site. (It will only
> show up the next day, when Apache synchronizes, but that's also true for
> Wiki edits).
>
> Assaf
>
>
> My $0.02
> >
> > Martijn
> >
> > On 1/22/08, Thomas Marek < thomasmarek_@web.de> wrote:
> > >
> > > dhpeterson wrote:
> > > > I vote +1 for a mini rake intro in the buildr guide. :)
> > > >
> > > > It would be very useful to better understand tasks, file tasks, rake
> >
> > > deps
> > > > etc, and their relationship to buildr. I have reviewed the docs on
> > the
> > > rake
> > > > site already but I didn't find them to be overly useful.
> > > >
> > > > I would also like to see some buildr "samples" - e.g. single app
> > > projects,
> > > > multi-app projects, building WARs and JARs, and building a custom
> > ZIP
> > > (for a
> > > > headless app) which is something I have just managed to do. I would
> > be
> > > happy
> > > > to contribute whatever I can.
> > > >
> > > > Regs,
> > > >
> > > > Dave
> > > >
> > > +1
> > >
> > > Wouldn't it be great to have a wiki for creating such thing like
> > intros
> > > and receipts?
> > > Does apache not provide wikis for their projects?
> > > And assaf could merge the content with the svn docs?
> > >
> > > Regards,
> > > Thomas
> > >
> >
> >
> >
> > --
> > Buy Wicket in Action: http://manning.com/dashorst
> > Apache Wicket 1.3.0 is released
> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
> >
>
>
>
> --
> CTO, Intalio
> http://www.intalio.com
>
--
CTO, Intalio
http://www.intalio.com
Re: Packaging non-maven deps using buildr
Posted by Assaf Arkin <ar...@intalio.com>.
On 1/22/08, Martijn Dashorst <ma...@gmail.com> wrote:
>
> Problem with wiki contents coming from non-committers is that they don't
> have a paper trail that enables Apache projects to package the
> documentation.
> So yes, it is nice to have user contributed documentation, and no, you
> can't
> include it in the distribution.
>
> Also note that you need to be careful with wiki contents that are part of
> the 'official' site. A PMC needs to make clear what is official and what
> is
> user generated content. The former is 'approved' and official for the ASF,
> the latter is, though under the supervision of the Buildr (P)PMC, not
> 'official ASF' documentation.
That's correct. If we had an open Wiki that anyone can add to, for legal
reasons, we would not be able to pull that into the official Buildr
documentation. I totally missed out on that before, that documentation is
still subject to copyright issues, not just the source code. So if you want
to contribute a recipe, and we want it to show up in the official
documentation, it would have to go through JIRA.
It's possible to maintain two Wikis, which some projects do, one official --
only committers can write to -- and one unofficial. Some projects use that,
and you'd put recipes and troubleshooting tips in the unofficial Wiki. I
prefer to include that in the official documentation as soon as it shows up.
So the best work around we found so far is to use Textile, which is as easy
to work with as any other Wiki markup. And creating/merging changes against
Textile files is actually easier than using a Wiki. Once the change is
committed, single rake task uploads it to the Web site. (It will only show
up the next day, when Apache synchronizes, but that's also true for Wiki
edits).
Assaf
My $0.02
>
> Martijn
>
> On 1/22/08, Thomas Marek <th...@web.de> wrote:
> >
> > dhpeterson wrote:
> > > I vote +1 for a mini rake intro in the buildr guide. :)
> > >
> > > It would be very useful to better understand tasks, file tasks, rake
> > deps
> > > etc, and their relationship to buildr. I have reviewed the docs on the
> > rake
> > > site already but I didn't find them to be overly useful.
> > >
> > > I would also like to see some buildr "samples" - e.g. single app
> > projects,
> > > multi-app projects, building WARs and JARs, and building a custom ZIP
> > (for a
> > > headless app) which is something I have just managed to do. I would be
> > happy
> > > to contribute whatever I can.
> > >
> > > Regs,
> > >
> > > Dave
> > >
> > +1
> >
> > Wouldn't it be great to have a wiki for creating such thing like intros
> > and receipts?
> > Does apache not provide wikis for their projects?
> > And assaf could merge the content with the svn docs?
> >
> > Regards,
> > Thomas
> >
>
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
>
--
CTO, Intalio
http://www.intalio.com
Re: Packaging non-maven deps using buildr
Posted by Martijn Dashorst <ma...@gmail.com>.
Problem with wiki contents coming from non-committers is that they don't
have a paper trail that enables Apache projects to package the
documentation.
So yes, it is nice to have user contributed documentation, and no, you can't
include it in the distribution.
Also note that you need to be careful with wiki contents that are part of
the 'official' site. A PMC needs to make clear what is official and what is
user generated content. The former is 'approved' and official for the ASF,
the latter is, though under the supervision of the Buildr (P)PMC, not
'official ASF' documentation.
My $0.02
Martijn
On 1/22/08, Thomas Marek <th...@web.de> wrote:
>
> dhpeterson wrote:
> > I vote +1 for a mini rake intro in the buildr guide. :)
> >
> > It would be very useful to better understand tasks, file tasks, rake
> deps
> > etc, and their relationship to buildr. I have reviewed the docs on the
> rake
> > site already but I didn't find them to be overly useful.
> >
> > I would also like to see some buildr "samples" - e.g. single app
> projects,
> > multi-app projects, building WARs and JARs, and building a custom ZIP
> (for a
> > headless app) which is something I have just managed to do. I would be
> happy
> > to contribute whatever I can.
> >
> > Regs,
> >
> > Dave
> >
> +1
>
> Wouldn't it be great to have a wiki for creating such thing like intros
> and receipts?
> Does apache not provide wikis for their projects?
> And assaf could merge the content with the svn docs?
>
> Regards,
> Thomas
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
Re: Packaging non-maven deps using buildr
Posted by Thomas Marek <th...@web.de>.
dhpeterson wrote:
> I vote +1 for a mini rake intro in the buildr guide. :)
>
> It would be very useful to better understand tasks, file tasks, rake deps
> etc, and their relationship to buildr. I have reviewed the docs on the rake
> site already but I didn't find them to be overly useful.
>
> I would also like to see some buildr "samples" - e.g. single app projects,
> multi-app projects, building WARs and JARs, and building a custom ZIP (for a
> headless app) which is something I have just managed to do. I would be happy
> to contribute whatever I can.
>
> Regs,
>
> Dave
>
+1
Wouldn't it be great to have a wiki for creating such thing like intros
and receipts?
Does apache not provide wikis for their projects?
And assaf could merge the content with the svn docs?
Regards,
Thomas
Re: Packaging non-maven deps using buildr
Posted by dhpeterson <dh...@gmail.com>.
I vote +1 for a mini rake intro in the buildr guide. :)
It would be very useful to better understand tasks, file tasks, rake deps
etc, and their relationship to buildr. I have reviewed the docs on the rake
site already but I didn't find them to be overly useful.
I would also like to see some buildr "samples" - e.g. single app projects,
multi-app projects, building WARs and JARs, and building a custom ZIP (for a
headless app) which is something I have just managed to do. I would be happy
to contribute whatever I can.
Regs,
Dave
Assaf Arkin wrote:
>
> On 1/21/08, dhpeterson <dh...@gmail.com> wrote:
>>
>>
>>
>> Hi Assaf
>>
>> Thanks for clarifying these points. I understand now!
>>
>> The method call to .enhance {...} is cool. I didn't see it documented on
>> the
>> rdoc for 1.2.10 - am I looking in the wrong place? The only enhance() I
>> can
>> see is for JPA.
>
>
> Tasks, file tasks and dependencies are all handled by Rake. You can read
> more about Rake here::
>
> http://docs.rubyrake.org/
>
> I think it will be a good idea to write a brief into to Rake and include
> it
> in the Buildr documentation, but I never get around to doing it.
>
> Assaf
>
> Dave
>>
>>
>> Assaf Arkin wrote:
>> >
>> > On 1/20/08, dhpeterson <dh...@gmail.com> wrote:
>> >>
>> >>
>> >>
>> >> Hi everyone,
>> >>
>> >> I've been playing around packaging a non-maven dependency for use
>> within
>> >> a
>> >> buildr project. Specifically, I'm using an SMTP library called
>> Ristretto,
>> >> which is not available in a POM format.
>> >>
>> >> An extract of my Rakefile is below:
>> >>
>> >> ===
>> >> ...
>> >> RISTRETTO_URL =
>> >> "
>> >>
>> http://internap.dl.sourceforge.net/sourceforge/columba/ristretto-1.0-bin.zip
>> >> "
>> >> ...
>> >>
>> >>
>> >> define "proj" do
>> >>
>> >> # ristretto packager
>> >> ristretto_zip = download("temp/ristretto.zip"=>RISTRETTO_URL)
>> >> ristretto_jar =
>> >> file("temp/ristretto/ristretto-1.0-bin/ristretto-1.0-all.jar
>> >> "=>unzip("temp/ristretto"=>ristretto_zip))
>> >> RISTRETTO = artifact("ristretto:ristretto:jar:1.0
>> ").from(ristretto_jar)
>> >>
>> >> define "delivery" do
>> >> ...
>> >> compile.with RISTRETTO
>> >>
>> >> end
>> >> end
>> >>
>> >> ===
>> >>
>> >>
>> >> After some trial and error, the above Rakefile is now working ... but
>> I
>> >> have
>> >> some questions in relation to what I have done:
>> >>
>> >>
>> >> 1. Unzip paths
>> >>
>> >> When I download into the (top-level) /temp directory, it seems that I
>> can
>> >> only unzip when I specify a sub-directory within temp/, i.e.
>> >>
>> >> unzip("temp/ristretto"=>ristretto_zip)
>> >>
>> >> The ristretto zipfile unpacks with a top-level directory of
>> >> "ristretto-1.0-bin", but if I specify the following unzip command:
>> >>
>> >> unzip("temp"=>ristretto_zip)
>> >>
>> >> no unzip operation seems to occur within the temp/ directory.
>> >>
>> >> Is this a bug in unzip() or something I am doing wrong?
>> >
>> >
>> > The unzip task is basically a file dependency between the target
>> directory
>> > and Zip file. If the target directory doesn't exist, or the Zip file
>> is
>> > newer than the target directory, the task runs and unzips.
>> >
>> >
>> > 2. Location of dependency scripting
>> >>
>> >>
>> >> I tried putting the ristretto building commands in several different
>> >> scopes
>> >> before I had success.
>> >>
>> >> When I tried to put them inside the define "delivery" block (i.e.
>> within
>> >> the
>> >> project that actually requires the dependency), I observed that the
>> >> download() command worked successfully (file downloaded into
>> >> /temp/ristretto.zip), but the unzip() command went looking for the
>> files
>> >> in
>> >> /delivery/temp/ instead.
>> >
>> >
>> > I think I know what the bug is with download putting it in /temp
>> instead
>> > of
>> > /delivery/temp.
>> >
>> >
>> > I did try to experiment with _() (path-to) in order to build up the
>> right
>> >> path strings but I did not have any success.
>> >>
>> >> When I tried moving all the dep scripting outside of the main project
>> >> task
>> >> altogether (i.e. at the top of the Rakefile where all my other
>> artifacts
>> >> are
>> >> defined), I ran into trouble also. The compile.with RISTRETTO task
>> within
>> >> the sub-project wasn't able to understand some of the definitions.
>> >>
>> >> The exact error I received when the tasks were moved outside the main
>> >> define
>> >> block was:
>> >>
>> >> rake aborted!
>> >> Don't know how to build task
>> >> '/home/peterson/workspace/returnity/temp/xyz/ristretto-1.0-bin
>> /ristretto-
>> >> 1.0-all.jar'
>> >>
>> >>
>> >> In the end, I found that it worked when I put the scripting within the
>> >> outer
>> >> project block (define "proj" do ... end), but outside of the actual
>> >> sub-project (define "delivery" do ... end) that uses the dep.
>> >>
>> >>
>> >> 3. Cleanup
>> >>
>> >> Any idea how I can clean-up the contents of temp/ after the script has
>> >> built
>> >> and installed the custom dependency? Where should I hook this in to
>> the
>> >> build process?
>> >
>> >
>> > One option is to enhance the clean task:
>> >
>> > clean do
>> > rm_rf 'temp'
>> > end
>> >
>> > Another option is to do it immediately after copying the JAR, by
>> enhancing
>> > the artifact task itself:
>> >
>> > artifact("ristretto:ristretto:jar:1.0").from(ristretto_jar).enhance {
>> > rm_rf
>> > 'temp' }
>> >
>> > Assaf
>> >
>> > As I'm still very new to Buildr, any tips/hints on how to handle these
>> >> issues would be much appreciated!
>> >>
>> >>
>> >> Dave
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p14989567.html
>> >> Sent from the Buildr - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p15010391.html
>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> CTO, Intalio
> http://www.intalio.com
>
>
--
View this message in context: http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p15012488.html
Sent from the Buildr - User mailing list archive at Nabble.com.
Re: Packaging non-maven deps using buildr
Posted by Assaf Arkin <ar...@intalio.com>.
On 1/21/08, dhpeterson <dh...@gmail.com> wrote:
>
>
>
> Hi Assaf
>
> Thanks for clarifying these points. I understand now!
>
> The method call to .enhance {...} is cool. I didn't see it documented on
> the
> rdoc for 1.2.10 - am I looking in the wrong place? The only enhance() I
> can
> see is for JPA.
Tasks, file tasks and dependencies are all handled by Rake. You can read
more about Rake here::
http://docs.rubyrake.org/
I think it will be a good idea to write a brief into to Rake and include it
in the Buildr documentation, but I never get around to doing it.
Assaf
Dave
>
>
> Assaf Arkin wrote:
> >
> > On 1/20/08, dhpeterson <dh...@gmail.com> wrote:
> >>
> >>
> >>
> >> Hi everyone,
> >>
> >> I've been playing around packaging a non-maven dependency for use
> within
> >> a
> >> buildr project. Specifically, I'm using an SMTP library called
> Ristretto,
> >> which is not available in a POM format.
> >>
> >> An extract of my Rakefile is below:
> >>
> >> ===
> >> ...
> >> RISTRETTO_URL =
> >> "
> >>
> http://internap.dl.sourceforge.net/sourceforge/columba/ristretto-1.0-bin.zip
> >> "
> >> ...
> >>
> >>
> >> define "proj" do
> >>
> >> # ristretto packager
> >> ristretto_zip = download("temp/ristretto.zip"=>RISTRETTO_URL)
> >> ristretto_jar =
> >> file("temp/ristretto/ristretto-1.0-bin/ristretto-1.0-all.jar
> >> "=>unzip("temp/ristretto"=>ristretto_zip))
> >> RISTRETTO = artifact("ristretto:ristretto:jar:1.0
> ").from(ristretto_jar)
> >>
> >> define "delivery" do
> >> ...
> >> compile.with RISTRETTO
> >>
> >> end
> >> end
> >>
> >> ===
> >>
> >>
> >> After some trial and error, the above Rakefile is now working ... but I
> >> have
> >> some questions in relation to what I have done:
> >>
> >>
> >> 1. Unzip paths
> >>
> >> When I download into the (top-level) /temp directory, it seems that I
> can
> >> only unzip when I specify a sub-directory within temp/, i.e.
> >>
> >> unzip("temp/ristretto"=>ristretto_zip)
> >>
> >> The ristretto zipfile unpacks with a top-level directory of
> >> "ristretto-1.0-bin", but if I specify the following unzip command:
> >>
> >> unzip("temp"=>ristretto_zip)
> >>
> >> no unzip operation seems to occur within the temp/ directory.
> >>
> >> Is this a bug in unzip() or something I am doing wrong?
> >
> >
> > The unzip task is basically a file dependency between the target
> directory
> > and Zip file. If the target directory doesn't exist, or the Zip file is
> > newer than the target directory, the task runs and unzips.
> >
> >
> > 2. Location of dependency scripting
> >>
> >>
> >> I tried putting the ristretto building commands in several different
> >> scopes
> >> before I had success.
> >>
> >> When I tried to put them inside the define "delivery" block (i.e.
> within
> >> the
> >> project that actually requires the dependency), I observed that the
> >> download() command worked successfully (file downloaded into
> >> /temp/ristretto.zip), but the unzip() command went looking for the
> files
> >> in
> >> /delivery/temp/ instead.
> >
> >
> > I think I know what the bug is with download putting it in /temp instead
> > of
> > /delivery/temp.
> >
> >
> > I did try to experiment with _() (path-to) in order to build up the
> right
> >> path strings but I did not have any success.
> >>
> >> When I tried moving all the dep scripting outside of the main project
> >> task
> >> altogether (i.e. at the top of the Rakefile where all my other
> artifacts
> >> are
> >> defined), I ran into trouble also. The compile.with RISTRETTO task
> within
> >> the sub-project wasn't able to understand some of the definitions.
> >>
> >> The exact error I received when the tasks were moved outside the main
> >> define
> >> block was:
> >>
> >> rake aborted!
> >> Don't know how to build task
> >> '/home/peterson/workspace/returnity/temp/xyz/ristretto-1.0-bin
> /ristretto-
> >> 1.0-all.jar'
> >>
> >>
> >> In the end, I found that it worked when I put the scripting within the
> >> outer
> >> project block (define "proj" do ... end), but outside of the actual
> >> sub-project (define "delivery" do ... end) that uses the dep.
> >>
> >>
> >> 3. Cleanup
> >>
> >> Any idea how I can clean-up the contents of temp/ after the script has
> >> built
> >> and installed the custom dependency? Where should I hook this in to the
> >> build process?
> >
> >
> > One option is to enhance the clean task:
> >
> > clean do
> > rm_rf 'temp'
> > end
> >
> > Another option is to do it immediately after copying the JAR, by
> enhancing
> > the artifact task itself:
> >
> > artifact("ristretto:ristretto:jar:1.0").from(ristretto_jar).enhance {
> > rm_rf
> > 'temp' }
> >
> > Assaf
> >
> > As I'm still very new to Buildr, any tips/hints on how to handle these
> >> issues would be much appreciated!
> >>
> >>
> >> Dave
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p14989567.html
> >> Sent from the Buildr - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p15010391.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>
>
--
CTO, Intalio
http://www.intalio.com
Re: Packaging non-maven deps using buildr
Posted by dhpeterson <dh...@gmail.com>.
Hi Assaf
Thanks for clarifying these points. I understand now!
The method call to .enhance {...} is cool. I didn't see it documented on the
rdoc for 1.2.10 - am I looking in the wrong place? The only enhance() I can
see is for JPA.
Dave
Assaf Arkin wrote:
>
> On 1/20/08, dhpeterson <dh...@gmail.com> wrote:
>>
>>
>>
>> Hi everyone,
>>
>> I've been playing around packaging a non-maven dependency for use within
>> a
>> buildr project. Specifically, I'm using an SMTP library called Ristretto,
>> which is not available in a POM format.
>>
>> An extract of my Rakefile is below:
>>
>> ===
>> ...
>> RISTRETTO_URL =
>> "
>> http://internap.dl.sourceforge.net/sourceforge/columba/ristretto-1.0-bin.zip
>> "
>> ...
>>
>>
>> define "proj" do
>>
>> # ristretto packager
>> ristretto_zip = download("temp/ristretto.zip"=>RISTRETTO_URL)
>> ristretto_jar =
>> file("temp/ristretto/ristretto-1.0-bin/ristretto-1.0-all.jar
>> "=>unzip("temp/ristretto"=>ristretto_zip))
>> RISTRETTO = artifact("ristretto:ristretto:jar:1.0").from(ristretto_jar)
>>
>> define "delivery" do
>> ...
>> compile.with RISTRETTO
>>
>> end
>> end
>>
>> ===
>>
>>
>> After some trial and error, the above Rakefile is now working ... but I
>> have
>> some questions in relation to what I have done:
>>
>>
>> 1. Unzip paths
>>
>> When I download into the (top-level) /temp directory, it seems that I can
>> only unzip when I specify a sub-directory within temp/, i.e.
>>
>> unzip("temp/ristretto"=>ristretto_zip)
>>
>> The ristretto zipfile unpacks with a top-level directory of
>> "ristretto-1.0-bin", but if I specify the following unzip command:
>>
>> unzip("temp"=>ristretto_zip)
>>
>> no unzip operation seems to occur within the temp/ directory.
>>
>> Is this a bug in unzip() or something I am doing wrong?
>
>
> The unzip task is basically a file dependency between the target directory
> and Zip file. If the target directory doesn't exist, or the Zip file is
> newer than the target directory, the task runs and unzips.
>
>
> 2. Location of dependency scripting
>>
>>
>> I tried putting the ristretto building commands in several different
>> scopes
>> before I had success.
>>
>> When I tried to put them inside the define "delivery" block (i.e. within
>> the
>> project that actually requires the dependency), I observed that the
>> download() command worked successfully (file downloaded into
>> /temp/ristretto.zip), but the unzip() command went looking for the files
>> in
>> /delivery/temp/ instead.
>
>
> I think I know what the bug is with download putting it in /temp instead
> of
> /delivery/temp.
>
>
> I did try to experiment with _() (path-to) in order to build up the right
>> path strings but I did not have any success.
>>
>> When I tried moving all the dep scripting outside of the main project
>> task
>> altogether (i.e. at the top of the Rakefile where all my other artifacts
>> are
>> defined), I ran into trouble also. The compile.with RISTRETTO task within
>> the sub-project wasn't able to understand some of the definitions.
>>
>> The exact error I received when the tasks were moved outside the main
>> define
>> block was:
>>
>> rake aborted!
>> Don't know how to build task
>> '/home/peterson/workspace/returnity/temp/xyz/ristretto-1.0-bin/ristretto-
>> 1.0-all.jar'
>>
>>
>> In the end, I found that it worked when I put the scripting within the
>> outer
>> project block (define "proj" do ... end), but outside of the actual
>> sub-project (define "delivery" do ... end) that uses the dep.
>>
>>
>> 3. Cleanup
>>
>> Any idea how I can clean-up the contents of temp/ after the script has
>> built
>> and installed the custom dependency? Where should I hook this in to the
>> build process?
>
>
> One option is to enhance the clean task:
>
> clean do
> rm_rf 'temp'
> end
>
> Another option is to do it immediately after copying the JAR, by enhancing
> the artifact task itself:
>
> artifact("ristretto:ristretto:jar:1.0").from(ristretto_jar).enhance {
> rm_rf
> 'temp' }
>
> Assaf
>
> As I'm still very new to Buildr, any tips/hints on how to handle these
>> issues would be much appreciated!
>>
>>
>> Dave
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p14989567.html
>> Sent from the Buildr - User mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p15010391.html
Sent from the Buildr - User mailing list archive at Nabble.com.
Re: Packaging non-maven deps using buildr
Posted by Assaf Arkin <ar...@intalio.com>.
On 1/20/08, dhpeterson <dh...@gmail.com> wrote:
>
>
>
> Hi everyone,
>
> I've been playing around packaging a non-maven dependency for use within a
> buildr project. Specifically, I'm using an SMTP library called Ristretto,
> which is not available in a POM format.
>
> An extract of my Rakefile is below:
>
> ===
> ...
> RISTRETTO_URL =
> "
> http://internap.dl.sourceforge.net/sourceforge/columba/ristretto-1.0-bin.zip
> "
> ...
>
>
> define "proj" do
>
> # ristretto packager
> ristretto_zip = download("temp/ristretto.zip"=>RISTRETTO_URL)
> ristretto_jar =
> file("temp/ristretto/ristretto-1.0-bin/ristretto-1.0-all.jar
> "=>unzip("temp/ristretto"=>ristretto_zip))
> RISTRETTO = artifact("ristretto:ristretto:jar:1.0").from(ristretto_jar)
>
> define "delivery" do
> ...
> compile.with RISTRETTO
>
> end
> end
>
> ===
>
>
> After some trial and error, the above Rakefile is now working ... but I
> have
> some questions in relation to what I have done:
>
>
> 1. Unzip paths
>
> When I download into the (top-level) /temp directory, it seems that I can
> only unzip when I specify a sub-directory within temp/, i.e.
>
> unzip("temp/ristretto"=>ristretto_zip)
>
> The ristretto zipfile unpacks with a top-level directory of
> "ristretto-1.0-bin", but if I specify the following unzip command:
>
> unzip("temp"=>ristretto_zip)
>
> no unzip operation seems to occur within the temp/ directory.
>
> Is this a bug in unzip() or something I am doing wrong?
The unzip task is basically a file dependency between the target directory
and Zip file. If the target directory doesn't exist, or the Zip file is
newer than the target directory, the task runs and unzips.
2. Location of dependency scripting
>
>
> I tried putting the ristretto building commands in several different
> scopes
> before I had success.
>
> When I tried to put them inside the define "delivery" block (i.e. within
> the
> project that actually requires the dependency), I observed that the
> download() command worked successfully (file downloaded into
> /temp/ristretto.zip), but the unzip() command went looking for the files
> in
> /delivery/temp/ instead.
I think I know what the bug is with download putting it in /temp instead of
/delivery/temp.
I did try to experiment with _() (path-to) in order to build up the right
> path strings but I did not have any success.
>
> When I tried moving all the dep scripting outside of the main project task
> altogether (i.e. at the top of the Rakefile where all my other artifacts
> are
> defined), I ran into trouble also. The compile.with RISTRETTO task within
> the sub-project wasn't able to understand some of the definitions.
>
> The exact error I received when the tasks were moved outside the main
> define
> block was:
>
> rake aborted!
> Don't know how to build task
> '/home/peterson/workspace/returnity/temp/xyz/ristretto-1.0-bin/ristretto-
> 1.0-all.jar'
>
>
> In the end, I found that it worked when I put the scripting within the
> outer
> project block (define "proj" do ... end), but outside of the actual
> sub-project (define "delivery" do ... end) that uses the dep.
>
>
> 3. Cleanup
>
> Any idea how I can clean-up the contents of temp/ after the script has
> built
> and installed the custom dependency? Where should I hook this in to the
> build process?
One option is to enhance the clean task:
clean do
rm_rf 'temp'
end
Another option is to do it immediately after copying the JAR, by enhancing
the artifact task itself:
artifact("ristretto:ristretto:jar:1.0").from(ristretto_jar).enhance { rm_rf
'temp' }
Assaf
As I'm still very new to Buildr, any tips/hints on how to handle these
> issues would be much appreciated!
>
>
> Dave
>
> --
> View this message in context:
> http://www.nabble.com/Packaging-non-maven-deps-using-buildr-tp14989567p14989567.html
> Sent from the Buildr - User mailing list archive at Nabble.com.
>
>