Building RCP with external modules on Hudson...Advice

View: New views
6 Messages — Rating Filter:   Alert me  

Building RCP with external modules on Hudson...Advice

by gbivins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All,

I've finally finished up the coding effort for my first full blown Netbeans Platform based application. Ok...now the next step is to integrate it into our automated build environment which uses Hudson. My application is a collection of modules and it references some external (by that I mean different projects in subversion) module suites.



For instance, let's say my application is called "AppA".

AppA contains ModuleA. It also references a module suite, ModuleSuiteB which contains ModuleB.

Svn looks like this:




Code:
/path/to/repo/svn/AppA/trunk

                     |

                     |--ModuleA



/path/to/repo/svn/ModuleSuiteB/trunk

                                                |

                                                |--ModuleB





Any advice on setting up a job on Hudson for this?  

How does AppA know about the ModuleSuiteB dependency?



I've seen some talk of using Maven but I haven't found any docs on using maven in NBP based apps (or how to port them since all tutorials use Ant).

How about Ivy, is there a way to harness Ivy for this?

Thanks for any advice here.

Gerrick





Re: Building RCP with external modules on Hudson...Advice

by Fabrizio Giudici :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gbivins wrote:
> Any advice on setting up a job on Hudson for this?
For doing that in Ant, I used to work in this way:

http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining

Yours is a simpler case, still the idea is about writing some ant tasks
that prepare the artifacts from the dependant project to the depending
project. Unfortunately, I'm not managing any longer the Ant stuff since
I've moved to Maven.

> I've seen some talk of using Maven but I haven't found any docs on using maven in NBP based apps (or how to port them since all tutorials use Ant).
>  
For what concerns development, there's this article by Emilian Bold:

http://www.netbeans.org/community/magazine/html/04/maven.html#

It's a bit old and some details have surely changed, but I think most of
stuff is in. I'm preparing a screencast for demonstrating how to use my
components in a Platform project with Maven, but I need still 1-2 weeks
to complete it (unless I get ill and I'm forced to stay at home, which I
don't hope for).

For what concerns the conversion, I've written some sparse scripts and a
small java program. It's not productized at all - I'm also going to
write about that and share, but it's not for tomorrow.
> How about Ivy, is there a way to harness Ivy for this?
>
>  
I've done some experiment and it's possible. But I'm not able to explain
it yet, as there are many things of Ivy that I don't know yet. Work in
progress! I hope that in the meantime somebody else is able to help you.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@... - mobile: +39 348.150.6941


Building RCP with external modules on Hudson...Advice

by gbivins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Fabrizio,

I was hoping you'd respond because I've been reading your blog as it seems to be exactly the same problem I'm faced with. I found your original blog about suite chaining and was going to try to implement something like that myself, but before trying it I saw you were in the process of switching to maven.



So would you suggest I convert my project to Maven? Would that make it easier to integrate manage with Hudson? Again, my setup is verrry similar to your bluemarine project in that I have a couple of core module suites (mostly external library module wrappers) that are used in other suites which can then used to make the final products/applications.

I am actually evaluating this process to help our team decide if we should switch our flagship app over to the NBP so it would be very helpful to hear more of your opinions on dealing with these integration type issues.

TIA

Gerrick





Re: Building RCP with external modules on Hudson...Advice

by Fabrizio Giudici :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gbivins wrote:

> Hello Fabrizio,
>
> I was hoping you'd respond because I've been reading your blog as it seems to be exactly the same problem I'm faced with. I found your original blog about suite chaining and was going to try to implement something like that myself, but before trying it I saw you were in the process of switching to maven.
>
>
>
> So would you suggest I convert my project to Maven? Would that make it easier to integrate manage with Hudson? Again, my setup is verrry similar to your bluemarine project in that I have a couple of core module suites (mostly external library module wrappers) that are used in other suites which can then used to make the final products/applications.
>
> I am actually evaluating this process to help our team decide if we should switch our flagship app over to the NBP so it would be very helpful to hear more of your opinions on dealing with these integration type issues.
>  
The only thing I can do now is sharing the scripts I'm using. They are
two zips attached to this email. The shell scripts are used to change
the layout of sources (from Ant style to Maven style). The Mavenizer is
a small JSE class that parses the various configuration files of an Ant
based project and creates the MAven based files. It has some hardwired
stuff, doesn't handle the configuration of layer.xml (I mean, doesn't
fill the manifest properly when there's a layer.xml) and it's pretty
lame (and wired on my projects) for guessing Maven artifact ids and
versions. I also need to do some manually fix after I run it (I mean, if
it worked perfectly I'd have already completed the conversion of my
projects ;-) For what concerns the shell scripts, I'm not sure all of
them are needed, as I did my conversion incrementally and probably
something is an old version.

I wonder whether it makes sense that a productized tool is made and
maintained for this task. Maybe it's my perspective, but I had the
impression that during the past summer quite a lot of people were
mavenizing their projecs (I'm not only talking of NetBeans Platform
projects). For such a tool, I don't know which would be the better way
to do it. Probably a person skilled with sh or perl could make it
easily; OTOH one could think of a specific plug in to install in the
IDE. Who knows?

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@... - mobile: +39 348.150.6941




maven.scripts.zip (2K) Download Attachment
mavenizer.zip (38K) Download Attachment

Re: Building RCP with external modules on Hudson...Advice

by gbivins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cool!
Thanks for the tips. @ least it will give me some insight on the  
differences of the Maven setup v Ant.
I also got the impression that lots of people were investigating/
switching to maven for projects.
I think it would make sense to have a converter (plugin to/from maven).
I also think the docs on maven + rcp applications need some beefing up  
as well.

So if I understand things correctly, in maven the concept of module  
suites doesn't exist, it's just projects (1 pom/module)? Is that right?
Also, under ant, placing native libs in the release directory would  
allow them to be packaged up and placed where they are accessible @  
runtime, how is this handled via maven?
Thanks again for the pointers.
Gerrick
On Oct 21, 2009, at 5:22 PM, Fabrizio Giudici wrote:

> gbivins wrote:
>> Hello Fabrizio,
>>
>> I was hoping you'd respond because I've been reading your blog as  
>> it seems to be exactly the same problem I'm faced with. I found  
>> your original blog about suite chaining and was going to try to  
>> implement something like that myself, but before trying it I saw  
>> you were in the process of switching to maven.
>>
>>
>>
>> So would you suggest I convert my project to Maven? Would that make  
>> it easier to integrate manage with Hudson? Again, my setup is  
>> verrry similar to your bluemarine project in that I have a couple  
>> of core module suites (mostly external library module wrappers)  
>> that are used in other suites which can then used to make the final  
>> products/applications.
>> I am actually evaluating this process to help our team decide if we  
>> should switch our flagship app over to the NBP so it would be very  
>> helpful to hear more of your opinions on dealing with these  
>> integration type issues.
>>
> The only thing I can do now is sharing the scripts I'm using. They  
> are two zips attached to this email. The shell scripts are used to  
> change the layout of sources (from Ant style to Maven style). The  
> Mavenizer is a small JSE class that parses the various configuration  
> files of an Ant based project and creates the MAven based files. It  
> has some hardwired stuff, doesn't handle the configuration of  
> layer.xml (I mean, doesn't fill the manifest properly when there's a  
> layer.xml) and it's pretty lame (and wired on my projects) for  
> guessing Maven artifact ids and versions. I also need to do some  
> manually fix after I run it (I mean, if it worked perfectly I'd have  
> already completed the conversion of my projects ;-) For what  
> concerns the shell scripts, I'm not sure all of them are needed, as  
> I did my conversion incrementally and probably something is an old  
> version.
>
> I wonder whether it makes sense that a productized tool is made and  
> maintained for this task. Maybe it's my perspective, but I had the  
> impression that during the past summer quite a lot of people were  
> mavenizing their projecs (I'm not only talking of NetBeans Platform  
> projects). For such a tool, I don't know which would be the better  
> way to do it. Probably a person skilled with sh or perl could make  
> it easily; OTOH one could think of a specific plug in to install in  
> the IDE. Who knows?
>
> --
> Fabrizio Giudici - Java Architect, Project Manager
> Tidalwave s.a.s. - "We make Java work. Everywhere."
> weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
> Fabrizio.Giudici@... - mobile: +39 348.150.6941
>
> <maven.scripts.zip><mavenizer.zip>


Re: Building RCP with external modules on Hudson...Advice

by Fabrizio Giudici :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gerrick Bivins wrote:

> Cool!
> Thanks for the tips. @ least it will give me some insight on the
> differences of the Maven setup v Ant.
> I also got the impression that lots of people were
> investigating/switching to maven for projects.
> I think it would make sense to have a converter (plugin to/from maven).
> I also think the docs on maven + rcp applications need some beefing up
> as well.
>
> So if I understand things correctly, in maven the concept of module
> suites doesn't exist, it's just projects (1 pom/module)? Is that right?
The concept still exists, but it's sort of a logic concept (how you
interpret it). There's a specific Maven module, called nbm-application,
that creates an application out of a set of modules (that can be both
remotely available on a repository and part of your project). You use it
when you need to create an application. If your project is just a set of
reusable modules, so you don't create an application, then you don't
have that special nbm-application module and your RCP Maven project is
just very similar to a JSE Maven project; you just tell Maven to produce
nbm files instead of jars and need to declare some extra information
such as public packages. In contrast, with Ant we have build-impl.xml
for JSE projects and the RCP harness for RCP project. With Maven you get
rid of the harness, basically.

This is of course very in short, but it's the basic point. It's this
sort of "uniformation" to the same project model that convinced me to
move to Maven.
> Also, under ant, placing native libs in the release directory would
> allow them to be packaged up and placed where they are accessible @
> runtime, how is this handled via maven?
Maven is able to deal with native libraries too. I've done it for a few
weeks to handle JOGL stuff (then I dropped it because I resolved to
using the NetBeans JOGL pack stuff, which Michael Bien is doing for us).

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/people
Fabrizio.Giudici@...