ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1045151 - in /ant/ivy/core/trunk: doc/osgi/ doc/samples/standard-osgi/ examples/osgi-repo/common-build/ examples/osgi-repo/repo/
Date Mon, 13 Dec 2010 14:42:37 GMT
Author: hibou
Date: Mon Dec 13 14:42:37 2010
New Revision: 1045151

URL: http://svn.apache.org/viewvc?rev=1045151&view=rev
Log:
starting to write the doc about building a standard OSGi bundle

Added:
    ant/ivy/core/trunk/doc/samples/standard-osgi/
    ant/ivy/core/trunk/doc/samples/standard-osgi/build.xml
      - copied, changed from r1045149, ant/ivy/core/trunk/examples/osgi-repo/common-build/build-osgi.xml
    ant/ivy/core/trunk/doc/samples/standard-osgi/ivy.xml
      - copied, changed from r1045149, ant/ivy/core/trunk/examples/osgi-repo/repo/ivy.xml
    ant/ivy/core/trunk/doc/samples/standard-osgi/ivysettings.xml
      - copied, changed from r1045149, ant/ivy/core/trunk/examples/osgi-repo/common-build/ivysettings.xml
    ant/ivy/core/trunk/doc/samples/standard-osgi/org.apache.ivy.sample.standard-osgi.bnd
Removed:
    ant/ivy/core/trunk/examples/osgi-repo/common-build/
    ant/ivy/core/trunk/examples/osgi-repo/repo/ivy.xml
Modified:
    ant/ivy/core/trunk/doc/osgi/standard-osgi.html

Modified: ant/ivy/core/trunk/doc/osgi/standard-osgi.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/osgi/standard-osgi.html?rev=1045151&r1=1045150&r2=1045151&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/osgi/standard-osgi.html (original)
+++ ant/ivy/core/trunk/doc/osgi/standard-osgi.html Mon Dec 13 14:42:37 2010
@@ -26,9 +26,22 @@
 <body>
 	<textarea id="xooki-source">
 
-This page describes how to build an OSGi&#153; webapp with with Apache Ivy&#153;.
+This page describes how to build an OSGi&#153; bundle with Apache Ivy&#153;. In this
use case, we just basically want to compute a classpath to compile, optionaly one for testing
too, and then publish our bundle in a OSGi aware repository.
+
+In oder to produce OSGi metadata of suffient quality and to avoid maintaining them manually,
the <a href="http://www.aqute.biz/Code/Bnd">bnd</a> tool will be used. The approach
taken is then an "Ivy file first" approach. The dependencies will be specified in the ivy.xml
file, the MANIFEST.MF being generated from the computed classpath.
+
+
+<h1>Quick setup</h1>
+
+In few steps, we will setup a build to compile and publish an OSGi bundle.
+
+<ol>
+<li>download this <a href="../samples/standard-osgi/ivy.xml">ivy.xml<a>,
this <a href="../samples/standard-osgi/ivysettings.xml">ivysettings.xml</a>, this
<a href="../samples/standard-osgi/build.xml">build.xml</a>, this <a href="../samples/standard-osgi/org.apache.ivy.sample.standard-osgi.bnd">bnd
file</a>, and put them into your project 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>
 
-TODO
 
 	</textarea>
 <script type="text/javascript">xooki.postProcess();</script>

Copied: ant/ivy/core/trunk/doc/samples/standard-osgi/build.xml (from r1045149, ant/ivy/core/trunk/examples/osgi-repo/common-build/build-osgi.xml)
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/standard-osgi/build.xml?p2=ant/ivy/core/trunk/doc/samples/standard-osgi/build.xml&p1=ant/ivy/core/trunk/examples/osgi-repo/common-build/build-osgi.xml&r1=1045149&r2=1045151&rev=1045151&view=diff
==============================================================================
--- ant/ivy/core/trunk/examples/osgi-repo/common-build/build-osgi.xml (original)
+++ ant/ivy/core/trunk/doc/samples/standard-osgi/build.xml Mon Dec 13 14:42:37 2010
@@ -16,17 +16,29 @@
    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="standard-osgi" xmlns:ivy="ivy" xmlns:bnd="bnd">
 
     <!-- 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="ivy.classpath"
/-->
+
+    <!-- Load Bnd ant tasks -->
+    <taskdef uri="bnd" resource="org/apache/ivy/ant/antlib.xml" />
+    <!-- If Bnd is not in Ant's classpath, get the jar of Bnd and use the folowing -->
+    <!-- taskdef rather than the above one -->
+    <!--path id="bnd.classpath"> 
+        <fileset dir="${basedir}">
+            <include name="bnd.jar" />
         </fileset>
     </path>
-    <taskdef uri="ivy" resource="org/apache/ivy/ant/antlib.xml" classpathref="antlib.classpath"
/>
+    <taskdef uri="bnd" resource="aQute/bnd/ant/taskdef.properties" classpathref="bnd.classpath"
/-->
 
     <target name="clean" description="Clean the build directory">
         <delete dir="${basedir}/target" />
@@ -34,12 +46,11 @@
 
     <target name="ivy:configure">
         <!-- classical ivy configuration -->
-        <ivy:configure file="${commondir}/ivysettings.xml" />
+        <ivy:configure file="${basedir}/ivysettings.xml" />
     </target>
 
     <target name="ivy:resolve" depends="ivy:configure">
-        <!-- the ivy file here is the manifest -->
-        <ivy:resolve file="META-INF/MANIFEST.MF" conf="*" />
+        <ivy:resolve file="ivy.xml" conf="*" />
         <ivy:cachepath pathid="compile.classpath" conf="default" useOrigin="true" />
     </target>
 
@@ -59,7 +70,12 @@
         </copy>
     </target>
 
-    <target name="build" depends="compile" description="Build the Eclipse plugin">
+    <target name="generate-manifest" depends="ivy:resolve">
+        <mkdir dir="META-INF" />
+        <bnd:bnd classpath="${toString:compile.classpath}" sourcepath="${basedir}/src"
eclipse="false" files="org.apache.ivy.sample.standard-osgi.bnd" />
+    </target>
+
+    <target name="build" depends="compile,generate-manifest" description="Build the OSGi
app">
         <!-- simple jaring -->
         <jar basedir="${basedir}/target/classes" destfile="${basedir}/target/${ant.project.name}.jar"
manifest="META-INF/MANIFEST.MF" />
     </target>

Copied: ant/ivy/core/trunk/doc/samples/standard-osgi/ivy.xml (from r1045149, ant/ivy/core/trunk/examples/osgi-repo/repo/ivy.xml)
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/standard-osgi/ivy.xml?p2=ant/ivy/core/trunk/doc/samples/standard-osgi/ivy.xml&p1=ant/ivy/core/trunk/examples/osgi-repo/repo/ivy.xml&r1=1045149&r2=1045151&rev=1045151&view=diff
==============================================================================
    (empty)

Copied: ant/ivy/core/trunk/doc/samples/standard-osgi/ivysettings.xml (from r1045149, ant/ivy/core/trunk/examples/osgi-repo/common-build/ivysettings.xml)
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/standard-osgi/ivysettings.xml?p2=ant/ivy/core/trunk/doc/samples/standard-osgi/ivysettings.xml&p1=ant/ivy/core/trunk/examples/osgi-repo/common-build/ivysettings.xml&r1=1045149&r2=1045151&rev=1045151&view=diff
==============================================================================
    (empty)

Added: ant/ivy/core/trunk/doc/samples/standard-osgi/org.apache.ivy.sample.standard-osgi.bnd
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/standard-osgi/org.apache.ivy.sample.standard-osgi.bnd?rev=1045151&view=auto
==============================================================================
    (empty)



Mime
View raw message