summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-12-10 23:28:06 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-12-10 23:28:06 +0100
commitadad909e9a30f984e42ef8cb530cd2ff134c9908 (patch)
tree085ae7319b23d5de52a5c21edf1641d777cbe9c7
parent403b9b00307ce178f9b1fdbe9353be246c3bd6dd (diff)
[build] Generating a p2 update site
-rw-r--r--build/build.xml94
-rw-r--r--build/site.xml8
2 files changed, 97 insertions, 5 deletions
diff --git a/build/build.xml b/build/build.xml
index 84676e8..d62ee61 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -150,13 +150,19 @@
depends="init-env-ooo2, init-env-ooo3, core.init-env, java.init-env, cpp.init-env">
<property name="package.prefix" value="org.openoffice.ide.eclipse"/>
- <property name="out.path" value="../site" />
+ <property name="out.path" value="${basedir}/../site" />
<condition property="debug" value="false">
<not>
<isset property="debug"/>
</not>
</condition>
+ <path id="eclipse.classpath">
+ <fileset dir="${eclipse.home}/plugins">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
<mkdir dir="${out.path}" />
<mkdir dir="${out.path}/plugins" />
<mkdir dir="${out.path}/features" />
@@ -233,9 +239,49 @@
<target name="features" depends="core.feature, versions, java.feature, cpp.feature"/>
<target name="plugins" depends="core.plugin, java.plugin, cpp.plugin"/>
+ <macrodef name="equinoxLauncher">
+ <attribute name="application"/>
+ <element name="args"/>
+ <sequential>
+ <java classname="org.eclipse.equinox.launcher.Main"
+ classpathref="eclipse.classpath"
+ failonerror="true"
+ logerror="true"
+ fork="true"
+ newenvironment="true">
+ <arg value="-application"/>
+ <arg value="@{application}"/>
+ <args/>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="prepareJar">
+ <attribute name="jar"/>
+ <attribute name="outdir"/>
+ <sequential>
+ <equinoxLauncher application="org.eclipse.update.core.siteOptimizer">
+ <args>
+ <arg value="-jarProcessor"/>
+ <arg value="-verbose"/>
+ <arg value="-processAll"/>
+ <arg value="-repack"/>
+ <arg value="-outputDir"/>
+ <arg value="@{outdir}"/>
+ <arg value="@{jar}"/>
+ </args>
+ </equinoxLauncher>
+ </sequential>
+ </macrodef>
+
<target name="site" depends="init-env, plugins, features"
description="Creates the Eclipse update site">
+ <!--
+ Instructions to create the update site are coming from this page:
+ http://plosquare.blogspot.com/2009/05/migrating-eclipse-update-sites-to-p2.html
+ -->
+
<!-- Replace the versions in the site.xml -->
<copy file="site.xml"
tofile="${out.path}/site.xml" />
@@ -253,6 +299,52 @@
includes="**/plugins/*.jar" />
<mapper type="flatten" />
</copy>
+
+ <!-- Preparing the plugins for p2 update site -->
+ <echo message="Preparing the plugins for the p2 update site"/>
+ <prepareJar jar="${out.path}/plugins/${package.prefix}.packager.core_${packager.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+ <prepareJar jar="${out.path}/plugins/${package.prefix}.core_${core.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+ <prepareJar jar="${out.path}/plugins/${package.prefix}.java_${java.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+ <prepareJar jar="${out.path}/plugins/${package.prefix}.cpp_${cpp.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+
+ <!-- Generate p2's .jar.pack.gz and digest.zip -->
+ <echo message="Generating p2's .jar.pack.gz and digest.zip"/>
+ <equinoxLauncher application="org.eclipse.update.core.siteOptimizer">
+ <args>
+ <arg value="-digestBuilder"/>
+ <arg value="-digestOutputDir=${out.path}"/>
+ <arg value="-siteXML=${out.path}/site.xml"/>
+ <arg value="-jarProcessor"/>
+ <arg value="-pack"/>
+ <arg value="-outputDir"/>
+ <arg value="${out.path}"/>
+ <arg value="${out.path}"/>
+ </args>
+ </equinoxLauncher>
+
+ <!-- Generate content.jar and artifacts.jar -->
+ <equinoxLauncher application="org.eclipse.equinox.p2.metadata.generator.EclipseGenerator">
+ <args>
+ <arg value="-updateSite"/>
+ <arg value="${out.path}"/>
+ <arg value="-site"/>
+ <arg value="file:/${out.path}/site.xml"/>
+ <arg value="-metadataRepository"/>
+ <arg value="file:${out.path}/"/>
+ <arg value="-metadataRepositoryName"/>
+ <arg value="OOEclipse Update Site"/>
+ <arg value="-artifactRepository"/>
+ <arg value="file:${out.path}/"/>
+ <arg value="-artifactRepositoryName"/>
+ <arg value="OOEclipse Artifacts"/>
+ <arg value="-compress"/>
+ <arg value="-reusePack200Files"/>
+ <arg value="-noDefaultIUs"/>
+ <arg value="-vmargs"/>
+ <arg value="-Xmx256M"/>
+ </args>
+ </equinoxLauncher>
+
</target>
<target name="archive-site" description="Create a zip for the update site"
diff --git a/build/site.xml b/build/site.xml
index c89e12f..1787f9a 100644
--- a/build/site.xml
+++ b/build/site.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<site>
- <feature url="features/org.openoffice.ide.eclipse.core_1.2.0.jar" id="org.openoffice.ide.eclipse.core" version="1.2.0">
+<site pack200="true" digestURL="http://cedric.bosdonnat.free.fr/ooeclipseintegration">
+ <feature url="features/org.openoffice.ide.eclipse.core_0.0.0.core.jar" id="org.openoffice.ide.eclipse.core" version="0.0.0.core">
<category name="LibreOffice"/>
</feature>
- <feature url="features/org.openoffice.ide.eclipse.cpp_0.6.0.jar" id="org.openoffice.ide.eclipse.cpp" version="0.6.0">
+ <feature url="features/org.openoffice.ide.eclipse.cpp_0.0.0.cpp.jar" id="org.openoffice.ide.eclipse.cpp" version="0.0.0.cpp">
<category name="LibreOffice"/>
</feature>
- <feature url="features/org.openoffice.ide.eclipse.java_1.0.3.jar" id="org.openoffice.ide.eclipse.java" version="1.0.3">
+ <feature url="features/org.openoffice.ide.eclipse.java_0.0.0.java.jar" id="org.openoffice.ide.eclipse.java" version="0.0.0.java">
<category name="LibreOffice"/>
</feature>
<category-def name="LibreOffice" label="LibreOffice"/>