We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentCore,  Processing Development Environment (PDE) › Proposal - Use Maven for build system
Pages: 1 2 
Proposal - Use Maven for build system (Read 10464 times)
Proposal - Use Maven for build system
Jan 13th, 2009, 8:47am
 
I see there's work begun to move Processing towards an Ant build and I wanted to suggest an alternative before the investment became too great to reconsider.

Maven is a build tool (and more) that is very well aligned with how Processing is assembled. It could dramatically simplify the current build and file structure as well as add some new capabilities via its extensive selection of plugins.

I've spent a few hours the past two nights and believe I've got core, dxf, net, pdf, video, serial, opengl building (i.e. all but app, for which I have a few questions). In the process I've been able to remove a number of unnecessary files and simplify the management of external dependencies.

Maven removes the need to script most of the build by allowing the developers to declare their project structure and dependencies. Maven also simplifies cross-IDE development of the code--no more direct ties to Eclipse (though I, myself, am an Eclipse user).

If there's interest in pursuing this direction I could provide a patch with my current work for folks to take a look at. In fact, I could create two patches:
* The first would simply add pom.xml (Maven configuration) files to each project without having any further impact on the codebase. This would allow devs to try out Maven to build the individual jars.
* The second would additionally remove unnecessary files in the project.

Eclipse's support for Maven is quite good via the m2eclipse plugin and I highly recommend its use with the Subclipse plugin. (I like Subversive too, but Subclipse has better integration with m2eclipse.)

I'd be happy to assist and/or answer any questions. If there's interest in this approach I'd like a blessing to pursue it, perhaps posting submissions to Bug 151 or a new one.

-jeff

Re: Proposal - Use Maven for build system
Reply #1 - Jan 16th, 2009, 5:54pm
 
Very interesting! I had the same idea a month or so ago but instead I'm using SCons (a Python-based build tool). I have core building but not app because of the ANTLR stuff. There's some trickery used in the make.sh files and I'm still not sure what the preproc.pl file does.

I say just keep hacking away at it and then submit it Smiley

Don't worry about justifying it here, do that when you're submitting it heh.
Re: Proposal - Use Maven for build system
Reply #2 - Jan 20th, 2009, 7:00am
 
I'm new to the community, so not quite sure how it operates yet. I've continued to work in this, though, and am also running into the Antlr difficulties. It was pretty much a breeze getting the other projects to build.

If I can crack the Antlr problem I'll definitely submit my work. I've got a number of observations and questions about the code in any case that could hopefully lead to some improvements.

-jeff
Re: Proposal - Use Maven for build system
Reply #3 - Jan 21st, 2009, 8:00am
 
I've succeeded in building Processing with Maven and would like to offer my work to the community, if it is welcomed. Working on the code has revealed some questions, however. Here are some of them:

* What's the purpose of preproc.pl?
* Why is there an AutoFormat class in both processing.app.tools and
processing.app.tools.format.src? Also, the latter's package
declaration doesn't match its location--is this intentional?
* What is the source of the apple.jar? What is its version?
* What is the source of QTJava.zip? What is its version?
* Why are jalopy.jar and log4j.jar nested in packages in app?
* Is there a reason .cvsignore files continue to exist in the source?
* Are there any unit tests anywhere?
* Where are the examples.zip and reference.zip generated from?

The forums have been rather quiet--is this the best place to post these types of questions?

-jeff
Re: Proposal - Use Maven for build system
Reply #4 - Jan 21st, 2009, 2:06pm
 
I found your findings interesting, although I don't use Maven (out of ignorance/lack of time to discover/lack of real need).
Personally, I just went the easy way, compiling part of Processing on Windows with Eclipse with a little help from a .bat script...

I think that providing a way to use a good, modern tool, independent of IDEs, to do the compilation is interesting. I don't know if fry & al. are interested (I guess fry is taking a well earned break from Processing after making the 1.0.1 release...) but it is probably worth giving your method/files here. Hey, I might even try it! Wink

Trying to answer some questions:
- preproc.pl: I am not a Perl guru, but it looks like it generates the part in PApplet.java that is after the "public functions for processing.core" sentence. That's to make all methods in PGraphics and PImage available directly in PApplet (which cannot inherit from them because it inherits already from Applet). Unless a new method is added (or a signature is changed), no need to touch it.
- apple.jar and QTJava.zip: my guess is that they are closed source files from Apple... QTJava is for supporting QuickTime (the video library).
- examples are reference are probably part of another process.

These are mostly (educated) guesses, I fear... :-D

Re: Proposal - Use Maven for build system
Reply #5 - Jan 22nd, 2009, 8:14am
 
I posted my patch with Maven poms to Bug 151: http://dev.processing.org/bugs/show_bug.cgi?id=151

See the text there for instructions. Looking for feedback and/or questions if anyone has any...

-jeff
Re: Proposal - Use Maven for build system
Reply #6 - Feb 7th, 2009, 8:19am
 
I've provided a new patch with Maven poms at <http://dev.processing.org/bugs/show_bug.cgi?id=151>. Still looking for feedback on a couple of things with the build before trying to tackle creating the distributions. Anybody game to try Maven out?

-jeff
Re: Proposal - Use Maven for build system
Reply #7 - Feb 11th, 2009, 6:45am
 
Nearly a month ago I posted this proposal. About a week later I posted a patch with some initial work towards building Processing with Maven. Several days ago I posted a second, quite respectable (IMHO), patch refining the build and, I think, proving the approach had merit.

I have yet to hear from any Processing devs on the matter, which I find a bit confusing. I understand busyness and open source perhaps not being one's full time job, etc. But I did hope for some minimal acknowledgment or perhaps an indication as to whether or not my overtures were welcomed.

I'd like to help and I'm not asking for anything except to know whether I'm providing something of value or if I should move along. Anybody?
Re: Proposal - Use Maven for build system
Reply #8 - Mar 3rd, 2009, 8:59pm
 
I am a Maven 2 user and would be interested in contributing to the build conversion if the powers that be are so inclined.  I have used ant and have nothing against it, but prefer Maven 2.

As a slight tangent, if people are interested in using Maven as a tool to import into Eclipse and package their sketches, here are some notes that may be useful:

http://confluence.gordonturner.ca/display/NOTES/Processing+Notes
Re: Proposal - Use Maven for build system
Reply #9 - Mar 4th, 2009, 7:24pm
 
It doesn't sound like the devs are open to using Maven instead of Ant, but if you want to try out my poms you can get the patch at <http://dev.processing.org/bugs/show_bug.cgi?id=1154>. Perhaps post your experience report here.

You should find that everything builds correctly but the preproc.pl feature of the current build is not replicated (though Hansi and I have explored it and have some ideas). Also, this builds the Processing jars but doesn't create distributions. I've done some research here but was waiting to get feedback before committing the effort.

If you haven't tried the m2eclipse and subclipse plugins I highly recommend you try them out. Instead of typing mvn eclipse:eclipse (never again!) to generate your metadata m2eclipse will register a builder to dynamically manage your classpath.

If you have any questions, let me know.
Re: Proposal - Use Maven for build system
Reply #10 - Mar 4th, 2009, 8:09pm
 
I use subclipse regularly, a great tool, but to most of my maven activities from the command line.

I understand that m2eclipse means I don't have to run the eclipse:eclipse goal, which is a nice touch.

<aside>
My experience has been that I setup the dependencies / create .project and .classpath files once, with minor tweaks later on.  Old habits I guess, I am a command line guy Smiley
</aside>

I am vacation for the next week, but will check out your scripts when I get back.

I really like the 'Export' and 'Export Application' features of Processing, very user friendly, I wish more IDEs where like this.

Selfishly, I would also like to see a 'To Maven' check box in the 'Export Application'.  Ideally, complete with a maven pom.xml created with the jar-with-dependencies part of the mvn install goal, to aide with the distribution.

Of course similarly a 'To Ant' check box could be create if the interest is there Smiley

G.
Re: Proposal - Use Maven for build system
Reply #11 - Mar 15th, 2009, 11:54pm
 
Thanks for your work, guys.  I'll have to look at this.
Re: Proposal - Use Maven for build system
Reply #12 - Mar 20th, 2009, 4:24am
 
Hi.

I've deployed core.jar and OSGi-fied version of processing core to our repositoy:

http://cytoscape.wodaklab.org/nexus/content/repositories/releases/

http://cytoscape.wodaklab.org/nexus/content/repositories/snapshots/

You can use them on both plain-java environment and OSGi framework.

Regular jar
<dependency>
 <groupId>org.processing</groupId>
 <artifactId>core</artifactId>
 <version>1.0.3</version>
</dependency>


OSGi version:
<dependency>
 <groupId>org.cytoscape</groupId>
 <artifactId>processing-core-osgi</artifactId>
 <version>1.0.3-SNAPSHOT</version>
</dependency>

Thanks.
Kei
Re: Proposal - Use Maven for build system
Reply #13 - Mar 20th, 2009, 5:37am
 
Keiichiro Ono wrote on Mar 20th, 2009, 4:24am:
Hi.

I've deployed core.jar and OSGi-fied version of processing core to our repositoy:

<snip />

Thanks.
Kei


Fantastic! Did you use the Maven build to create the artifacts If so, any trouble

-jeff
Re: Proposal - Use Maven for build system
Reply #14 - Mar 20th, 2009, 3:16pm
 
Hi Jeff.

For now, I've just deployed latest version of the core binary to our project repository.  I'm planning to use Maven and Processing+OpenGL lib in our future project, so I'll try to make a workflow to deploy latest version of those from source.

Also, since our system (cytoscape.org) uses OSGi framework, I'll try to deploy both "classic JAR" and OSGi bundles.

Kei
Pages: 1 2