ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1045144 - in /ant/ivy/core/trunk: doc/osgi/ doc/samples/eclipse-plugin/ examples/eclipse-plugin/com.acme.myplugin/ examples/eclipse-plugin/common-build/
Date Mon, 13 Dec 2010 14:40:22 GMT
Author: hibou
Date: Mon Dec 13 14:40:22 2010
New Revision: 1045144

Start to write the doc about building an Eclipse plugin, reusing the examples

      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/build-eclipse-plugin.xml
      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/com.acme.myplugin/ivy.xml
      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/
      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.xml

Modified: ant/ivy/core/trunk/doc/osgi/eclipse-plugin.html
--- ant/ivy/core/trunk/doc/osgi/eclipse-plugin.html (original)
+++ ant/ivy/core/trunk/doc/osgi/eclipse-plugin.html Mon Dec 13 14:40:22 2010
@@ -28,7 +28,46 @@
 This page describes how to build an Eclipse™ plugin with Apache Ivy™ and
its OSGi™ capabilities.
+<h1>Quick setup</h1>
+In few steps, we will setup a build to compile and package an Eclipse plugin.
+<li>download this <a href="../samples/eclipse-plugin/ivy.xml">ivy.xml<a>,
this <a href="../samples/eclipse-plugin/ivysettings.xml">ivysettings.xml</a>,
this <a href="../samples/eclipse-plugin/"></a>,
this <a href="../samples/eclipse-plugin/build.xml">build.xml</a>, and put them
into your plugin folder;</li>
+<li>in the, specify the location of the plugins folder of your
Eclipse target;</li>
+<li><i>(optional)</i> by default the build.xml is expecting the sources
to be in the <tt>src</tt> folder. You may want to edit it if it is not the case</li>
+<li><i>(optional)</i> if Ivy is not in Ant's classpath, get the jar of
<a href="../download.html">Apache Ivy</a> and edit the build.xml accordingly (see
the comments at the begining of the file)</li>
+And that's it ! Now let's use it.
+First, Ivy needs to aggregate the OSGi metadata of the target platform. To do so just launch:
+<code>ant buildobr</code>
+You need to run that command only once. Or each time your target platform get modified.
+Then to resolve and build, just run:
+<code>ant build</code>
+<h2>Eclipse setup</h2>
+You probably have already configured your project in Eclipse via the PDE. Let's see how to
chnage that and use <a href="">Apache IvyDE</a>.
+<li>so first remove from your project's classpath the PDE dependencies container;</li>
+<li>then right click on the ivy.xml you just added and select "Add Ivy library";</li>
+<li>in the configuration panel of the IvyDE classpath container, as the settings file
put '${workspace_loc:mypluginproject/ivysettings.xml}';</li>
+<li>click finish and your Eclipse project should build now.</li>
+Nota Bene: to be resolved correctly Ivy is relying on the aggregated metadata of your target
platform. Even if you want to only build with Eclipse, you will have to run the command <tt>ant
obrindex</tt> at least one time.
+<h1>Details on the setup</h1>
+<h2>The repository</h2>
+When building an Eclipse plugin, we are relying on a "target platform", the Eclipse installation
we want our plugin to be eventually installed into. For Ivy, this will represent the repository
of artifacts.
+Ivy needs an aggragation of the OSGi metadata in order to resolve a such repository. The
Ant task <a href="../use/buildobr.html">buildobr</a> build a OBR (OSGi Bundle
Repository) descriptor file from a set of OSGi bundles. So here we are using this Ant task
to gather OSGi metadata from the Eclipse plugins in the "target platform". This is building
a file in <tt>target/</tt>
 <script type="text/javascript">xooki.postProcess();</script>

Copied: ant/ivy/core/trunk/doc/samples/eclipse-plugin/build.xml (from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/build-eclipse-plugin.xml)
--- ant/ivy/core/trunk/examples/eclipse-plugin/common-build/build-eclipse-plugin.xml (original)
+++ ant/ivy/core/trunk/doc/samples/eclipse-plugin/build.xml Mon Dec 13 14:40:22 2010
@@ -16,33 +16,35 @@
    specific language governing permissions and limitations
    under the License.    
-<project name="common-build" xmlns:ivy="ivy">
-    <dirname property="commondir" file="${ant.file.common-build}" />
+<project name="eclipse-plugin-build" xmlns:ivy="ivy">
     <!-- Load Ivy ant tasks -->
-    <path id="antlib.classpath">
-        <fileset dir="${commondir}/lib">
-            <include name="*.jar" />
+    <taskdef uri="ivy" resource="org/apache/ivy/ant/antlib.xml" />
+    <!-- If Ivy is not in Ant's classpath, get the jar of Ivy and use the folowing -->
+    <!-- taskdef rather than the above one -->
+    <!--path id="ivy.classpath"> 
+        <fileset dir="${basedir}">
+            <include name="ivy.jar" />
-    <taskdef uri="ivy" resource="org/apache/ivy/ant/antlib.xml" classpathref="antlib.classpath"
+    <taskdef uri="ivy" resource="org/apache/ivy/ant/antlib.xml" classpathref="ivy.classpath"
     <!-- Load the properties where is defined the eclipse home -->
-    <property file="${commondir}/" />
+    <property file="${basedir}/" />
     <target name="clean" description="Clean the build directory">
         <delete dir="${basedir}/target" />
-    <target name="obrindex" description="Build the obr index">
+    <target name="buildobr" description="Build the obr index">
         <!-- build the repo.xml which aggregate every metadata of the Eclipse plugins
-        <ivy:buildobr baseDir="${eclipse.home}" basePath="${eclipse.home}" out="${commondir}/repo-eclipse.xml"
indent="true" />
+        <mkdir dir="${basedir}/target" />
+        <ivy:buildobr baseDir="${eclipse.home}" basePath="${eclipse.home}" out="${basedir}/target/repo-eclipse.xml"
indent="true" />
     <target name="ivy:configure">
         <!-- classical ivy configuration -->
-        <ivy:configure file="${commondir}/ivysettings.xml" />
+        <ivy:configure file="ivysettings.xml" />
     <target name="ivy:resolve" depends="ivy:configure">

Copied: ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivy.xml (from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/com.acme.myplugin/ivy.xml)
--- ant/ivy/core/trunk/examples/eclipse-plugin/com.acme.myplugin/ivy.xml (original)
+++ ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivy.xml Mon Dec 13 14:40:22 2010
@@ -17,8 +17,10 @@
    specific language governing permissions and limitations
    under the License.    
-<ivy-module version="2.0">
-    <info organisation="com.acme" module="myplugin" manifest="META-INF/MANIFEST.MF" />
+<ivy-module version="2.2">
+    <info organisation="com.acme" module="myplugin">
+        <extends location="META-INF/MANIFEST.MF" />
+    </info>
         <conf name="compile"  extends="default,embedded" description="Dependencies for
the compilation" />
         <conf name="embedded"                            description="Dependencies embedded
into the plugin's jar" />

Copied: ant/ivy/core/trunk/doc/samples/eclipse-plugin/ (from r1045142,

Copied: ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.xml (from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.xml)
--- ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.xml (original)
+++ ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.xml Mon Dec 13 14:40:22 2010
@@ -21,8 +21,6 @@
     <properties file="" />
     <!-- We need some custom types -->
-    <!-- The parser of MANIFEST.MF -->
-    <typedef name="osgi-parser" classname="org.apache.ivy.osgi.repo.ManifestMDParser"
     <!-- The parser of ivy.xml that can reference a MANIFEST.MF-->
     <typedef name="osgi-ivyparser" classname="org.apache.ivy.osgi.ivy.OsgiIvyParser" />
     <!-- The Ivy Osgi repo resolver -->
@@ -39,10 +37,7 @@
     <!-- We will use Ivy Osgi's parsers -->
-        <osgi-ivyparser />
-        <osgi-parser>
-            <osgi-profileProvider />
-        </osgi-parser>
+        <osgi-manifest-parser />
     <!-- We need to define the Ivy Osgi latest strategy as the default one -->
@@ -55,9 +50,9 @@
     <!-- We just need to define our Ivy OSGi resolver -->
-        <osgi-repo name="eclipse" repoXmlFile="${ivy.settings.dir}/repo-eclipse.xml">
+        <obr name="eclipse" repoXmlFile="${ivy.settings.dir}/target/repo-eclipse.xml">
             <osgi-profileProvider />
-        </osgi-repo>
+        </obr>

View raw message