ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
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

URL: http://svn.apache.org/viewvc?rev=1045144&view=rev
Log:
Start to write the doc about building an Eclipse plugin, reusing the examples

Added:
    ant/ivy/core/trunk/doc/samples/eclipse-plugin/
    ant/ivy/core/trunk/doc/samples/eclipse-plugin/build.xml
      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/build-eclipse-plugin.xml
    ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivy.xml
      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/com.acme.myplugin/ivy.xml
    ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.properties
      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.properties
    ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.xml
      - copied, changed from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.xml
Removed:
    ant/ivy/core/trunk/examples/eclipse-plugin/com.acme.myplugin/ivy.xml
    ant/ivy/core/trunk/examples/eclipse-plugin/common-build/
Modified:
    ant/ivy/core/trunk/doc/osgi/eclipse-plugin.html

Modified: ant/ivy/core/trunk/doc/osgi/eclipse-plugin.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/osgi/eclipse-plugin.html?rev=1045144&r1=1045143&r2=1045144&view=diff
==============================================================================
--- 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.
 
-TODO
+<h1>Quick setup</h1>
+
+In few steps, we will setup a build to compile and package an Eclipse plugin.
+
+<ol>
+<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/ivysettings.properties">ivysettings.properties</a>,
this <a href="../samples/eclipse-plugin/build.xml">build.xml</a>, and put them
into your plugin folder;</li>
+<li>in the ivysettings.properties, 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>
+</ol>
+
+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="http://ant.apache.org/ivy/ivyde/">Apache IvyDE</a>.
+
+<ol>
+<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>
+</ol>
+
+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>
 
 	</textarea>
 <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)
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/eclipse-plugin/build.xml?p2=ant/ivy/core/trunk/doc/samples/eclipse-plugin/build.xml&p1=ant/ivy/core/trunk/examples/eclipse-plugin/common-build/build-eclipse-plugin.xml&r1=1045142&r2=1045144&rev=1045144&view=diff
==============================================================================
--- 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" />
         </fileset>
     </path>
-    <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}/ivysettings.properties" />
+    <property file="${basedir}/ivysettings.properties" />
 
     <target name="clean" description="Clean the build directory">
         <delete dir="${basedir}/target" />
     </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>
 
     <target name="ivy:configure">
         <!-- classical ivy configuration -->
-        <ivy:configure file="${commondir}/ivysettings.xml" />
+        <ivy:configure file="ivysettings.xml" />
     </target>
 
     <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)
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivy.xml?p2=ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivy.xml&p1=ant/ivy/core/trunk/examples/eclipse-plugin/com.acme.myplugin/ivy.xml&r1=1045142&r2=1045144&rev=1045144&view=diff
==============================================================================
--- 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>
     <configurations>
         <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/ivysettings.properties (from r1045142,
ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.properties)
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.properties?p2=ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.properties&p1=ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.properties&r1=1045142&r2=1045144&rev=1045144&view=diff
==============================================================================
    (empty)

Copied: ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.xml (from r1045142, ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.xml)
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.xml?p2=ant/ivy/core/trunk/doc/samples/eclipse-plugin/ivysettings.xml&p1=ant/ivy/core/trunk/examples/eclipse-plugin/common-build/ivysettings.xml&r1=1045142&r2=1045144&rev=1045144&view=diff
==============================================================================
--- 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="ivysettings.properties" />
 
     <!-- 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 -->
     <parsers>
-        <osgi-ivyparser />
-        <osgi-parser>
-            <osgi-profileProvider />
-        </osgi-parser>
+        <osgi-manifest-parser />
     </parsers>
 
     <!-- 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 -->
     <resolvers>
-        <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>
     </resolvers>
 
 </ivysettings>



Mime
View raw message