Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Build p2 update site metadata without any Eclipse installation
Build p2 update site metadata without any Eclipse installation [message #762779] Thu, 08 December 2011 10:59 Go to next message
Jens von Pilgrim is currently offline Jens von Pilgrim
Messages: 292
Registered: July 2009
Senior Member
Hi all,

I'm trying to write an ant build script for building an Eclipse update
site. Unfortunately, there are some constraints preventing me to use
some common solutions (such as the p2 ant tasks, Buckminster, or Maven
Tycho).

Actually, the update site is already working (http://lwjgl.org/update).
It is the update site for the Eclipse plugin of the OpenGL wrapper
library LWJGL. Since the LWJGL project is not an Eclipse related
project, there is no Eclipse stuff involved in the LWJGL build system --
and we do not want to add any Eclipse dependencies there, as some people
using or developing LWJGL do not use Eclipse. The LWJGL plugin is an
add-on, and maintaining an Eclipse update site is a nice extra feature
friendly provided by the LWJGL team.

At the moment, the LWJGL plugin basically consists of the LWJGL library,
bundled into an Eclipse plugin. Additionally, I have written some small
plugins for providing a test and info view (to see if LWJGL is working),
plugins for source code and documentation, and a small tool plugin
simplifying pure LWJGL development with Eclipse. Since these plugins
rarely change, the current strategy for building the update site is as
follows: The overall LWJGL build script (ant) creates a new LWJGL
distribution. Then, this distribution is used by a second ant script,
assembling Eclipse plugins from the newly created distribution. The
necessary code for the Eclipse plugins, features, and even the update
site exists as kind of skeletons which are then merged with the latest
LWJGL version. The Eclipse related classes are precompiled (and
contained in the SVN), so no Eclipse installation is required for
building the update site. I have written some ant tasks in order to
automatically create the site.xml file.

Now I'm trying to use this update site in combination with Tycho in
order to create a build script for the Eclipse GEF3D. Unfortunately,
Tycho requires content.xml/jar and artifacts.xml/jar to be provided by
the p2 repository.

Unless there is a way to make Tycho work with an old update site, I'd
need a solution for generating these files without any Eclipse
installation available at build time (in order to provide these files at
the LWJGL update site). (And no, Maven is not available either).

Unfortunately, the p2.publish.* ant tasks require an Eclipse
installation. However, since all information is provided by the update
site as it is, it should be possible to make a simple script or ant task
basically creating a content.xml and artifact.xml from existing plugins,
features, and site.xml as already present in an "old" update site.

Before I start writing a new ant task myself, I was wondering if there
already exists a solution to that problem. Or, maybe there exists
another solution by attacking this problem from a different direction.

Cheers,

Jens
Re: Build p2 update site metadata without any Eclipse installation [message #762856 is a reply to message #762779] Thu, 08 December 2011 13:02 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2492
Registered: July 2009
Senior Member
p2 has an API which at as far as I know, it does not require Eclipse,
but it requires OSGi. Publishing is another matter, what p2 is capable
of publishing is related to Eclipse type artifacts.

If you try to do this by writing XML you can make it work, but the
document formats are not API, nor are the other special files that are
part of a particular implementation of a type of p2 repository.

The solution I know best is to use Buckminster. It would enable you to
run a small headless configuration that outputs the p2 site with all the
required stuff in place, and you do not have to maintain all the magic.

By not using Buckminster, or Tycho (there some others too), I suspect
you need to recreate (and maintain) a fairly large part of their
functionality.

The old style eclipse update sites can be interpreted by p2 as being a
p2 repository, but there are certain things missing in terms of meta
data. It would be far better to use the real/official publisher (as
Buckminster does), or the one maintained by Tycho.

Seems like avoiding one difficulty by creating a bigger (albeit perhaps
more familiar) one.

Just saying.
- henrik

On 2011-08-12 16:59, Jens v.P. wrote:
> Hi all,
>
> I'm trying to write an ant build script for building an Eclipse update
> site. Unfortunately, there are some constraints preventing me to use
> some common solutions (such as the p2 ant tasks, Buckminster, or Maven
> Tycho).
>
> Actually, the update site is already working (http://lwjgl.org/update).
> It is the update site for the Eclipse plugin of the OpenGL wrapper
> library LWJGL. Since the LWJGL project is not an Eclipse related
> project, there is no Eclipse stuff involved in the LWJGL build system --
> and we do not want to add any Eclipse dependencies there, as some people
> using or developing LWJGL do not use Eclipse. The LWJGL plugin is an
> add-on, and maintaining an Eclipse update site is a nice extra feature
> friendly provided by the LWJGL team.
>
> At the moment, the LWJGL plugin basically consists of the LWJGL library,
> bundled into an Eclipse plugin. Additionally, I have written some small
> plugins for providing a test and info view (to see if LWJGL is working),
> plugins for source code and documentation, and a small tool plugin
> simplifying pure LWJGL development with Eclipse. Since these plugins
> rarely change, the current strategy for building the update site is as
> follows: The overall LWJGL build script (ant) creates a new LWJGL
> distribution. Then, this distribution is used by a second ant script,
> assembling Eclipse plugins from the newly created distribution. The
> necessary code for the Eclipse plugins, features, and even the update
> site exists as kind of skeletons which are then merged with the latest
> LWJGL version. The Eclipse related classes are precompiled (and
> contained in the SVN), so no Eclipse installation is required for
> building the update site. I have written some ant tasks in order to
> automatically create the site.xml file.
>
> Now I'm trying to use this update site in combination with Tycho in
> order to create a build script for the Eclipse GEF3D. Unfortunately,
> Tycho requires content.xml/jar and artifacts.xml/jar to be provided by
> the p2 repository.
>
> Unless there is a way to make Tycho work with an old update site, I'd
> need a solution for generating these files without any Eclipse
> installation available at build time (in order to provide these files at
> the LWJGL update site). (And no, Maven is not available either).
>
> Unfortunately, the p2.publish.* ant tasks require an Eclipse
> installation. However, since all information is provided by the update
> site as it is, it should be possible to make a simple script or ant task
> basically creating a content.xml and artifact.xml from existing plugins,
> features, and site.xml as already present in an "old" update site.
>
> Before I start writing a new ant task myself, I was wondering if there
> already exists a solution to that problem. Or, maybe there exists
> another solution by attacking this problem from a different direction.
>
> Cheers,
>
> Jens
Re: Build p2 update site metadata without any Eclipse installation [message #764503 is a reply to message #762856] Mon, 12 December 2011 05:09 Go to previous messageGo to next message
Jens von Pilgrim is currently offline Jens von Pilgrim
Messages: 292
Registered: July 2009
Senior Member
Henrik,

first of all, thank you for the fast reply.

On 08.12.11 19:02, Henrik Lindberg wrote:
> p2 has an API which at as far as I know, it does not require Eclipse,
> but it requires OSGi.

It requires both, OSGi and some Eclipse/equinox stuff.

> The solution I know best is to use Buckminster. It would enable you to
> run a small headless configuration that outputs the p2 site with all the
> required stuff in place, and you do not have to maintain all the magic.

But Buckminster requires Eclipse, doesn't it?

> Seems like avoiding one difficulty by creating a bigger (albeit perhaps
> more familiar) one.

Well, I'm afraid you're right ;-) Anyway, I've written an ant task
myself, which creates the content.xml and artifact.xml files from a
given set of plugins and features. It does not require any other
libraries, especially no Eclipse or OSGi stuff is needed. It is a hack
in terms of not been generally tested, but at least it works for my
configuration (that is, it creates the very same output as the p2 tools).

Cheers,
Jens
Re: Build p2 update site metadata without any Eclipse installation [message #764596 is a reply to message #764503] Mon, 12 December 2011 08:55 Go to previous message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2492
Registered: July 2009
Senior Member
On 2011-12-12 11:09, Jens v.P. wrote:
> On 08.12.11 19:02, Henrik Lindberg wrote:
>> The solution I know best is to use Buckminster. It would enable you to
>> run a small headless configuration that outputs the p2 site with all the
>> required stuff in place, and you do not have to maintain all the magic.
>
> But Buckminster requires Eclipse, doesn't it?
>
yes, but it is headless (invoked from command line), so does not have
everything that is in the Eclipse IDE, and you can select what to
include - typically headless parts of p2, pde, jdt, and connectors for
repositories.

Regards
- henrik
Previous Topic:Plug-ins are not installed properly
Next Topic:Uninstalling feature using p2 director after feature had been updated via update site
Goto Forum:
  


Current Time: Sat Apr 19 13:13:33 EDT 2014

Powered by FUDForum. Page generated in 0.03558 seconds