felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r569771 - /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
Date Sun, 26 Aug 2007 06:30:55 GMT
Author: mcculls
Date: Sat Aug 25 23:30:54 2007
New Revision: 569771

URL: http://svn.apache.org/viewvc?rev=569771&view=rev
Log:
FELIX-308: support embedding of artifacts with non-jar extension names

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java?rev=569771&r1=569770&r2=569771&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
(original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
Sat Aug 25 23:30:54 2007
@@ -270,9 +270,9 @@
 
     public static void embedDependency(Properties properties, Artifact dependency)
     {
-        File jarFile = dependency.getFile();
+        File sourceFile = dependency.getFile();
 
-        if (null != jarFile && jarFile.exists())
+        if (null != sourceFile && sourceFile.exists())
         {
             String bundleClassPath = properties.getProperty(Analyzer.BUNDLE_CLASSPATH);
             String includeResource = properties.getProperty(Analyzer.INCLUDE_RESOURCE);
@@ -312,15 +312,23 @@
             File targetFile;
             if (Boolean.valueOf(embedStripVersion).booleanValue())
             {
-                targetFile = new File(embedDirectory, dependency.getArtifactId() + ".jar");
+                String extension = dependency.getArtifactHandler().getExtension();
+                if (extension != null)
+                {
+                    targetFile = new File(embedDirectory, dependency.getArtifactId() + "."
+ extension);
+                }
+                else
+                {
+                    targetFile = new File(embedDirectory, dependency.getArtifactId());
+                }
             }
             else
             {
-                targetFile = new File(embedDirectory, jarFile.getName());
+                targetFile = new File(embedDirectory, sourceFile.getName());
             }
 
             bundleClassPath += targetFile;
-            includeResource += targetFile + "=" + jarFile;
+            includeResource += targetFile + "=" + sourceFile;
 
             properties.setProperty(Analyzer.BUNDLE_CLASSPATH, bundleClassPath);
             properties.setProperty(Analyzer.INCLUDE_RESOURCE, includeResource);
@@ -329,9 +337,9 @@
 
     public static void inlineDependency(Properties properties, Artifact dependency)
     {
-        File jarFile = dependency.getFile();
+        File sourceFile = dependency.getFile();
 
-        if (null != jarFile && jarFile.exists())
+        if (null != sourceFile && sourceFile.exists())
         {
             String includeResource = properties.getProperty(Analyzer.INCLUDE_RESOURCE);
 
@@ -344,7 +352,7 @@
                 includeResource += ",";
             }
 
-            includeResource += "@" + jarFile;
+            includeResource += "@" + sourceFile;
 
             properties.setProperty(Analyzer.INCLUDE_RESOURCE, includeResource);
         }



Mime
View raw message