[ooo-build-commit] ooeclipse: Branch 'master' - 3 commits

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Aug 14 01:43:49 PDT 2012


 build/build.xml                                                                     |  145 +---
 build/features/core/feature.xml                                                     |  100 +-
 build/features/cpp/feature.xml                                                      |   94 +-
 build/features/cpp/includes.xml                                                     |    1 
 build/features/java/feature.xml                                                     |   94 +-
 build/features/java/includes.xml                                                    |    1 
 build/site-feature.xml                                                              |    3 
 build/site-footer.xml                                                               |    2 
 build/site-header.xml                                                               |    2 
 build/site.xml                                                                      |   13 
 core/build.xml                                                                      |   22 
 core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java              |    7 
 core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java         |   33 
 core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java                 |  359 ++++++----
 core/source/org/openoffice/ide/eclipse/core/internal/model/RelativeFileLocator.java |   73 ++
 core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java                 |   12 
 core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java       |    7 
 core/source/org/openoffice/ide/eclipse/core/internal/model/messages.properties      |    1 
 core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java |    6 
 core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java                  |    1 
 core/source/org/openoffice/ide/eclipse/core/model/description/DescriptionModel.java |    8 
 cpp/build.xml                                                                       |   25 
 java/.classpath                                                                     |    1 
 java/build.xml                                                                      |   19 
 java/source/org/openoffice/ide/eclipse/java/JavaDebugExtraOptionsProvider.java      |   13 
 java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java                 |  213 +++--
 packager/build.xml                                                                  |  111 +++
 packager/build/build.properties                                                     |    1 
 packager/build/build.xml                                                            |   98 --
 29 files changed, 871 insertions(+), 594 deletions(-)

New commits:
commit 82120be1fb1668fb7e11d375c845030438f8837f
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Aug 14 10:41:31 2012 +0200

    Fixed update site build

diff --git a/build/build.xml b/build/build.xml
index d62ee61..f110896 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -72,7 +72,7 @@
 	
 	<target name="check-ooo-version">
         
-		<property name="office.linux.basis.dir" value="${openoffice.home}${file.separator}basis-link"/>
+		<property name="office.linux.basis.dir" value="${openoffice.home}"/>
         <property name="office.linux.ure.dir" value="${office.linux.basis.dir}${file.separator}ure-link"/>
 		
 		<!-- Needed due to some differences between Windows and Linux installs -->
@@ -150,6 +150,7 @@
 		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"/>
 		
+        <dirname property="build.basedir" file="${ant.file.ooeclipseintegration}"/>
 		<property name="out.path" value="${basedir}/../site" />
 		<condition property="debug" value="false">
 			<not>
@@ -165,7 +166,7 @@
 		
 		<mkdir dir="${out.path}" />
 		<mkdir dir="${out.path}/plugins" />
-		<mkdir dir="${out.path}/features" />
+        <mkdir dir="${out.path}/features" />
 	</target>
 	
 	<target name="purge" description="Cleans all the output results" 
@@ -176,16 +177,13 @@
 	
 	<target name="versions" depends="core.version, java.version, cpp.version" />
 	
-	<target name="core.feature" depends="versions">
-		<!-- Replace the 0.0.0.* tokens to create the feature.xml file  -->
+	<target name="core.feature" depends="versions, java.feature, cpp.feature">
 		<copy file="features/core/feature.xml"
-			tofile="${out.path}/features/feature.xml" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.core" value="${core.Bundle-Version}" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.java" value="${java.Bundle-Version}" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.cpp" value="${cpp.Bundle-Version}" />
+            tofile="${out.path}/features/feature.xml">
+            <filterchain>
+                <expandproperties/>
+            </filterchain>
+        </copy>
 		
 		<jar destfile="${out.path}/features/${package.prefix}.core_${core.Bundle-Version}.jar">
 			<zipfileset dir="${out.path}/features" prefix="" defaultexcludes="true">
@@ -195,48 +193,69 @@
 			
 		<delete file="${out.path}/features/feature.xml"/>
 	</target>
-	
-	<target name="java.feature" depends="versions">
-		<!-- Replace the 0.0.0.* tokens to create the feature.xml file  -->
+
+    <target name="java.feature.nobuild" if="java.nobuild">
+        <property name="includes.java" value=""/>
+    </target>
+
+	<target name="java.feature.build" depends="versions" unless="java.nobuild">
 		<copy file="features/java/feature.xml"
-			tofile="${out.path}/features/feature.xml" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.core" value="${core.Bundle-Version}" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.java" value="${java.Bundle-Version}" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.cpp" value="${cpp.Bundle-Version}" />
+			tofile="${out.path}/features/feature.xml">
+            <filterchain>
+                <expandproperties/>
+            </filterchain>
+        </copy>
 		
 		<jar destfile="${out.path}/features/${package.prefix}.java_${java.Bundle-Version}.jar">
 			<zipfileset dir="${out.path}/features" prefix="" defaultexcludes="true">
 				<include name="feature.xml"/>
 			</zipfileset>
-		</jar>
+        </jar>
+
+        <loadfile property="includes.java"
+            srcfile="features/java/includes.xml">
+            <filterchain>
+                <expandproperties/>
+            </filterchain>
+        </loadfile>
+        <echo>${includes.java}</echo>
 			
 		<delete file="${out.path}/features/feature.xml"/>
-	</target>
-	
-	<target name="cpp.feature" depends="versions">
-		<!-- Replace the 0.0.0.* tokens to create the feature.xml file  -->
+    </target>
+
+    <target name="java.feature" depends="java.feature.build, java.feature.nobuild"/>
+
+    <target name="cpp.feature.nobuild" if="cpp.nobuild">
+        <property name="includes.cpp" value="" />
+    </target>
+
+	<target name="cpp.feature.build" depends="versions" unless="cpp.nobuild">
 		<copy file="features/cpp/feature.xml"
-			tofile="${out.path}/features/feature.xml" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.core" value="${core.Bundle-Version}" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.java" value="${java.Bundle-Version}" />
-		<replace file="${out.path}/features/feature.xml" 
-			token="0.0.0.cpp" value="${cpp.Bundle-Version}" />
+            tofile="${out.path}/features/feature.xml">
+            <filterchain>
+                <expandproperties/>
+            </filterchain>
+        </copy>
 		
 		<jar destfile="${out.path}/features/${package.prefix}.cpp_${cpp.Bundle-Version}.jar">
 			<zipfileset dir="${out.path}/features" prefix="" defaultexcludes="true">
 				<include name="feature.xml"/>
 			</zipfileset>
 		</jar>
+
+        <loadfile property="includes.cpp"
+            srcfile="features/cpp/includes.xml">
+            <filterchain>
+                <expandproperties/>
+            </filterchain>
+        </loadfile>
 			
 		<delete file="${out.path}/features/feature.xml"/>
-	</target>
+    </target>
+
+    <target name="cpp.feature" depends="cpp.feature.build, cpp.feature.nobuild"/>
 	
-	<target name="features" depends="core.feature, versions, java.feature, cpp.feature"/>
+	<target name="features" depends="versions, java.feature, cpp.feature, core.feature"/>
 	<target name="plugins" depends="core.plugin, java.plugin, cpp.plugin"/>
 	
 	<macrodef name="equinoxLauncher">
@@ -274,7 +293,7 @@
 		</sequential>
 	</macrodef>
 	
-	<target name="site" depends="init-env, plugins, features"
+	<target name="site" depends="init-env, plugins, features, core.site, java.site, cpp.site"
 		description="Creates the Eclipse update site">
 		
 		<!-- 
@@ -282,30 +301,17 @@
 		  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" />
-   		<replace file="${out.path}/site.xml"
-			token="0.0.0.core" value="${core.Bundle-Version}" />
-		<replace file="${out.path}/site.xml"
-			token="0.0.0.java" value="${java.Bundle-Version}" />
-		<replace file="${out.path}/site.xml"
-			token="0.0.0.cpp" value="${cpp.Bundle-Version}" />
-		
-		<!-- Copying the plugins -->
-		<echo message="Copying the plugins JARs"/>
-		<copy todir="${out.path}/plugins">
-			<fileset dir=".." 
-				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"/>
+		<!-- Create site.xml -->
+        <concat destfile="${out.path}/site.xml" binary="true">
+            <path path="site-header.xml"/>
+            <fileset dir="${out.path}" includes="site-*.xml"/>
+            <path path="site-footer.xml"/>
+        </concat> 
+
+        <!-- Remove the site-*.xml fragments -->
+        <delete>
+            <fileset dir="${out.path}" includes="site-*.xml"/>
+        </delete>
 		
 		<!-- Generate p2's .jar.pack.gz and digest.zip -->
 		<echo message="Generating p2's .jar.pack.gz and digest.zip"/>
@@ -323,25 +329,16 @@
 		</equinoxLauncher>
 		
 		<!-- Generate content.jar and artifacts.jar -->
-		<equinoxLauncher application="org.eclipse.equinox.p2.metadata.generator.EclipseGenerator">
+		<equinoxLauncher application="org.eclipse.equinox.p2.publisher.UpdateSitePublisher">
 			<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="file:${out.path}/"/>
 				<arg value="-artifactRepository"/>
 				<arg value="file:${out.path}/"/>
-				<arg value="-artifactRepositoryName"/>
-				<arg value="OOEclipse Artifacts"/>
+				<arg value="-source"/>
+				<arg value="${out.path}"/>
 				<arg value="-compress"/>
-				<arg value="-reusePack200Files"/>
-				<arg value="-noDefaultIUs"/>
-				<arg value="-vmargs"/>
-				<arg value="-Xmx256M"/>
+				<arg value="-publishArtifacts"/>
 			</args>
 		</equinoxLauncher>
 		
diff --git a/build/features/core/feature.xml b/build/features/core/feature.xml
index e2a00f4..f30ef6d 100644
--- a/build/features/core/feature.xml
+++ b/build/features/core/feature.xml
@@ -1,15 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.openoffice.ide.eclipse.core"
-      label="LibreOffice development plugin core"
-      version="0.0.0.core"
-      provider-name="Cédric Bosdonnat"
-      plugin="org.openoffice.ide.eclipse.core">
-
-   <description>
+<feature id="org.openoffice.ide.eclipse.core" label="LibreOffice development plugin core" version="${core.Bundle-Version}" provider-name="Cédric Bosdonnat" plugin="org.openoffice.ide.eclipse.core">
+  <description>
       Tool to support LibreOffice development using Eclipse. It
 provides two editors for UNO-IDL file edition and registry files
-viewing. The plugin helps the user to write it's UNO-IDL file
+viewing. The plugin helps the user to write it's UNO-IDL file
 with syntax highlighting and some wizards, it although generates
 the type registries. 
 
@@ -27,12 +21,10 @@ features to add and bugs to correct, please do not hesitate to
 express your remarks and requests on the LibreOffice development 
 mailing list.
    </description>
-
-   <copyright>
+  <copyright>
       Copyright: (c) 2005-2010 Cedric Bosdonnat
    </copyright>
-
-   <license url="http://www.gnu.org/licenses/lgpl.txt">
+  <license url="http://www.gnu.org/licenses/lgpl.txt">
       GNU LESSER GENERAL PUBLIC LICENSE
 Version 3, 29 June 2007
 Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/
@@ -42,24 +34,24 @@ This version of the GNU Lesser General Public License incorporates
 the terms and conditions of version 3 of the GNU General Public
 License, supplemented by the additional permissions listed below.
 0. Additional Definitions.
-As used herein, "this License" refers to version 3 of the GNU
-Lesser General Public License, and the "GNU GPL" refers to version 3
+As used herein, "this License" refers to version 3 of the GNU
+Lesser General Public License, and the "GNU GPL" refers to version 3
 of the GNU General Public License.
-"The Library" refers to a covered work governed by this License,
+"The Library" refers to a covered work governed by this License,
 other than an Application or a Combined Work as defined below.
-An "Application" is any work that makes use of an interface provided
+An "Application" is any work that makes use of an interface provided
 by the Library, but which is not otherwise based on the Library.
 Defining a subclass of a class defined by the Library is deemed
 a mode of using an interface provided by the Library.
-A "Combined Work" is a work produced by combining or linking
+A "Combined Work" is a work produced by combining or linking
 an Application with the Library.  The particular version of the
-Library with which the Combined Work was made is also called the "Linked
-Version".
-The "Minimal Corresponding Source" for a Combined Work means
+Library with which the Combined Work was made is also called the "Linked
+Version".
+The "Minimal Corresponding Source" for a Combined Work means
 the Corresponding Source for the Combined Work, excluding any source
 code for portions of the Combined Work that, considered in isolation,
 are based on the Application, and not on the Linked Version.
-The "Corresponding Application Code" for a Combined Work means
+The "Corresponding Application Code" for a Combined Work means
 the object code and/or source code for the Application, including
 any data and utility programs needed for reproducing the Combined Work
 from the Application, but excluding the System Libraries of the Combined
@@ -116,7 +108,7 @@ manner specified by section 6 of the GNU GPL for conveying
 Corresponding Source.
 1) Use a suitable shared library mechanism for linking with the
 Library.  A suitable mechanism is one that (a) uses at run time
-a copy of the Library already present on the user's computer
+a copy of the Library already present on the user's computer
 system, and (b) will operate properly with a modified version
 of the Library that is interface-compatible with the Linked
 Version.
@@ -150,7 +142,7 @@ new versions will be similar in spirit to the present version, but
 may differ in detail to address new problems or concerns.
 Each version is given a distinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later version"
+version of the GNU Lesser General Public License "or any later version"
 applies to it, you have the option of following the terms and
 conditions either of that published version or of any later version
 published by the Free Software Foundation. If the Library as
@@ -159,7 +151,7 @@ General Public License, you may choose any version of the GNU
 Lesser General Public License ever published by the Free Software Foundation.
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public License
-shall apply, that proxy's public statement of acceptance of any version
+shall apply, that proxy's public statement of acceptance of any version
 is permanent authorization for you to choose that version for the
 Library.
 GNU LESSER GENERAL PUBLIC LICENSE
@@ -171,25 +163,25 @@ This version of the GNU Lesser General Public License incorporates
 the terms and conditions of version 3 of the GNU General Public
 License, supplemented by the additional permissions listed below.
 0. Additional Definitions.
-As used herein, "this License" refers to version 3 of the GNU
-Lesser General Public License, and the "GNU GPL" refers to 
+As used herein, "this License" refers to version 3 of the GNU
+Lesser General Public License, and the "GNU GPL" refers to 
 version 3 of the GNU General Public License.
-"The Library" refers to a covered work governed by this License,
+"The Library" refers to a covered work governed by this License,
 other than an Application or a Combined Work as defined below.
-An "Application" is any work that makes use of an interface provided
+An "Application" is any work that makes use of an interface provided
 by the Library, but which is not otherwise based on the Library.
 Defining a subclass of a class defined by the Library is deemed
 a mode of using an interface provided by the Library.
-A "Combined Work" is a work produced by combining or linking
+A "Combined Work" is a work produced by combining or linking
 an Application with the Library.  The particular version of the
 Library with which the Combined Work was made is also called the 
-"Linked Version".
-The "Minimal Corresponding Source" for a Combined Work means
+"Linked Version".
+The "Minimal Corresponding Source" for a Combined Work means
 the Corresponding Source for the Combined Work, excluding any 
 source code for portions of the Combined Work that, considered 
 in isolation, are based on the Application, and not on the 
 Linked Version.
-The "Corresponding Application Code" for a Combined Work means
+The "Corresponding Application Code" for a Combined Work means
 the object code and/or source code for the Application, 
 including any data and utility programs needed for reproducing 
 the Combined Work from the Application, but excluding the System
@@ -247,7 +239,7 @@ manner specified by section 6 of the GNU GPL for conveying
 Corresponding Source.
 1) Use a suitable shared library mechanism for linking with the
 Library.  A suitable mechanism is one that (a) uses at run time
-a copy of the Library already present on the user's computer
+a copy of the Library already present on the user's computer
 system, and (b) will operate properly with a modified version
 of the Library that is interface-compatible with the Linked
 Version.
@@ -306,8 +298,8 @@ new versions will be similar in spirit to the present version,
 but may differ in detail to address new problems or concerns.
 Each version is given a distinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later
-version" applies to it, you have the option of following the
+version of the GNU Lesser General Public License "or any later
+version" applies to it, you have the option of following the
 terms and conditions either of that published version or of 
 any later version published by the Free Software Foundation.
 If the Library as you received it does not specify a version
@@ -316,11 +308,11 @@ any version of the GNU Lesser General Public License ever
 published by the Free Software Foundation. 
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public
-License shall apply, that proxy's public statement of acceptance
+License shall apply, that proxy's public statement of acceptance
 of any version is permaneinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later
-version" applies to it, you have the option of following the
+version of the GNU Lesser General Public License "or any later
+version" applies to it, you have the option of following the
 terms and conditions either of that published version or of 
 any later version published by the Free Software Foundation.
 If the Library as you received it does not specify a version
@@ -329,30 +321,14 @@ any version of the GNU Lesser General Public License ever
 published by the Free Software Foundation. 
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public
-License shall apply, that proxy's public statement of acceptance
+License shall apply, that proxy's public statement of acceptance
 of any version is permanent authorization for you to choose that
 version for the Library.
    </license>
-
-   <url>
-      <update label="LibreOffice Plugin update site" url="http://cedric.bosdonnat.free.fr/ooeclipseintegration"/>
-   </url>
-
-   <includes
-         id="org.openoffice.ide.eclipse.java"
-         version="0.0.0.java"
-         optional="true"/>
-
-   <includes
-         id="org.openoffice.ide.eclipse.cpp"
-         version="0.0.0.cpp"
-         optional="true"/>
-
-   <plugin
-         id="org.openoffice.ide.eclipse.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0.core"
-         unpack="false"/>
-
+  <url>
+    <update label="LibreOffice Plugin update site" url="http://cedric.bosdonnat.free.fr/ooeclipseintegration"/>
+  </url>
+  ${includes.java}
+  ${includes.cpp}
+  <plugin id="org.openoffice.ide.eclipse.core" download-size="0" install-size="0" version="${core.Bundle-Version}" unpack="false"/>
 </feature>
diff --git a/build/features/cpp/feature.xml b/build/features/cpp/feature.xml
index f900869..f6427ed 100644
--- a/build/features/cpp/feature.xml
+++ b/build/features/cpp/feature.xml
@@ -1,11 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.openoffice.ide.eclipse.cpp"
-      label="LibreOffice development plugin support for C++ implementation"
-      version="0.0.0.cpp"
-      provider-name="Cédric Bosdonnat">
-
-   <description>
+<feature id="org.openoffice.ide.eclipse.cpp" label="LibreOffice development plugin support for C++ implementation" version="${cpp.Bundle-Version}" provider-name="Cédric Bosdonnat">
+  <description>
       This plugin provides the support of Java implementation for LibreOffice
 component development. This plugin depends on the LibreOffice development
 core plugin.
@@ -15,12 +10,10 @@ features to add and bugs to correct, please do not hesitate to
 express your remarks and requests on the LibreOffice development
 mailing list.
    </description>
-
-   <copyright>
+  <copyright>
       Copyright: (c) 2005-2010 Cedric Bosdonnat
    </copyright>
-
-   <license url="http://www.gnu.org/licenses/lgpl.txt">
+  <license url="http://www.gnu.org/licenses/lgpl.txt">
       GNU LESSER GENERAL PUBLIC LICENSE
 Version 3, 29 June 2007
 Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/
@@ -30,24 +23,24 @@ This version of the GNU Lesser General Public License incorporates
 the terms and conditions of version 3 of the GNU General Public
 License, supplemented by the additional permissions listed below.
 0. Additional Definitions.
-As used herein, "this License" refers to version 3 of the GNU
-Lesser General Public License, and the "GNU GPL" refers to version 3
+As used herein, "this License" refers to version 3 of the GNU
+Lesser General Public License, and the "GNU GPL" refers to version 3
 of the GNU General Public License.
-"The Library" refers to a covered work governed by this License,
+"The Library" refers to a covered work governed by this License,
 other than an Application or a Combined Work as defined below.
-An "Application" is any work that makes use of an interface provided
+An "Application" is any work that makes use of an interface provided
 by the Library, but which is not otherwise based on the Library.
 Defining a subclass of a class defined by the Library is deemed
 a mode of using an interface provided by the Library.
-A "Combined Work" is a work produced by combining or linking
+A "Combined Work" is a work produced by combining or linking
 an Application with the Library.  The particular version of the
-Library with which the Combined Work was made is also called the "Linked
-Version".
-The "Minimal Corresponding Source" for a Combined Work means
+Library with which the Combined Work was made is also called the "Linked
+Version".
+The "Minimal Corresponding Source" for a Combined Work means
 the Corresponding Source for the Combined Work, excluding any source
 code for portions of the Combined Work that, considered in isolation,
 are based on the Application, and not on the Linked Version.
-The "Corresponding Application Code" for a Combined Work means
+The "Corresponding Application Code" for a Combined Work means
 the object code and/or source code for the Application, including
 any data and utility programs needed for reproducing the Combined Work
 from the Application, but excluding the System Libraries of the Combined
@@ -104,7 +97,7 @@ manner specified by section 6 of the GNU GPL for conveying
 Corresponding Source.
 1) Use a suitable shared library mechanism for linking with the
 Library.  A suitable mechanism is one that (a) uses at run time
-a copy of the Library already present on the user's computer
+a copy of the Library already present on the user's computer
 system, and (b) will operate properly with a modified version
 of the Library that is interface-compatible with the Linked
 Version.
@@ -138,7 +131,7 @@ new versions will be similar in spirit to the present version, but
 may differ in detail to address new problems or concerns.
 Each version is given a distinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later version"
+version of the GNU Lesser General Public License "or any later version"
 applies to it, you have the option of following the terms and
 conditions either of that published version or of any later version
 published by the Free Software Foundation. If the Library as
@@ -147,7 +140,7 @@ General Public License, you may choose any version of the GNU
 Lesser General Public License ever published by the Free Software Foundation.
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public License
-shall apply, that proxy's public statement of acceptance of any version
+shall apply, that proxy's public statement of acceptance of any version
 is permanent authorization for you to choose that version for the
 Library.
 GNU LESSER GENERAL PUBLIC LICENSE
@@ -159,25 +152,25 @@ This version of the GNU Lesser General Public License incorporates
 the terms and conditions of version 3 of the GNU General Public
 License, supplemented by the additional permissions listed below.
 0. Additional Definitions.
-As used herein, "this License" refers to version 3 of the GNU
-Lesser General Public License, and the "GNU GPL" refers to 
+As used herein, "this License" refers to version 3 of the GNU
+Lesser General Public License, and the "GNU GPL" refers to 
 version 3 of the GNU General Public License.
-"The Library" refers to a covered work governed by this License,
+"The Library" refers to a covered work governed by this License,
 other than an Application or a Combined Work as defined below.
-An "Application" is any work that makes use of an interface provided
+An "Application" is any work that makes use of an interface provided
 by the Library, but which is not otherwise based on the Library.
 Defining a subclass of a class defined by the Library is deemed
 a mode of using an interface provided by the Library.
-A "Combined Work" is a work produced by combining or linking
+A "Combined Work" is a work produced by combining or linking
 an Application with the Library.  The particular version of the
 Library with which the Combined Work was made is also called the 
-"Linked Version".
-The "Minimal Corresponding Source" for a Combined Work means
+"Linked Version".
+The "Minimal Corresponding Source" for a Combined Work means
 the Corresponding Source for the Combined Work, excluding any 
 source code for portions of the Combined Work that, considered 
 in isolation, are based on the Application, and not on the 
 Linked Version.
-The "Corresponding Application Code" for a Combined Work means
+The "Corresponding Application Code" for a Combined Work means
 the object code and/or source code for the Application, 
 including any data and utility programs needed for reproducing 
 the Combined Work from the Application, but excluding the System
@@ -235,7 +228,7 @@ manner specified by section 6 of the GNU GPL for conveying
 Corresponding Source.
 1) Use a suitable shared library mechanism for linking with the
 Library.  A suitable mechanism is one that (a) uses at run time
-a copy of the Library already present on the user's computer
+a copy of the Library already present on the user's computer
 system, and (b) will operate properly with a modified version
 of the Library that is interface-compatible with the Linked
 Version.
@@ -294,8 +287,8 @@ new versions will be similar in spirit to the present version,
 but may differ in detail to address new problems or concerns.
 Each version is given a distinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later
-version" applies to it, you have the option of following the
+version of the GNU Lesser General Public License "or any later
+version" applies to it, you have the option of following the
 terms and conditions either of that published version or of 
 any later version published by the Free Software Foundation.
 If the Library as you received it does not specify a version
@@ -304,11 +297,11 @@ any version of the GNU Lesser General Public License ever
 published by the Free Software Foundation. 
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public
-License shall apply, that proxy's public statement of acceptance
+License shall apply, that proxy's public statement of acceptance
 of any version is permaneinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later
-version" applies to it, you have the option of following the
+version of the GNU Lesser General Public License "or any later
+version" applies to it, you have the option of following the
 terms and conditions either of that published version or of 
 any later version published by the Free Software Foundation.
 If the Library as you received it does not specify a version
@@ -317,25 +310,16 @@ any version of the GNU Lesser General Public License ever
 published by the Free Software Foundation. 
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public
-License shall apply, that proxy's public statement of acceptance
+License shall apply, that proxy's public statement of acceptance
 of any version is permanent authorization for you to choose that
 version for the Library.
    </license>
-
-   <url>
-      <discovery label="LibreOffice Plugin update site" url="http://cedric.bosdonnat.free.fr/ooeclipseintegration"/>
-   </url>
-
-   <requires>
-      <import feature="org.eclipse.cdt" version="6.0.0"/>
-      <import plugin="org.openoffice.ide.eclipse.core" version="0.0.0.core"/>
-   </requires>
-
-   <plugin
-         id="org.openoffice.ide.eclipse.cpp"
-         download-size="0"
-         install-size="0"
-         version="0.0.0.cpp"
-         unpack="false"/>
-
+  <url>
+    <discovery label="LibreOffice Plugin update site" url="http://cedric.bosdonnat.free.fr/ooeclipseintegration"/>
+  </url>
+  <requires>
+    <import feature="org.eclipse.cdt" version="6.0.0"/>
+    <import plugin="org.openoffice.ide.eclipse.core" version="${core.Bundle-Version}"/>
+  </requires>
+  <plugin id="org.openoffice.ide.eclipse.cpp" download-size="0" install-size="0" version="${cpp.Bundle-Version}" unpack="false"/>
 </feature>
diff --git a/build/features/cpp/includes.xml b/build/features/cpp/includes.xml
new file mode 100644
index 0000000..1af23fb
--- /dev/null
+++ b/build/features/cpp/includes.xml
@@ -0,0 +1 @@
+  <includes id="org.openoffice.ide.eclipse.cpp" version="${cpp.Bundle-Version}" optional="true"/>
diff --git a/build/features/java/feature.xml b/build/features/java/feature.xml
index 58ccc43..aabd0f8 100644
--- a/build/features/java/feature.xml
+++ b/build/features/java/feature.xml
@@ -1,11 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<feature
-      id="org.openoffice.ide.eclipse.java"
-      label="LibreOffice development plugin support for Java implementation"
-      version="0.0.0.java"
-      provider-name="Cédric Bosdonnat">
-
-   <description>
+<feature id="org.openoffice.ide.eclipse.java" label="LibreOffice development plugin support for Java implementation" version="${java.Bundle-Version}" provider-name="Cédric Bosdonnat">
+  <description>
       This plugin provides the support of Java implementation for LibreOffice
 component development. This plugin depends on the LibreOffice development
 core plugin.
@@ -15,12 +10,10 @@ features to add and bugs to correct, please do not hesitate to
 express your remarks and requests on the LibreOffice development
 mailing list.
    </description>
-
-   <copyright>
+  <copyright>
       Copyright: (c) 2005-2010 Cedric Bosdonnat
    </copyright>
-
-   <license url="http://www.gnu.org/licenses/lgpl.txt">
+  <license url="http://www.gnu.org/licenses/lgpl.txt">
       GNU LESSER GENERAL PUBLIC LICENSE
 Version 3, 29 June 2007
 Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/
@@ -30,24 +23,24 @@ This version of the GNU Lesser General Public License incorporates
 the terms and conditions of version 3 of the GNU General Public
 License, supplemented by the additional permissions listed below.
 0. Additional Definitions.
-As used herein, "this License" refers to version 3 of the GNU
-Lesser General Public License, and the "GNU GPL" refers to version 3
+As used herein, "this License" refers to version 3 of the GNU
+Lesser General Public License, and the "GNU GPL" refers to version 3
 of the GNU General Public License.
-"The Library" refers to a covered work governed by this License,
+"The Library" refers to a covered work governed by this License,
 other than an Application or a Combined Work as defined below.
-An "Application" is any work that makes use of an interface provided
+An "Application" is any work that makes use of an interface provided
 by the Library, but which is not otherwise based on the Library.
 Defining a subclass of a class defined by the Library is deemed
 a mode of using an interface provided by the Library.
-A "Combined Work" is a work produced by combining or linking
+A "Combined Work" is a work produced by combining or linking
 an Application with the Library.  The particular version of the
-Library with which the Combined Work was made is also called the "Linked
-Version".
-The "Minimal Corresponding Source" for a Combined Work means
+Library with which the Combined Work was made is also called the "Linked
+Version".
+The "Minimal Corresponding Source" for a Combined Work means
 the Corresponding Source for the Combined Work, excluding any source
 code for portions of the Combined Work that, considered in isolation,
 are based on the Application, and not on the Linked Version.
-The "Corresponding Application Code" for a Combined Work means
+The "Corresponding Application Code" for a Combined Work means
 the object code and/or source code for the Application, including
 any data and utility programs needed for reproducing the Combined Work
 from the Application, but excluding the System Libraries of the Combined
@@ -104,7 +97,7 @@ manner specified by section 6 of the GNU GPL for conveying
 Corresponding Source.
 1) Use a suitable shared library mechanism for linking with the
 Library.  A suitable mechanism is one that (a) uses at run time
-a copy of the Library already present on the user's computer
+a copy of the Library already present on the user's computer
 system, and (b) will operate properly with a modified version
 of the Library that is interface-compatible with the Linked
 Version.
@@ -138,7 +131,7 @@ new versions will be similar in spirit to the present version, but
 may differ in detail to address new problems or concerns.
 Each version is given a distinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later version"
+version of the GNU Lesser General Public License "or any later version"
 applies to it, you have the option of following the terms and
 conditions either of that published version or of any later version
 published by the Free Software Foundation. If the Library as
@@ -147,7 +140,7 @@ General Public License, you may choose any version of the GNU
 Lesser General Public License ever published by the Free Software Foundation.
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public License
-shall apply, that proxy's public statement of acceptance of any version
+shall apply, that proxy's public statement of acceptance of any version
 is permanent authorization for you to choose that version for the
 Library.
 GNU LESSER GENERAL PUBLIC LICENSE
@@ -159,25 +152,25 @@ This version of the GNU Lesser General Public License incorporates
 the terms and conditions of version 3 of the GNU General Public
 License, supplemented by the additional permissions listed below.
 0. Additional Definitions.
-As used herein, "this License" refers to version 3 of the GNU
-Lesser General Public License, and the "GNU GPL" refers to 
+As used herein, "this License" refers to version 3 of the GNU
+Lesser General Public License, and the "GNU GPL" refers to 
 version 3 of the GNU General Public License.
-"The Library" refers to a covered work governed by this License,
+"The Library" refers to a covered work governed by this License,
 other than an Application or a Combined Work as defined below.
-An "Application" is any work that makes use of an interface provided
+An "Application" is any work that makes use of an interface provided
 by the Library, but which is not otherwise based on the Library.
 Defining a subclass of a class defined by the Library is deemed
 a mode of using an interface provided by the Library.
-A "Combined Work" is a work produced by combining or linking
+A "Combined Work" is a work produced by combining or linking
 an Application with the Library.  The particular version of the
 Library with which the Combined Work was made is also called the 
-"Linked Version".
-The "Minimal Corresponding Source" for a Combined Work means
+"Linked Version".
+The "Minimal Corresponding Source" for a Combined Work means
 the Corresponding Source for the Combined Work, excluding any 
 source code for portions of the Combined Work that, considered 
 in isolation, are based on the Application, and not on the 
 Linked Version.
-The "Corresponding Application Code" for a Combined Work means
+The "Corresponding Application Code" for a Combined Work means
 the object code and/or source code for the Application, 
 including any data and utility programs needed for reproducing 
 the Combined Work from the Application, but excluding the System
@@ -235,7 +228,7 @@ manner specified by section 6 of the GNU GPL for conveying
 Corresponding Source.
 1) Use a suitable shared library mechanism for linking with the
 Library.  A suitable mechanism is one that (a) uses at run time
-a copy of the Library already present on the user's computer
+a copy of the Library already present on the user's computer
 system, and (b) will operate properly with a modified version
 of the Library that is interface-compatible with the Linked
 Version.
@@ -294,8 +287,8 @@ new versions will be similar in spirit to the present version,
 but may differ in detail to address new problems or concerns.
 Each version is given a distinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later
-version" applies to it, you have the option of following the
+version of the GNU Lesser General Public License "or any later
+version" applies to it, you have the option of following the
 terms and conditions either of that published version or of 
 any later version published by the Free Software Foundation.
 If the Library as you received it does not specify a version
@@ -304,11 +297,11 @@ any version of the GNU Lesser General Public License ever
 published by the Free Software Foundation. 
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public
-License shall apply, that proxy's public statement of acceptance
+License shall apply, that proxy's public statement of acceptance
 of any version is permaneinguishing version number. If the
 Library as you received it specifies that a certain numbered
-version of the GNU Lesser General Public License "or any later
-version" applies to it, you have the option of following the
+version of the GNU Lesser General Public License "or any later
+version" applies to it, you have the option of following the
 terms and conditions either of that published version or of 
 any later version published by the Free Software Foundation.
 If the Library as you received it does not specify a version
@@ -317,25 +310,16 @@ any version of the GNU Lesser General Public License ever
 published by the Free Software Foundation. 
 If the Library as you received it specifies that a proxy can
 decide whether future versions of the GNU Lesser General Public
-License shall apply, that proxy's public statement of acceptance
+License shall apply, that proxy's public statement of acceptance
 of any version is permanent authorization for you to choose that
 version for the Library.
    </license>
-
-   <url>
-      <discovery label="LibreOffice Plugin update site" url="http://cedric.bosdonnat.free.fr/ooeclipseintegration"/>
-   </url>
-
-   <requires>
-      <import feature="org.eclipse.jdt"/>
-      <import plugin="org.openoffice.ide.eclipse.core" version="0.0.0.core"/>
-   </requires>
-
-   <plugin
-         id="org.openoffice.ide.eclipse.java"
-         download-size="0"
-         install-size="0"
-         version="0.0.0.java"
-         unpack="false"/>
-
+  <url>
+    <discovery label="LibreOffice Plugin update site" url="http://cedric.bosdonnat.free.fr/ooeclipseintegration"/>
+  </url>
+  <requires>
+    <import feature="org.eclipse.jdt"/>
+    <import plugin="org.openoffice.ide.eclipse.core" version="${core.Bundle-Version}"/>
+  </requires>
+  <plugin id="org.openoffice.ide.eclipse.java" download-size="0" install-size="0" version="${java.Bundle-Version}" unpack="false"/>
 </feature>
diff --git a/build/features/java/includes.xml b/build/features/java/includes.xml
new file mode 100644
index 0000000..fed1589
--- /dev/null
+++ b/build/features/java/includes.xml
@@ -0,0 +1 @@
+  <includes id="org.openoffice.ide.eclipse.java" version="${java.Bundle-Version}" optional="true"/>
diff --git a/build/site-feature.xml b/build/site-feature.xml
new file mode 100644
index 0000000..5c14725
--- /dev/null
+++ b/build/site-feature.xml
@@ -0,0 +1,3 @@
+    <feature url="@@URL@@" id="@@ID@@" version="@@VERSION@@">
+        <category name="LibreOffice"/>
+    </feature>
diff --git a/build/site-footer.xml b/build/site-footer.xml
new file mode 100644
index 0000000..f76ad8b
--- /dev/null
+++ b/build/site-footer.xml
@@ -0,0 +1,2 @@
+  <category-def name="LibreOffice" label="LibreOffice"/>
+</site>
diff --git a/build/site-header.xml b/build/site-header.xml
new file mode 100644
index 0000000..0db09c2
--- /dev/null
+++ b/build/site-header.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site pack200="true" digestURL="http://cedric.bosdonnat.free.fr/ooeclipseintegration">
diff --git a/build/site.xml b/build/site.xml
deleted file mode 100644
index 1787f9a..0000000
--- a/build/site.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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.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_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"/>
-</site>
diff --git a/packager/build.xml b/packager/build.xml
new file mode 100644
index 0000000..65c8401
--- /dev/null
+++ b/packager/build.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<!-- ======================================================================
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the GNU Lesser General Public License Version 2.1
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2009 by Cédric Bosdonnat.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ * 
+ * The Initial Developer of the Original Code is: Cédric Bosdonnat.
+ *
+ * Copyright: 2009 by Cédric Bosdonnat.
+ *
+ * All Rights Reserved.
+ * 
+  ====================================================================== -->
+<project name="packager" default="update-sources"> 
+	
+	<target name="init-env">
+		<dirname property="packager.basedir" file="${ant.file.packager}"/>
+		
+		<property name="packager.git.repo" value="git://github.com/cbosdo/ooo-plugin-packager.git" />
+		
+		<property name="packager.out.path" value="${packager.basedir}/bin/ant" />
+		<property name="packager.out.classes" value="${packager.out.path}/classes"/>
+        <property name="packager.sources" value="${packager.basedir}/source"/>
+		
+		<mkdir dir="${packager.out.path}/features" />
+		<mkdir dir="${packager.out.path}/plugins" />
+        <mkdir dir="${packager.out.classes}" />
+
+        <condition property="packager.sources.cloned">
+        	<available file="${packager.sources}"/>
+        </condition>
+	</target>
+	
+	<target name="packager.version" depends="init-env">
+		<property name="manifest.properties" value="MANIFEST-MF.properties"/>
+		<copy tofile="${manifest.properties}" file="${packager.basedir}/META-INF/MANIFEST.MF"/>
+		<replace file="${manifest.properties}" token=":" value="="/>
+		<property file="${manifest.properties}" prefix="packager"/>
+		<delete file="${manifest.properties}" />
+	</target>
+	
+	<target name="packager.purge" depends="init-env">
+		<property name="packager.out.path" value="${packager.basedir}/bin/ant" />
+		<delete dir="${packager.out.path}" />
+	</target>
+
+    <target name="clone-sources" depends="init-env" unless="packager.sources.cloned">
+        <exec executable="git" dir="${packager.basedir}">
+            <arg line="clone ${packager.git.repo}"/>
+            <arg line="source"/>
+        </exec>
+    </target>
+    
+    <target name="pull-sources" depends="init-env, clone-sources" if="packager.sources.cloned">
+        <exec executable="git" dir="${packager.sources}">
+            <arg line="pull -r"/>
+        </exec>
+    </target>
+	
+	<target name="update-sources" depends="clone-sources, pull-sources" description="Update the packager sources from git"/>
+	
+    <target name="packager-compile" depends="init-env, update-sources">
+    	<javac srcdir="${packager.sources}/ooo-plugin-packager-core/src/main" destdir="${packager.out.classes}"
+				target="1.5" source="1.5" 
+				debug="${debug}"/>
+    </target>
+
+
+	<target name="packager.plugin" depends="packager.version, packager-compile">
+		<jar destfile="${packager.out.path}/plugins/${package.prefix}.packager.core_${packager.Bundle-Version}.jar"
+			manifest="${packager.basedir}/META-INF/MANIFEST.MF">
+			<zipfileset prefix="" dir="${packager.sources}/ooo-plugin-packager-core/src/main">
+				<exclude name="**/*.java"/>
+			</zipfileset>
+			<zipfileset prefix="" dir="${packager.out.classes}"/>
+		</jar>
+	</target>
+	
+    <target name="packager.site" depends="packager.plugin">
+
+		<!-- Copying the plugins -->
+		<copy todir="${out.path}/plugins">
+            <fileset dir="${packager.out.path}/plugins/"
+				includes="*.jar" />
+			<mapper type="flatten" />
+        </copy>
+
+		<!-- Preparing the plugins for p2 update site -->
+        <prepareJar jar="${out.path}/plugins/${package.prefix}.packager.core_${packager.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+    </target>
+	
+</project>
+
diff --git a/packager/build/build.xml b/packager/build/build.xml
deleted file mode 100644
index 856b009..0000000
--- a/packager/build/build.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<!-- ======================================================================
- *
- * The Contents of this file are made available subject to the terms of
- * the GNU Lesser General Public License Version 2.1
- *
- * GNU Lesser General Public License Version 2.1
- * =============================================
- * Copyright 2009 by Cédric Bosdonnat.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- * 
- * The Initial Developer of the Original Code is: Cédric Bosdonnat.
- *
- * Copyright: 2009 by Cédric Bosdonnat.
- *
- * All Rights Reserved.
- * 
-  ====================================================================== -->
-<project name="packager" default="update-sources"> 
-	
-	<target name="init-env">
-		<dirname property="packager.basedir" file="${ant.file.packager}/.."/>
-		
-		<loadproperties srcfile="${packager.basedir}/build/build.properties" />
-		
-		<property name="packager.out.path" value="${packager.basedir}/bin/ant" />
-		<property name="packager.out.classes" value="${packager.out.path}/classes"/>
-        <property name="packager.sources" value="${packager.basedir}/source"/>
-		
-		<mkdir dir="${packager.out.path}/features" />
-		<mkdir dir="${packager.out.path}/plugins" />
-        <mkdir dir="${packager.out.classes}" />
-
-        <condition property="packager.sources.cloned">
-        	<available file="${packager.sources}"/>
-        </condition>
-	</target>
-	
-	<target name="packager.version" depends="init-env">
-		<property name="manifest.properties" value="MANIFEST-MF.properties"/>
-		<copy tofile="${manifest.properties}" file="${packager.basedir}/META-INF/MANIFEST.MF"/>
-		<replace file="${manifest.properties}" token=":" value="="/>
-		<property file="${manifest.properties}" prefix="packager"/>
-		<delete file="${manifest.properties}" />
-	</target>
-	
-	<target name="purge" depends="init-env">
-		<property name="packager.out.path" value="${packager.basedir}/bin/ant" />
-		<delete dir="${packager.out.path}" />
-	</target>
-
-    <target name="clone-sources" depends="init-env" unless="packager.sources.cloned">
-        <exec executable="git" dir="${packager.basedir}">
-            <arg line="clone ${packager.git.repo}"/>
-            <arg line="source"/>
-        </exec>
-    </target>
-    
-    <target name="pull-sources" depends="init-env, clone-sources" if="packager.sources.cloned">
-        <exec executable="git" dir="${packager.sources}">
-            <arg line="pull -r"/>
-        </exec>
-    </target>
-	
-	<target name="update-sources" depends="clone-sources, pull-sources" description="Update the packager sources from git"/>
-	
-    <target name="packager-compile" depends="init-env, update-sources">
-    	<javac srcdir="${packager.sources}/ooo-plugin-packager-core/src/main" destdir="${packager.out.classes}"
-				target="1.5" source="1.5" 
-				debug="${debug}"/>
-    </target>
-
-
-	<target name="packager.plugin" depends="packager.version, packager-compile">
-		<jar destfile="${packager.out.path}/plugins/${package.prefix}.packager.core_${packager.Bundle-Version}.jar"
-			manifest="${packager.basedir}/META-INF/MANIFEST.MF">
-			<zipfileset prefix="" dir="${packager.sources}/ooo-plugin-packager-core/src/main">
-				<exclude name="**/*.java"/>
-			</zipfileset>
-			<zipfileset prefix="" dir="${packager.out.classes}"/>
-		</jar>
-	</target>
-	
-</project>
-
commit 6d316d8c5a1cb2a04c6a5d1712b536a073e2bb66
Author: Ludovic SMADJA <ludovic.smadja at jalios.com>
Date:   Tue Aug 14 10:35:26 2012 +0200

    Add compatibility with LibreOffice 3.5

diff --git a/core/build.xml b/core/build.xml
index e11f6f6..6d5cae2 100644
--- a/core/build.xml
+++ b/core/build.xml
@@ -42,7 +42,7 @@
 
 <project name="core" default="core.error">
 	
-    <import file="../packager/build/build.xml"/>
+    <import file="../packager/build.xml"/>
 	
 	<target name="core.error">
 		<fail>Wrong target!
@@ -64,6 +64,7 @@
 
 			<fileset dir="${eclipse.home}/plugins/">
 				<include name="org.eclipse*.jar"/>
+				<include name="org.junit*/*.jar"/>
 			</fileset>
 			
 			<fileset dir="${packager.basedir}">
@@ -114,6 +115,25 @@
 			</zipfileset>
 		</jar>
 	</target>
+	
+    <target name="core.site" depends="core.plugin, packager.site">
+
+        <!-- Echo the needed bits for site.xml -->
+        <copy tofile="${out.path}/site-core.xml" file="${build.basedir}/site-feature.xml" />
+        <replace file="${out.path}/site-core.xml" token="@@URL@@" value="features/org.openoffice.ide.eclipse.core_${core.Bundle-Version}.jar"/>
+        <replace file="${out.path}/site-core.xml" token="@@ID@@" value="org.openoffice.ide.eclipse.core"/>
+        <replace file="${out.path}/site-core.xml" token="@@VERSION@@" value="${core.Bundle-Version}"/>
+
+		<!-- Copying the plugins -->
+		<copy todir="${out.path}/plugins">
+            <fileset dir="${core.out.path}/plugins/"
+				includes="*.jar" />
+			<mapper type="flatten" />
+        </copy>
+
+		<!-- Preparing the plugins for p2 update site -->
+        <prepareJar jar="${out.path}/plugins/${package.prefix}.core_${core.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+    </target>
 
 	<target name="check-javadocs">
 		<condition property="javadocs.do">
diff --git a/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java b/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java
index 6ffcd74..b770492 100644
--- a/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java
+++ b/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java
@@ -121,6 +121,9 @@ public class TypesBuilder extends IncrementalProjectBuilder {
 
                         IProject prj = getProject();
                         IUnoidlProject unoprj = ProjectsManager.getProject(prj.getName());
+                        if(unoprj == null){
+                            return false;
+                        }
                         IPath idlPath = unoprj.getIdlPath();
                         IPath resPath = pDelta.getResource().getProjectRelativePath();
 
@@ -217,6 +220,10 @@ public class TypesBuilder extends IncrementalProjectBuilder {
         IUnoidlProject unoprj = ProjectsManager.getProject(
                 pPrj.getName());
         
+        if(unoprj == null){
+            return ; 
+        }
+        
         try {
             IPath rdbPath = unoprj.getTypesPath();
             IFile rdbFile = pPrj.getFile(rdbPath);
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java
index 9480f68..5305b49 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java
@@ -433,4 +433,37 @@ public abstract class AbstractOOo implements IOOo, ITableElement {
         }
         return result;
     }
+    
+    protected static String getPlatformOS(){
+        return Platform.getOS();
+    }
+    
+    /**
+     * indicates if a code is a symbolic link or not.
+     * The code is an adaptation from apache commons
+     * @param file
+     * @return true if the file is a symbolic link, false otherwise
+     * @throws IOException
+     */
+    protected static boolean isSymbolicLink(File file) throws IOException{
+        if(file == null){
+            return false;
+        }
+        File fileInCanonicalParent = null;
+        if(file.getParentFile() == null){
+            fileInCanonicalParent = file;
+        }
+        else{
+            File canonicalParent= file.getParentFile().getCanonicalFile();
+            fileInCanonicalParent = new File(canonicalParent, file.getName());
+        }        
+        return !fileInCanonicalParent.getCanonicalFile().equals(fileInCanonicalParent.getAbsoluteFile());
+    }
+
+    public static File getTargetLink(File link) throws IOException {
+        if(link == null){
+            return null;
+        }
+        return new File(link.getCanonicalPath());
+    }
 }
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java
index ad3c499..89a7fbd 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java
@@ -45,9 +45,13 @@ package org.openoffice.ide.eclipse.core.internal.model;
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.LineNumberReader;
 import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.Properties;
 
 import org.eclipse.core.runtime.IPath;
@@ -144,15 +148,7 @@ public class OOo extends AbstractOOo {
      * {@inheritDoc}
      */
     public String[] getClassesPath() {
-
-        String[] paths = new String[] { getLibsPath()[0] + FILE_SEP + "classes" //$NON-NLS-1$
-        };
-
-        if (mMapper.isVersion3()) {
-            paths = mMapper.getClasses();
-        }
-
-        return paths;
+        return mMapper.getClasses();
     }
 
     /**
@@ -161,7 +157,6 @@ public class OOo extends AbstractOOo {
     public String[] getLibsPath() {
         // Nothing if not OOo3
         String[] otherPaths = mMapper.getAdditionnalLibs();
-
         String libs = getHome() + FILE_SEP + "program"; //$NON-NLS-1$
         if (getPlatform().equals(Platform.OS_MACOSX)) {
             libs = getHome() + FILE_SEP + "MacOS"; //$NON-NLS-1$
@@ -189,28 +184,14 @@ public class OOo extends AbstractOOo {
      * {@inheritDoc}
      */
     public String[] getTypesPath() {
-        String[] paths = { getLibsPath()[0] + FILE_SEP + "types.rdb" //$NON-NLS-1$ 
-        };
-
-        if (mMapper.isVersion3()) {
-            paths = mMapper.getTypes();
-        }
-
-        return paths;
+        return mMapper.getTypes();
     }
 
     /**
      * {@inheritDoc}
      */
     public String[] getServicesPath() {
-        String[] paths = new String[] { getLibsPath()[0] + FILE_SEP + "services.rdb" //$NON-NLS-1$
-        };
-
-        // Change the paths for OOo3 installs
-        if (mMapper.isVersion3()) {
-            paths = mMapper.getServices();
-        }
-        return paths;
+        return mMapper.getServices();
     }
 
     /**
@@ -230,17 +211,7 @@ public class OOo extends AbstractOOo {
      * {@inheritDoc}
      */
     public String getUnoPath() {
-        String uno = "uno.bin"; //$NON-NLS-1$
-        if (getPlatform().equals(Platform.OS_WIN32)) {
-            uno = "uno.exe"; //$NON-NLS-1$
-        }
-        String unoPath = getLibsPath()[0] + FILE_SEP + uno;
-
-        if (mMapper.isVersion3()) {
-            unoPath = mMapper.getUnoPath();
-        }
-
-        return unoPath;
+        return mMapper.getUnoPath();
     }
 
     /**
@@ -374,8 +345,8 @@ public class OOo extends AbstractOOo {
                 mDoRemovePackage = false;
                 Display.getDefault().syncExec(new Runnable() {
                     public void run() {
-                        mDoRemovePackage = MessageDialog.openConfirm(Display.getDefault().getActiveShell(), Messages
-                                        .getString("OOo.PackageExportTitle"), //$NON-NLS-1$
+                        mDoRemovePackage = MessageDialog.openConfirm(Display.getDefault().getActiveShell(),
+                                        Messages.getString("OOo.PackageExportTitle"), //$NON-NLS-1$
                                         Messages.getString("OOo.PackageAlreadyInstalled")); //$NON-NLS-1$
                     }
                 });
@@ -391,8 +362,8 @@ public class OOo extends AbstractOOo {
         } catch (Exception e) {
             Display.getDefault().asyncExec(new Runnable() {
                 public void run() {
-                    MessageDialog.openError(Display.getDefault().getActiveShell(), Messages
-                                    .getString("OOo.PackageExportTitle"), //$NON-NLS-1$
+                    MessageDialog.openError(Display.getDefault().getActiveShell(),
+                                    Messages.getString("OOo.PackageExportTitle"), //$NON-NLS-1$
                                     Messages.getString("OOo.DeploymentError")); //$NON-NLS-1$
                 }
             });
@@ -453,7 +424,7 @@ public class OOo extends AbstractOOo {
      * @param pName
      *            the name of the package to remove
      * @param pUserInstallation
-     *            the path to the office user installation to use 
+     *            the path to the office user installation to use
      * @throws Exception
      *             if anything wrong happens
      */
@@ -521,69 +492,155 @@ public class OOo extends AbstractOOo {
     private class OOo3PathMapper {
 
         private String mHome;
-        private String mBasis;
-
-        private boolean mVersionChecked = false;
 
         /**
          * This field holds the URE instance to use for OOo3.
          */
         private URE mUre;
 
+        // private fields
+        private File mapperBasisLibs;
+        private File mapperBasisBins;
+        private File mapperBasisClasses;
+        private List<File> mapperBasisTypes;
+        private List<File> mapperBasisServices;
+        
         /**
          * Create a new mapper object to get the OOo3 layers paths.
          * 
          * @param pHome
          *            the OOo install home
+         * @throws InvalidConfigException
          */
-        public OOo3PathMapper(String pHome) {
+        public OOo3PathMapper(String pHome) throws InvalidConfigException {
             mHome = pHome;
+            initPaths();
         }
 
-        /**
-         * @return <code>true</code> if the openoffice install corresponds to a 3.0 installation layout,
-         *         <code>false</code> otherwise.
-         */
-        public boolean isVersion3() {
-            boolean version3 = false;
-
-            if (!mVersionChecked) {
-                try {
-                    Path homePath = new Path(mHome);
-                    File homeFile = homePath.toFile();
-
-                    File basis = getPortableLink("basis-link", homeFile); //$NON-NLS-1$
-                    File ure = getPortableLink("ure-link", basis); //$NON-NLS-1$
-
-                    version3 = basis.isDirectory() && ure.isDirectory();
+        private void initPaths() throws InvalidConfigException {
+            // locate ure directory (directory which contains bin/uno.bin or bin/uno.exe
+            String unoRelativePath = "bin/" + URE.getUnoExecutable();
+            File ureDir = locateUniqueContainer(mHome, unoRelativePath);
+            if (ureDir == null) {
+                mHome = null;
+                throw new InvalidConfigException(Messages.getString("AbstractOOo.NoFileError") + unoRelativePath,
+                                InvalidConfigException.INVALID_OOO_HOME);
+            }
+            mUre = new URE(ureDir.getAbsolutePath());
+        }
 
-                    if (version3) {
-                        mBasis = basis.getCanonicalPath();
-                        mUre = new URE(ure.getCanonicalPath());
+        private File locateUniqueContainer(String baseDir, String pUnoRelativePath) throws InvalidConfigException {
+            try {
+                File base = new File(baseDir);
+                if (!base.exists() || !base.isDirectory() || !base.canRead()) {
+                    return null;
+                }
+                List<File> dirs = new RelativeFileLocator(base, pUnoRelativePath).getFiles();
+                if (dirs == null) {
+                    throw new InvalidConfigException(Messages.getString("AbstractOOo.NoFileError") + pUnoRelativePath,
+                                    InvalidConfigException.INVALID_OOO_HOME);
+                }
+                // remove link if there is duplicate
+                if (dirs.size() > 1) {
+                    List<File> linksList = new ArrayList<File>();
+                    for (File tmpFile : dirs) {
+                        if (AbstractOOo.isSymbolicLink(tmpFile)) {
+                            linksList.add(tmpFile);
+                        }
+                    }
+                    if(!linksList.isEmpty()) {
+                        for(File link : linksList){
+                            File linkTarget = AbstractOOo.getTargetLink(link);
+                            if(dirs.contains(linkTarget)){
+                                dirs.remove(linkTarget);
+                            }
+                        }                                                
                     }
-                } catch (Exception e) {
-                    version3 = false;
                 }
-
-                mVersionChecked = true;
-            } else {
-                version3 = mUre != null;
+                if (dirs.size() != 1) {
+                    throw new InvalidConfigException(Messages.getString("AbstractOOo.NoFileError") + pUnoRelativePath,
+                                    InvalidConfigException.INVALID_OOO_HOME);
+                } else {
+                    return dirs.get(0);
+                }
+            } catch (IOException e) {
+                throw new InvalidConfigException(Messages.getString("AbstractOOo.NoFileError") + pUnoRelativePath,
+                                InvalidConfigException.INVALID_OOO_HOME);
             }
-
-            return version3;
         }
 
+        private List<File> locateFiles(String baseDir, String pUnoRelativePath) throws InvalidConfigException {
+            try {
+                File base = new File(baseDir);
+                if (!base.exists() || !base.isDirectory() || !base.canRead()) {
+                    return null;
+                }
+                List<File> dirs = new RelativeFileLocator(base, pUnoRelativePath).getFiles();
+                if (dirs == null) {
+                    return Collections.emptyList();
+                }
+                // remove link if there is duplicate
+                if (dirs.size() > 1) {
+                    List<File> linksList = new ArrayList<File>();
+                    for (File tmpFile : dirs) {
+                        if (AbstractOOo.isSymbolicLink(tmpFile)) {
+                            linksList.add(tmpFile);
+                        }
+                    }
+                    if(!linksList.isEmpty()) {
+                        for(File link : linksList){
+                            File linkTarget = AbstractOOo.getTargetLink(link);
+                            if(dirs.contains(linkTarget)){
+                                dirs.remove(linkTarget);
+                            }
+                        }                                                
+                    }
+                }
+                if(dirs.size() == 0){
+                    return Collections.emptyList();
+                }
+                List<File> returnList = new ArrayList<File>();
+                for (File tmpFile : dirs) {
+                    returnList.add(new File(tmpFile, pUnoRelativePath));
+                }
+                return returnList;
+            } catch (IOException e) {
+                throw new InvalidConfigException(Messages.getString("AbstractOOo.NoFileError") + pUnoRelativePath,
+                                InvalidConfigException.INVALID_OOO_HOME);
+            }
+        }
+        
         /**
          * @return the libraries path to add for OOo3 or an empty array if not an OOo3 install.
+         * @throws InvalidConfigException
          */
         public String[] getAdditionnalLibs() {
             String[] additionnal = new String[0];
 
-            if (isVersion3()) {
-                String[] ureLibs = mUre.getLibsPath();
-                String basisLibs = mBasis + FILE_SEP + "program"; //$NON-NLS-1$
+            String[] ureLibs = new String[0];
+            if (mUre != null) {
+                ureLibs = mUre.getLibsPath();
+            }
 
-                additionnal = mergeArrays(ureLibs, new String[] { basisLibs });
+            File basisLibs = this.mapperBasisLibs;
+            if(basisLibs == null){
+                try {
+                    String extension = ".so";
+                    if (getPlatform().equals(Platform.OS_WIN32)) {
+                        extension = ".dll";
+                    } else if (getPlatform().equals(Platform.OS_MACOSX)) {
+                        extension = ".dylib";
+                    }
+                    basisLibs = locateUniqueContainer(mHome, "libpyuno" + extension);
+                    this.mapperBasisLibs = basisLibs;
+                } catch (InvalidConfigException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (basisLibs != null) {
+                additionnal = mergeArrays(ureLibs, new String[] { basisLibs.getAbsolutePath() });
+            } else {
+                additionnal = ureLibs;
             }
 
             return additionnal;
@@ -595,11 +652,25 @@ public class OOo extends AbstractOOo {
         public String[] getAdditionnalBins() {
             String[] additionnal = new String[0];
 
-            if (isVersion3()) {
-                String[] ureBins = mUre.getBinPath();
-                String basisBins = mBasis + FILE_SEP + "program"; //$NON-NLS-1$
+            String[] ureLibs = new String[0];
+            if (mUre != null) {
+                ureLibs = mUre.getBinPath();
+            }
 
-                additionnal = mergeArrays(ureBins, new String[] { basisBins });
+            File basisLibs = this.mapperBasisBins;
+            if(basisLibs == null){
+                try {
+                    basisLibs = locateUniqueContainer(mHome, "uno.pyc");
+                    this.mapperBasisBins = basisLibs;
+                } catch (InvalidConfigException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            if (basisLibs != null) {
+                additionnal = mergeArrays(ureLibs, new String[] { basisLibs.getAbsolutePath() });
+            } else {
+                additionnal = ureLibs;
             }
 
             return additionnal;
@@ -611,12 +682,25 @@ public class OOo extends AbstractOOo {
         public String[] getClasses() {
             String[] classes = new String[0];
 
-            if (isVersion3()) {
-                String[] ureClasses = mUre.getClassesPath();
-                String basisClasses = mBasis + FILE_SEP + "program" + //$NON-NLS-1$ 
-                                FILE_SEP + "classes"; //$NON-NLS-1$
+            String[] ureClasses = new String[0];
+            if (mUre != null) {
+                ureClasses = mUre.getClassesPath();
+            }
+
+            File basisClasses =  this.mapperBasisClasses;
+            if(mapperBasisClasses == null){
+                try {
+                    basisClasses = locateUniqueContainer(mHome, "unoil.jar");
+                    mapperBasisClasses= basisClasses;
+                } catch (InvalidConfigException e) {
+                    e.printStackTrace();
+                }
+            }
 
-                classes = mergeArrays(ureClasses, new String[] { basisClasses });
+            if (basisClasses != null) {
+                classes = mergeArrays(ureClasses, new String[] { basisClasses.getAbsolutePath() });
+            } else {
+                classes = ureClasses;
             }
 
             return classes;
@@ -628,12 +712,31 @@ public class OOo extends AbstractOOo {
         public String[] getTypes() {
             String[] types = new String[0];
 
-            if (isVersion3()) {
-                String[] ureTypes = mUre.getTypesPath();
-                String basisTypes = mBasis + FILE_SEP + "program" + //$NON-NLS-1$ 
-                                FILE_SEP + "offapi.rdb"; //$NON-NLS-1$
+            String[] ureTypes = new String[0];
+            if (mUre != null) {
+                ureTypes = mUre.getTypesPath();
+            }
 
-                types = mergeArrays(ureTypes, new String[] { basisTypes });
+            List<File> basisTypes = this.mapperBasisTypes;
+            if(mapperBasisTypes == null){
+                try {
+                    basisTypes = locateFiles(mHome, "offapi.rdb");
+                    mapperBasisTypes = basisTypes;
+                } catch (InvalidConfigException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            if (basisTypes != null && basisTypes.size() > 0) {
+                List<String> servicesPathList = new ArrayList<String>();    
+                for(File typeFile : basisTypes){
+                    if(typeFile != null){
+                        servicesPathList.add(typeFile.getAbsolutePath());    
+                    }                    
+                }                
+                types = mergeArrays(ureTypes, (String[]) servicesPathList.toArray(new String[servicesPathList.size()]));
+            } else {
+                types = ureTypes;
             }
 
             return types;
@@ -645,12 +748,31 @@ public class OOo extends AbstractOOo {
         public String[] getServices() {
             String[] types = new String[0];
 
-            if (isVersion3()) {
-                String[] ureTypes = mUre.getServicesPath();
-                String basisTypes = mBasis + FILE_SEP + "program" + //$NON-NLS-1$ 
-                                FILE_SEP + "services.rdb"; //$NON-NLS-1$
+            String[] ureTypes = new String[0];
+            if (mUre != null) {
+                ureTypes = mUre.getServicesPath();
+            }
+
+            List<File> basisTypes = this.mapperBasisServices;
+            if(mapperBasisServices == null){
+                try {
+                    basisTypes = locateFiles(mHome, "services.rdb");
+                    mapperBasisServices = basisTypes;
+                } catch (InvalidConfigException e) {
+                    e.printStackTrace();
+                }
+            }
 
-                types = mergeArrays(ureTypes, new String[] { basisTypes });
+            if (basisTypes != null && basisTypes.size() > 0) {
+                List<String> servicesPathList = new ArrayList<String>();    
+                for(File typeFile : basisTypes){
+                    if(typeFile != null){
+                        servicesPathList.add(typeFile.getAbsolutePath());    
+                    }                    
+                }                
+                types = mergeArrays(ureTypes, (String[]) servicesPathList.toArray(new String[servicesPathList.size()]));
+            } else {
+                types = ureTypes;
             }
 
             return types;
@@ -661,7 +783,7 @@ public class OOo extends AbstractOOo {
          */
         public String getUnoPath() {
             String path = null;
-            if (isVersion3()) {
+            if (mUre != null) {
                 path = mUre.getUnoPath();
             }
 
@@ -681,6 +803,12 @@ public class OOo extends AbstractOOo {
          * @return the array with the elements of both arrays
          */
         public String[] mergeArrays(String[] pArray1, String[] pArray2) {
+            if (pArray1 == null) {
+                return pArray2;
+            }
+            if (pArray2 == null) {
+                return pArray1;
+            }
             String[] result = new String[pArray1.length + pArray2.length];
 
             System.arraycopy(pArray1, 0, result, 0, pArray1.length);
@@ -688,42 +816,5 @@ public class OOo extends AbstractOOo {
 
             return result;
         }
-
-        /**
-         * Get the file object for the link defined as a child of a folder.
-         * 
-         * On Windows platform, the link relative location is specified as the content of a file named after the link
-         * name. On Unix-based systems symbolic links are supported.
-         * 
-         * @param pName
-         *            the name of the symbolic link
-         * @param pParent
-         *            the parent directory file
-         * 
-         * @return the file representing the link target or <code>null</code>
-         */
-        private File getPortableLink(String pName, File pParent) {
-            File link = null;
-
-            File linkFile = new File(pParent, pName);
-            if (getPlatform().equals(Platform.OS_WIN32)) {
-                // Read the content of the file to get the true folder
-                try {
-                    FileInputStream is = new FileInputStream(linkFile);
-                    byte[] buf = new byte[is.available()];
-                    is.read(buf);
-
-                    String relativePath = new String(buf);
-                    linkFile = new File(pParent, relativePath);
-                    link = linkFile;
-                } catch (Exception e) {
-                    // the returned link is null to show the error
-                }
-            } else {
-                link = linkFile;
-            }
-
-            return link;
-        }
     }
 }
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/RelativeFileLocator.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/RelativeFileLocator.java
new file mode 100644
index 0000000..613e7af
--- /dev/null
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/RelativeFileLocator.java
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * This library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as 
+ * published by the Free Software Foundation, either version 3 of 
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. 
+ * If not, see <http://www.gnu.org/licenses/>.
+ * 
+ * Copyright: 2012 by Ludovic Smadja
+ *
+ * All Rights Reserved.
+ * 
+ ************************************************************************/
+package org.openoffice.ide.eclipse.core.internal.model;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class RelativeFileLocator {
+
+    private File mBaseDir = null;
+    private String mRelativePath = null;
+        
+    public RelativeFileLocator(File baseDir, String pRelativePath) {
+        super();
+        this.mBaseDir = baseDir;
+        this.mRelativePath = pRelativePath;
+    }
+
+    public List<File> getFiles(){
+        if(mBaseDir == null || !mBaseDir.isDirectory()){
+            return null;
+        }
+        List<File> fileList = new ArrayList<File>();
+        List<File> scannedDirList = new ArrayList<File>();
+        scannedDirList.add(mBaseDir);
+        locateRelativeFile(scannedDirList, fileList, mRelativePath);
+        return fileList;
+    }
+
+    private void locateRelativeFile(List<File> scannedDirList, List<File> fileList, String relativePath) {
+        if( scannedDirList == null || scannedDirList.isEmpty()){
+            return;
+        }
+        List<File> newScannedDirList = new ArrayList<File>();
+        for(File scanFile : scannedDirList){
+            if( scanFile.exists() && scanFile.isDirectory()){
+                File tmpFile = new File(scanFile, relativePath);
+                if(tmpFile.exists()){
+                    fileList.add(scanFile);
+                }                
+                File[] children = scanFile.listFiles();
+                if(children != null && children.length > 0){
+                    newScannedDirList.addAll(Arrays.asList(children));
+                }
+            }            
+        }    
+        if(!newScannedDirList.isEmpty()){
+            locateRelativeFile(newScannedDirList,fileList,relativePath);
+        }
+    }
+
+}
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java
index c8ec6eb..f982c31 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java
@@ -168,14 +168,18 @@ public class URE extends AbstractOOo {
      * {@inheritDoc}
      */
     public String getUnoPath() {
+        return getHome() + FILE_SEP + "bin" + FILE_SEP + getUnoExecutable(); //$NON-NLS-1$
+    }
+
+    public static String getUnoExecutable(){
         String uno = "uno.bin"; //$NON-NLS-1$
-        if (getPlatform().equals(Platform.OS_WIN32)) {
+        if (getPlatformOS().equals(Platform.OS_WIN32)) {
             uno = "uno.exe"; //$NON-NLS-1$
         }
-
-        return getHome() + FILE_SEP + "bin" + FILE_SEP + uno; //$NON-NLS-1$
+        return uno;
     }
-
+    
+    
     /**
      * {@inheritDoc}
      */
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java
index 2457b90..4e45a3c 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java
@@ -633,6 +633,11 @@ public class UnoidlProject implements IUnoidlProject, IProjectNature {
      */
     public void saveAllProperties() {
 
+        if( mLanguage == null || mOOo == null || mSdk == null){
+            PluginLogger.warning(Messages.getString("UnoidlProject.InconsistentConfigurationError")); //$NON-NLS-1$
+            return;
+        }
+        
         Properties properties = new Properties();
         File configFile = getConfigFile();
 
@@ -646,7 +651,7 @@ public class UnoidlProject implements IUnoidlProject, IProjectNature {
         try {
             in = new FileInputStream(configFile);
             properties.load(in);
-
+            
             properties.setProperty(LANGUAGE, mLanguage.getName());
             properties.setProperty(OOO_NAME, mOOo.getName());
             properties.setProperty(SDK_NAME, mSdk.getId());
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/messages.properties b/core/source/org/openoffice/ide/eclipse/core/internal/model/messages.properties
index 5d99548..658878c 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/messages.properties
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/messages.properties
@@ -9,6 +9,7 @@ UnoidlProject.UnreadableConfigFileWarning=Unreadable uno project configuration f
 UnoidlProject.ConfigFileComment=UNO project configuration file
 UnoidlProject.PropertyChangeError=Error during project property change ({0}, {1})
 UnoidlProject.ConfigFileSaveError=Error saving all the project properties
+UnoidlProject.InconsistentConfigurationError=The configuration cannot be saved because it's inconsistent
 SDK.NoSettingsDirError=settings directory is missing
 SDK.MinSdkVersionError=SDK version has to be at least 2.0.4
 SDK.NoDirectoryError=Not an existing directory
diff --git a/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java b/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java
index 6672d57..b7147c3 100644
--- a/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java
+++ b/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java
@@ -111,6 +111,12 @@ public class OfficeLaunchDelegate extends LaunchConfigurationDelegate {
                     
                     // Deploy the component
                     deployComponent(unoprj, userInstallation, destFile);
+
+                    //remove lock file not cleaned by unopkg gui
+                    File lockFile = new File(userInstallation.toFile(), ".lock");
+                    if (lockFile.exists()) {
+                        lockFile.delete();
+                    }
                     pMonitor.worked(1);
 
                     // Run an OpenOffice instance
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java b/core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java
index 96c307c..b4eefec 100644
--- a/core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java
@@ -143,6 +143,7 @@ public interface IOOo {
      */
     public String getJavaldxPath();
 
+    
     /**
      * Returns a command to execute a <code>uno</code> component.
      * 
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/description/DescriptionModel.java b/core/source/org/openoffice/ide/eclipse/core/model/description/DescriptionModel.java
index e4bb50b..8fb3107 100644
--- a/core/source/org/openoffice/ide/eclipse/core/model/description/DescriptionModel.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/description/DescriptionModel.java
@@ -540,9 +540,13 @@ public class DescriptionModel implements IModel {
             writer.startTag( XMLTokens.ELEMENT_DESCRIPTION, mapping );
             
             // Write the version element
-            printValueElement( writer, XMLTokens.ELEMENT_VERSION, mVersion );
+            if(mVersion != null && !"".equals(mVersion)){
+                printValueElement( writer, XMLTokens.ELEMENT_VERSION, mVersion );
+            }
             printValueElement( writer, XMLTokens.ELEMENT_IDENTIFIER, mId );
-            printValueElement( writer, XMLTokens.ELEMENT_PLATFORM, mPlatforms );
+            if(mPlatforms != null && !"".equals(mPlatforms)){
+                printValueElement( writer, XMLTokens.ELEMENT_PLATFORM, mPlatforms );
+            }
             
             writeDependencies( writer );
             writeUpdateInfos( writer );
diff --git a/cpp/build.xml b/cpp/build.xml
index 1628203..7ddea43 100644
--- a/cpp/build.xml
+++ b/cpp/build.xml
@@ -71,12 +71,12 @@
 		<mkdir dir="${cpp.out.classes}" />
 	</target>
 	
-	<target name="cpp.version" depends="init-env">
+	<target name="cpp.version" depends="init-env" unless="cpp.nobuild">
 		<property name="manifest.properties" value="MANIFEST-MF.properties"/>
 		<copy tofile="${manifest.properties}" file="${cpp.basedir}/META-INF/MANIFEST.MF"/>
 		<replace file="${manifest.properties}" token=":" value="="/>
 		<property file="${manifest.properties}" prefix="cpp"/>
-		<delete file="${manifest.properties}" />
+        <delete file="${manifest.properties}" />
 	</target>
 	
 	<target name="purge" depends="init-env">
@@ -103,7 +103,26 @@
 			<zipfileset prefix="icons" dir="${cpp.basedir}/icons"/>
 			<zipfileset prefix="" file="${cpp.basedir}/plugin.xml" />
 		</jar>
-	</target>
+    </target>
+
+    <target name="cpp.site" depends="cpp.plugin" unless="cpp.nobuild">
+
+        <!-- Echo the needed bits for site.xml -->
+        <copy tofile="${out.path}/site-cpp.xml" file="${build.basedir}/site-feature.xml" />
+        <replace file="${out.path}/site-cpp.xml" token="@@URL@@" value="features/org.openoffice.ide.eclipse.cpp_${cpp.Bundle-Version}.jar"/>
+        <replace file="${out.path}/site-cpp.xml" token="@@ID@@" value="org.openoffice.ide.eclipse.cpp"/>
+        <replace file="${out.path}/site-cpp.xml" token="@@VERSION@@" value="${cpp.Bundle-Version}"/>
+
+		<!-- Copying the plugins -->
+		<copy todir="${out.path}/plugins">
+            <fileset dir="${cpp.out.path}/plugins/" 
+				includes="*.jar" />
+			<mapper type="flatten" />
+        </copy>
+
+		<!-- Preparing the plugins for p2 update site -->
+        <prepareJar jar="${out.path}/plugins/${package.prefix}.cpp_${cpp.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+    </target>
 	
 </project>
 
diff --git a/java/.classpath b/java/.classpath
index d6914fe..55be196 100644
--- a/java/.classpath
+++ b/java/.classpath
@@ -4,5 +4,6 @@
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
 	<classpathentry kind="src" path="source"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/ANT"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/java/build.xml b/java/build.xml
index b591473..d85291a 100644
--- a/java/build.xml
+++ b/java/build.xml
@@ -106,5 +106,24 @@
 		</jar>
 	</target>
 	
+    <target name="java.site" depends="java.plugin" unless="java.nobuild">
+
+        <!-- Echo the needed bits for site.xml -->
+        <copy tofile="${out.path}/site-java.xml" file="${build.basedir}/site-feature.xml" />
+        <replace file="${out.path}/site-java.xml" token="@@URL@@" value="features/org.openoffice.ide.eclipse.java_${java.Bundle-Version}.jar"/>
+        <replace file="${out.path}/site-java.xml" token="@@ID@@" value="org.openoffice.ide.eclipse.java"/>
+        <replace file="${out.path}/site-java.xml" token="@@VERSION@@" value="${java.Bundle-Version}"/>
+
+		<!-- Copying the plugins -->
+		<copy todir="${out.path}/plugins">
+            <fileset dir="${java.out.path}/plugins/"
+				includes="*.jar" />
+			<mapper type="flatten" />
+        </copy>
+
+		<!-- Preparing the plugins for p2 update site -->
+        <prepareJar jar="${out.path}/plugins/${package.prefix}.java_${java.Bundle-Version}.jar" outdir="${out.path}/plugins"/>
+    </target>
+	
 </project>
 
diff --git a/java/source/org/openoffice/ide/eclipse/java/JavaDebugExtraOptionsProvider.java b/java/source/org/openoffice/ide/eclipse/java/JavaDebugExtraOptionsProvider.java
index d0b7443..39f18cf 100644
--- a/java/source/org/openoffice/ide/eclipse/java/JavaDebugExtraOptionsProvider.java
+++ b/java/source/org/openoffice/ide/eclipse/java/JavaDebugExtraOptionsProvider.java
@@ -12,6 +12,7 @@ import org.openoffice.ide.eclipse.core.model.utils.SystemHelper;
 public class JavaDebugExtraOptionsProvider implements IExtraOptionsProvider {
 
     private String mPort;
+    private String OOO_EXTRA_JAVA_TOOL_OPTIONS = "OOO_EXTRA_JAVA_TOOL_OPTIONS"; //$NON-NLS-1$
 
     /**
      * 
@@ -26,8 +27,16 @@ public class JavaDebugExtraOptionsProvider implements IExtraOptionsProvider {
      * {@inheritDoc}
      */
     public String[] addEnv(String[] pEnv) {
-        pEnv = SystemHelper.addEnv(pEnv, "JAVA_TOOL_OPTIONS", "\"-Xdebug\" "
-                        + "\"-Xrunjdwp:transport=dt_socket,address=localhost:" + mPort + "\"", null);
+        String extraJavaOptEnv = System.getenv(OOO_EXTRA_JAVA_TOOL_OPTIONS);
+        if ( extraJavaOptEnv == null )
+            extraJavaOptEnv = new String( );
+        else
+            extraJavaOptEnv = extraJavaOptEnv.replaceAll("\"","\\\"");  //$NON-NLS-1$//$NON-NLS-2$
+            
+                
+        pEnv = SystemHelper.addEnv(pEnv, "JAVA_TOOL_OPTIONS", //$NON-NLS-1$
+                         extraJavaOptEnv + "\"-Xdebug\" " + //$NON-NLS-1$
+                         "\"-Xrunjdwp:transport=dt_socket,address=localhost:" + mPort + "\"", null); //$NON-NLS-1$ //$NON-NLS-2$
         return pEnv;
     }
 
diff --git a/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java b/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java
index 36136f8..d2cbc5c 100644
--- a/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java
+++ b/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java
@@ -44,9 +44,16 @@
 package org.openoffice.ide.eclipse.java;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Vector;
 
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathException;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathFactory;
+
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
@@ -72,25 +79,26 @@ import org.openoffice.ide.eclipse.core.model.language.IProjectHandler;
 import org.openoffice.ide.eclipse.java.build.OOoContainerPage;
 import org.openoffice.ide.eclipse.java.registration.RegistrationHelper;
 import org.openoffice.ide.eclipse.java.tests.TestsHelper;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
 
 /**
  * The Project handler implementation for Java.
  * 
  * @author cedricbosdo
- *
+ * 
  */
 public class JavaProjectHandler implements IProjectHandler {
 
-    private static final String P_REGISTRATION_CLASSNAME = "regclassname";  //$NON-NLS-1$
-    private static final String P_JAVA_VERSION = "javaversion";  //$NON-NLS-1$
-    
-    private static final String[] KEPT_JARS = {
-        "unoil.jar", //$NON-NLS-1$
-        "ridl.jar", //$NON-NLS-1$
-        "juh.jar", //$NON-NLS-1$
-        "jurt.jar", //$NON-NLS-1$
-        "unoloader.jar", //$NON-NLS-1$
-        "officebean.jar" //$NON-NLS-1$
+    private static final String P_REGISTRATION_CLASSNAME = "regclassname"; //$NON-NLS-1$
+    private static final String P_JAVA_VERSION = "javaversion"; //$NON-NLS-1$
+
+    private static final String[] KEPT_JARS = { "unoil.jar", //$NON-NLS-1$
+                    "ridl.jar", //$NON-NLS-1$
+                    "juh.jar", //$NON-NLS-1$
+                    "jurt.jar", //$NON-NLS-1$
+                    "unoloader.jar", //$NON-NLS-1$
+                    "officebean.jar" //$NON-NLS-1$
     };
 
     /**
@@ -99,7 +107,7 @@ public class JavaProjectHandler implements IProjectHandler {
     public void addOOoDependencies(IOOo pOoo, IProject pProject) {
 
         IJavaProject javaProject = JavaCore.create(pProject);
-        
+
         OOoContainerPage.addOOoDependencies(pOoo, javaProject);
     }
 
@@ -110,27 +118,26 @@ public class JavaProjectHandler implements IProjectHandler {
         try {
             if (!pProject.exists()) {
                 pProject.create(null);
-                PluginLogger.debug(
-                        "Project created during language specific operation"); //$NON-NLS-1$
+                PluginLogger.debug("Project created during language specific operation"); //$NON-NLS-1$
             }
-            
+
             if (!pProject.isOpen()) {
                 pProject.open(null);
                 PluginLogger.debug("Project opened"); //$NON-NLS-1$
             }
-            
+
             IProjectDescription description = pProject.getDescription();
             String[] natureIds = description.getNatureIds();
             String[] newNatureIds = new String[natureIds.length + 1];
             System.arraycopy(natureIds, 0, newNatureIds, 0, natureIds.length);
-            
+
             // Adding the nature
             newNatureIds[natureIds.length] = JavaCore.NATURE_ID;
-            
+
             description.setNatureIds(newNatureIds);
             pProject.setDescription(description, null);
             PluginLogger.debug(Messages.getString("Language.JavaNatureSet")); //$NON-NLS-1$
-            
+
         } catch (CoreException e) {
             PluginLogger.error(Messages.getString("Language.NatureSettingFailed")); //$NON-NLS-1$
         }
@@ -142,8 +149,7 @@ public class JavaProjectHandler implements IProjectHandler {
     public void configureProject(UnoFactoryData pData, IProgressMonitor pMonitor) throws Exception {
 
         // Get the project from data
-        IProject prj = (IProject)pData.getProperty(
-                IUnoFactoryConstants.PROJECT_HANDLE);
+        IProject prj = (IProject) pData.getProperty(IUnoFactoryConstants.PROJECT_HANDLE);
         IUnoidlProject unoprj = ProjectsManager.getProject(prj.getName());
 
         // Set some properties on the project
@@ -153,38 +159,34 @@ public class JavaProjectHandler implements IProjectHandler {
         unoprj.setProperty(P_REGISTRATION_CLASSNAME, regclass);
 
         // Java version
-        String javaversion = (String)pData.getProperty(
-                JavaWizardPage.JAVA_VERSION);
+        String javaversion = (String) pData.getProperty(JavaWizardPage.JAVA_VERSION);
         unoprj.setProperty(P_JAVA_VERSION, javaversion);
-        
-        IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
-                unoprj.getName());
-        
+
+        IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(unoprj.getName());
+
         // Create the project structure
         IJavaProject javaProject = JavaCore.create(project);
-        javaProject.open( pMonitor );
-        
+        javaProject.open(pMonitor);
+
         IPath sourcePath = unoprj.getFolder(unoprj.getSourcePath()).getFullPath();
         IPath buildPath = unoprj.getFolder(unoprj.getBuildPath()).getFullPath();
-        
-        IClasspathEntry[] entries = new IClasspathEntry[] { 
-                JavaCore.newSourceEntry(sourcePath),
-                JavaRuntime.getDefaultJREContainerEntry(),
-                JavaCore.newLibraryEntry(buildPath, null, null, false)
-        };
-        
+
+        IClasspathEntry[] entries = new IClasspathEntry[] { JavaCore.newSourceEntry(sourcePath),
+                        JavaRuntime.getDefaultJREContainerEntry(),
+                        JavaCore.newLibraryEntry(buildPath, null, null, false) };
+
         javaProject.setRawClasspath(entries, pMonitor);
-        
+
         // Add the registration files
-        RegistrationHelper.generateFiles( unoprj );
-        
+        RegistrationHelper.generateFiles(unoprj);
+
         // Tests creation
-        Boolean usetests = (Boolean)pData.getProperty( JavaWizardPage.JAVA_TESTS );
-        if ( usetests.booleanValue() ) {
-            TestsHelper.writeTestClasses( unoprj );
-            
-            IJavaProject javaprj = JavaCore.create( prj );
-            TestsHelper.addJUnitLibraries( javaprj );
+        Boolean usetests = (Boolean) pData.getProperty(JavaWizardPage.JAVA_TESTS);
+        if (usetests.booleanValue()) {
+            TestsHelper.writeTestClasses(unoprj);
+
+            IJavaProject javaprj = JavaCore.create(prj);
+            TestsHelper.addJUnitLibraries(javaprj);
         }
     }
 
@@ -194,24 +196,24 @@ public class JavaProjectHandler implements IProjectHandler {
     public String getImplementationName(IUnoidlProject pPrj, String pService) throws Exception {
         String prefix = pPrj.getCompanyPrefix();
         String comp = pPrj.getOutputExtension();
-        
+
         String implementationName = null;
-        
+
         if (pService.startsWith(prefix)) {
             String localName = pService.substring(prefix.length());
             implementationName = prefix + "." + comp + localName + "Impl"; //$NON-NLS-1$ //$NON-NLS-2$
         } else {
             throw new Exception("Cannot find implementation name for service: " + pService); //$NON-NLS-1$
         }
-        
+
         return implementationName;
     }
-    
+
     /**
      * {@inheritDoc}
      */
     public IPath getImplementationFile(String pImplementationName) {
-        
+
         return new Path(pImplementationName.replace(".", "/") + ".java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
 
@@ -220,10 +222,9 @@ public class JavaProjectHandler implements IProjectHandler {
      */
     public String getSkeletonMakerLanguage(UnoFactoryData pData) throws Exception {
         // Get the project from data
-        String name = (String)pData.getProperty(
-                IUnoFactoryConstants.PROJECT_NAME);
+        String name = (String) pData.getProperty(IUnoFactoryConstants.PROJECT_NAME);
         IUnoidlProject unoprj = ProjectsManager.getProject(name);
-        
+
         return "--" + unoprj.getProperty(P_JAVA_VERSION); //$NON-NLS-1$
     }
 
@@ -232,33 +233,68 @@ public class JavaProjectHandler implements IProjectHandler {
      */
     public void removeOOoDependencies(IOOo pOoo, IProject pProject) {
         IJavaProject javaProject = JavaCore.create(pProject);
-        
+
         OOoContainerPage.removeOOoDependencies(javaProject);
     }
-    
+
     /**
      * {@inheritDoc}
      */
     public String getLibraryPath(IUnoidlProject pProject) {
         return getJarFile(pProject).getLocation().toOSString();
     }
-    
+
     /**
-     * Returns a handle to the project jar file. Beware that this handle
-     * may refer to a non-existing file. Users have to create it if necessary.
+     * Returns a handle to the project jar file. Beware that this handle may refer to a non-existing file. Users have to
+     * create it if necessary.
      * 
-     * @param pProject the concerned UNO project
+     * @param pProject
+     *            the concerned UNO project
      * @return a handle to the jar file of the project
      */
     public IFile getJarFile(IUnoidlProject pProject) {
         String filename = pProject.getName().replace(" ", "") + ".jar"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         return pProject.getFile(filename);
     }
-    
+
+    /**
+     * Returns a handle to the project jar file. Beware that this handle may refer to a non-existing file. Users have to
+     * create it if necessary.
+     * 
+     * @param pProjectDir
+     *            the concerned UNO project directory
+     * @return a handle to the jar file of the project
+     */
+    public File getJarFile(File pProjectDir) throws IOException, XPathException {
+        String filename = getName(pProjectDir).replace(" ", "") + ".jar"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        return new File(pProjectDir, filename);
+    }
+
+    private String getName(File projectDir) throws IOException, XPathException {
+        File projectFile = new File(projectDir, ".project");
+        if (!projectFile.exists()) {
+            return null;
+        }
+        final FileInputStream byteStream = new FileInputStream(projectFile);
+        InputSource source = new InputSource(byteStream);
+
+        // evaluation de l'expression XPath
+        XPathFactory factory = XPathFactory.newInstance();
+        javax.xml.xpath.XPath xpath = factory.newXPath();
+        final String xPathExpr = "//projectDescription/name";
+        XPathExpression exp = xpath.compile(xPathExpr);
+        Node node = (Node) exp.evaluate(source, XPathConstants.NODE);
+        if (node == null) {
+            return null;
+        }
+        return node.getTextContent();
+    }
+
     /**
      * Get the UNO registration class name of the project.
      * 
-     * @param pProject the project for witch to get the registration class.
+     * @param pProject
+     *            the project for witch to get the registration class.
      * 
      * @return the registration class name
      */
@@ -270,69 +306,68 @@ public class JavaProjectHandler implements IProjectHandler {
      * {@inheritDoc}
      */
     public IFolder[] getBinFolders(IUnoidlProject pUnoidlProject) {
-        ArrayList< IFolder > folders = new ArrayList<IFolder>();
-        
+        ArrayList<IFolder> folders = new ArrayList<IFolder>();
+
         IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
-        IProject prj = workspace.getProject( pUnoidlProject.getName() );
-        IJavaProject javaPrj = JavaCore.create( prj );
+        IProject prj = workspace.getProject(pUnoidlProject.getName());
+        IJavaProject javaPrj = JavaCore.create(prj);
         try {
-            folders.add( workspace.getFolder( javaPrj.getOutputLocation() ) );
-        
+            folders.add(workspace.getFolder(javaPrj.getOutputLocation()));
+
             IClasspathEntry[] entries = javaPrj.getRawClasspath();
             for (IClasspathEntry entry : entries) {
-                if ( entry.getEntryKind() == IClasspathEntry.CPE_SOURCE  && 
-                        entry.getOutputLocation() != null ) {
-                    folders.add( workspace.getFolder( entry.getOutputLocation() ) );
+                if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE && entry.getOutputLocation() != null) {
+                    folders.add(workspace.getFolder(entry.getOutputLocation()));
                 }
             }
-        } catch ( JavaModelException e ) {
+        } catch (JavaModelException e) {
         }
-        
-        return folders.toArray( new IFolder[folders.size()] );
+
+        return folders.toArray(new IFolder[folders.size()]);
     }
-    
-    //--------------------------------------------- Jar finding private methods
-    
+
+    // --------------------------------------------- Jar finding private methods
+
     /**
      * returns the path of all the kept jars contained in the folder pointed by path.
      * 
-     * @param pOoo the OOo instance from which to get the jars
+     * @param pOoo
+     *            the OOo instance from which to get the jars
      * @return a vector of Path pointing to each jar.
      */
     public static Vector<Path> findJarsFromPath(IOOo pOoo) {
         Vector<Path> jarsPath = new Vector<Path>();
-        
+
         String[] paths = pOoo.getClassesPath();
         for (String path : paths) {
             Path folderPath = new Path(path);
             File programFolder = folderPath.toFile();
-            
+
             String[] content = programFolder.list();
             for (int i = 0, length = content.length; i < length; i++) {
                 String contenti = content[i];
                 if (isKeptJar(contenti)) {
-                    Path jariPath = new Path (
-                            path + "/" + contenti); //$NON-NLS-1$
+                    Path jariPath = new Path(path + "/" + contenti); //$NON-NLS-1$
                     jarsPath.add(jariPath);
                 }
-            }   
+            }
         }
-        
+
         return jarsPath;
     }
-    
+
     /**
      * Check if the specified jar file is one of those define in the KEPT_JARS constant.
      * 
-     * @param pJarName name of the jar file to check
-     * @return <code>true</code> if jarName is one of those defined in KEPT_JARS, 
-     *         <code>false</code> otherwise.
+     * @param pJarName
+     *            name of the jar file to check
+     * @return <code>true</code> if jarName is one of those defined in KEPT_JARS, <code>false</code> otherwise.
      */
     private static boolean isKeptJar(String pJarName) {
-        
+
         int i = 0;
         boolean isKept = false;
-        
+
         while (i < KEPT_JARS.length && !isKept) {
             if (pJarName.equals(KEPT_JARS[i])) {
                 isKept = true;
commit a0b6bf7306e3c27074d35b2ceb5e09b47086e7fd
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Mon Aug 13 10:19:20 2012 +0200

    Changed plugin-packager repo URL

diff --git a/packager/build/build.properties b/packager/build/build.properties
index a265dff..e0c5abf 100644
--- a/packager/build/build.properties
+++ b/packager/build/build.properties
@@ -1 +1 @@
-packager.git.repo=git://github.com/fredericmorin/ooo-plugin-packager.git
\ No newline at end of file
+packager.git.repo=git://github.com/cbosdo/ooo-plugin-packager.git
\ No newline at end of file


More information about the ooo-build-commit mailing list