tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r742779 - in /tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse: AbstractIdeSupportMojo.java EclipseClasspathWriter.java EclipsePlugin.java
Date Mon, 09 Feb 2009 22:53:10 GMT
Author: rfeng
Date: Mon Feb  9 22:53:10 2009
New Revision: 742779

URL: http://svn.apache.org/viewvc?rev=742779&view=rev
Log:
Check if the project is an OSGi bundle to set the pde flag

Modified:
    tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java
    tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java
    tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java

Modified: tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java?rev=742779&r1=742778&r2=742779&view=diff
==============================================================================
--- tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java
(original)
+++ tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/AbstractIdeSupportMojo.java
Mon Feb  9 22:53:10 2009
@@ -1111,4 +1111,26 @@
     {
         return getUseProjectReferences() && isAvailableAsAReactorProject( art );
     }
+    
+    protected boolean isOSGiBundle() {
+        File base = project.getBasedir();
+        File mf = new File(base, "META-INF/MANIFEST.MF");
+        if (mf.isFile()) {
+            Manifest manifest = null;
+            try {
+                InputStream is = new FileInputStream(mf);
+                manifest = new Manifest(is);
+                is.close();
+            } catch (IOException e) {
+                // Ignore
+            }
+            if (manifest != null) {
+                String bundleName = manifest.getMainAttributes().getValue("Bundle-SymbolicName");
+                if (bundleName != null) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
 }

Modified: tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java?rev=742779&r1=742778&r2=742779&view=diff
==============================================================================
--- tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java
(original)
+++ tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipseClasspathWriter.java
Mon Feb  9 22:53:10 2009
@@ -32,12 +32,9 @@
 import java.util.Set;
 
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.eclipse.BuildCommand;
 import org.apache.maven.plugin.eclipse.Constants;
 import org.apache.maven.plugin.eclipse.EclipseSourceDir;
 import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
-import org.apache.maven.plugin.eclipse.writers.EclipseAntExternalLaunchConfigurationWriter;
-import org.apache.maven.plugin.eclipse.writers.EclipseLaunchConfigurationWriter;
 import org.apache.maven.plugin.ide.IdeDependency;
 import org.apache.maven.plugin.ide.IdeUtils;
 import org.codehaus.plexus.util.IOUtil;
@@ -241,6 +238,7 @@
 
         }
 
+        /* --------------- Commented out by rfeng
         // handle the special sources.
         if ( !specialSources.isEmpty() )
         {
@@ -316,6 +314,7 @@
                                                                  EclipseLaunchConfigurationWriter.FILE_DOT_EXTERNAL_TOOL_BUILDERS
+
                                                                  "Maven_Ant_Builder.launch"
) );
         }
+        */
 
         // ----------------------------------------------------------------------
         // The default output

Modified: tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java?rev=742779&r1=742778&r2=742779&view=diff
==============================================================================
--- tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java
(original)
+++ tuscany/java/sca/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/maven/plugin/eclipse/EclipsePlugin.java
Mon Feb  9 22:53:10 2009
@@ -79,7 +79,7 @@
  * @author <a href="mailto:fgiust@apache.org">Fabrizio Giustina</a>
  * @version $Id: EclipsePlugin.java 641616 2008-03-26 22:42:42Z aheritier $
  * @goal eclipse
- * @phase generate-resources
+ * @execute phase="generate-resources"
  */
 public class EclipsePlugin
     extends AbstractIdeSupportMojo
@@ -853,6 +853,11 @@
         {
             pde = true;
         }
+        
+        // [rfeng] Set PDE to false if the project is not a bundle
+        if(!isOSGiBundle()) {
+            pde = false;
+        }
 
         if ( eclipseProjectDir == null )
         {



Mime
View raw message