Friday, April 16, 2010

Build XULRunner Eclipse p2 Repo with Tycho

Prerequisites

  • Maven 3.0.0.alpha7
  • Scala
  • Subversive command line client
  • Java SE 1.5+

Environment used to write this article

eskimo@desktop:~/Projects/jbt-xulrunner$ ~/Java/apache-maven-3.0-alpha-7/bin/mvn -v
Apache Maven 3.0-alpha-7 (r921173; 2010-03-09 14:31:07-0800)
Java version: 1.6.0_0
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.31-21-generic-pae" arch: "i386" Family: "unix"

It is very simple process because Tycho does all work for you. All you need is to follow simple steps below.

Create separate folder for XULRunner build and make it current

eskimo@desktop:~/Projects$ mkdir jbt-xulrunner
eskimo@desktop:~/Projects$ cd jbt-xulrunner

Checkout XULRunner component from JBoss Tools Subversion repository. You need to use modular_build branch. It is temporary branch that is going to be merged to trunk next week, but I think it will stay here for a while after merge is happened.

First root only should be checked out from branch to avoid pulling out whole gigantic repository.

eskimo@desktop:~/Projects/jbt-xulrunner$ svn co --depth=files https://anonsvn.jboss.org/repos/jbosstools/branches/modular_build .

Then the same should be done for xulrunner component

eskimo@desktop:~/Projects/jbt-xulrunner$ svn co https://anonsvn.jboss.org/repos/jbosstools/branches/modular_build/xulrunner

After steps above it gets us to the JBoss Tools repository structure but with the only component.

Next step is pom.xml files generation, because this branch contains only parent-pom.xml in root. Scala is used to do it.

eskimo@desktop:~/Projects/jbt-xulrunner$ scala genpom.scala
Generate Agg for ./xulrunner
Modules: 8 Aggregator: 4

Now working copy is ready to build XULRunner Eclipse Feature and generate p2-repo for it. Make sure you are using maven3.

eskimo@desktop:~/Projects/jbt-xulrunner$ mvn install

In the end it should look like

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] trunk ............................................. SUCCESS [0.639s]
[INFO] xulrunner.all ..................................... SUCCESS [0.034s]
[INFO] xulrunner.plugins ................................. SUCCESS [0.006s]
[INFO] org.mozilla.xulrunner.cocoa.macosx ................ SUCCESS [5.637s]
[INFO] org.mozilla.xulrunner.gtk.linux.x86 ............... SUCCESS [3.595s]
[INFO] org.mozilla.xpcom ................................. SUCCESS [0.455s]
[INFO] org.mozilla.xulrunner.win32.win32.x86 ............. SUCCESS [3.238s]
[INFO] org.mozilla.xulrunner.gtk.linux.x86_64 ............ SUCCESS [4.083s]
[INFO] org.mozilla.xulrunner.carbon.macosx ............... SUCCESS [3.721s]
[INFO] site.all .......................................... SUCCESS [0.203s]
[INFO] org.mozilla.xulrunner.feature ..................... SUCCESS [0.563s]
[INFO] org.mozilla.xpcom.feature ......................... SUCCESS [0.571s]
[INFO] org.mozilla.xulrunner.site ........................ SUCCESS [4.045s]
[INFO] xulrunner.features ................................ SUCCESS [0.024s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:03.643s
[INFO] Finished at: Fri Apr 16 10:18:01 PDT 2010
[INFO] Final Memory: 89M/195M
[INFO] ------------------------------------------------------------------------

After that XULRunner Feature can be installed using p2repo from

xulrunner/site/org.mozilla.xulrunner.site/target/site

It should look in Eclipse Update dialog like on images below

No comments:

Post a Comment