Author: pderop
Date: Sat Feb 26 22:29:03 2011
New Revision: 1074944

URL: http://svn.apache.org/viewvc?rev=1074944&view=rev
Log:
- Use bndlib 1.15.0 instead of bnd, for parsing annotations.
- Don't use anymore biz.aQute maven repository anymore.

Modified:
    felix/trunk/dependencymanager/annotation/pom.xml
    felix/trunk/dependencymanager/pom.xml
    felix/trunk/dependencymanager/test/pom.xml
    
felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java

Modified: felix/trunk/dependencymanager/annotation/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/annotation/pom.xml?rev=1074944&r1=1074943&r2=1074944&view=diff
==============================================================================
--- felix/trunk/dependencymanager/annotation/pom.xml (original)
+++ felix/trunk/dependencymanager/annotation/pom.xml Sat Feb 26 22:29:03 2011
@@ -37,7 +37,7 @@
 
                <dependency>
                        <groupId>biz.aQute</groupId>
-                       <artifactId>bnd</artifactId>
+                       <artifactId>bndlib</artifactId>
                </dependency>
 
                <dependency>

Modified: felix/trunk/dependencymanager/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/pom.xml?rev=1074944&r1=1074943&r2=1074944&view=diff
==============================================================================
--- felix/trunk/dependencymanager/pom.xml (original)
+++ felix/trunk/dependencymanager/pom.xml Sat Feb 26 22:29:03 2011
@@ -106,8 +106,8 @@
 
                        <dependency>
                                <groupId>biz.aQute</groupId>
-                               <artifactId>bnd</artifactId>
-                               <version>0.0.401</version>
+                               <artifactId>bndlib</artifactId>
+                               <version>1.15.0</version>
                        </dependency>
 
                        <dependency>
@@ -198,12 +198,6 @@
                        <name>Java.net Maven 2 Repository</name>
                        <url>http://download.java.net/maven/2</url>
                </repository>
-
-               <repository>
-                       <id>maven2-repository.biz.aQute</id>
-                       <name>aQute SARL Maven 2 Repository</name>
-                       <url>http://www.aqute.biz/repo</url>
-               </repository>
        </repositories>
 
        <scm>

Modified: felix/trunk/dependencymanager/test/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/pom.xml?rev=1074944&r1=1074943&r2=1074944&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/pom.xml (original)
+++ felix/trunk/dependencymanager/test/pom.xml Sat Feb 26 22:29:03 2011
@@ -52,12 +52,10 @@
                        <groupId>org.osgi</groupId>
                        <artifactId>org.osgi.compendium</artifactId>
                </dependency>
-               
                <dependency>
                        <groupId>biz.aQute</groupId>
-                       <artifactId>bnd</artifactId>
+                       <artifactId>bndlib</artifactId>
                </dependency>
-               
                <dependency>
                        <groupId>org.ops4j.pax.exam</groupId>
                        <artifactId>pax-exam</artifactId>

Modified: 
felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java?rev=1074944&r1=1074943&r2=1074944&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java
 (original)
+++ 
felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleGenerator.java
 Sat Feb 26 22:29:03 2011
@@ -15,16 +15,19 @@
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
-*/
+ */
 package org.apache.felix.dm.test;
 
 import java.io.File;
 import java.io.FileWriter;
 import java.io.PrintWriter;
 import java.net.URL;
+import java.util.HashSet;
 import java.util.Properties;
 
-import aQute.bnd.main.bnd;
+import aQute.lib.osgi.Analyzer;
+import aQute.lib.osgi.Builder;
+import aQute.lib.osgi.Jar;
 
 /**
  * Helper used to generate a bundle dynamically.
@@ -74,12 +77,13 @@ public class BundleGenerator
         try
         {
             // Check if the system tmp dir exists
-            
+
             File tmp = new File(System.getProperty("java.io.tmpdir"));
-            if (tmp != null && ! tmp.exists()) {
+            if (tmp != null && !tmp.exists())
+            {
                 tmp.mkdirs();
             }
-            
+
             // Deduce the classpath from Export-Package, or Private-Package 
headers.
 
             String pkg = _directives.getProperty("Export-Package");
@@ -89,8 +93,7 @@ public class BundleGenerator
             }
             if (pkg == null)
             {
-                throw new IllegalArgumentException(
-                    "You must either specify a Private-Package, or an 
Export-Package directive");
+                throw new IllegalArgumentException("You must either specify a 
Private-Package, or an Export-Package directive");
             }
 
             String classpath = getClassPath(pkg);
@@ -131,9 +134,7 @@ public class BundleGenerator
 
             // Launch Bnd in order to generate our tiny test bundle.
 
-            bnd bnd = new bnd();
-            bnd.main(new String[] { "-failok", "build", "-noeclipse", 
"-classpath", classpath,
-                    "-output", output.getPath(), directives.getPath() });
+            buildWithBnd(_directives, classpath, output);
 
             // Return the URL of the generated bundle, as a String.
 
@@ -152,6 +153,22 @@ public class BundleGenerator
     }
 
     /**
+     * Invoke Bnd builder for generating the target tiny bundle.
+     */
+    private void buildWithBnd(Properties directives, String classpath, File 
output)
+        throws Exception
+    {
+        Builder builder = new Builder();
+        builder.setProperty(Analyzer.FAIL_OK, "true");
+        builder.setProperties(directives);
+        builder.setClasspath(new String[] { classpath });
+        Jar jar = builder.build();
+        jar.setName(output.getName());
+        jar.write(output);
+        builder.close();
+    }
+
+    /**
      * Gets the bundle classpath, where the bundle classes will be collected.
      * @param pkg either an exported package, or a private package.
      * @return the bundle classpath


Reply via email to