felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1526858 - in /felix/trunk/scrplugin: generator/ generator/src/main/java/org/apache/felix/scrplugin/ generator/src/main/java/org/apache/felix/scrplugin/xml/ maven-scr-plugin/ maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/
Date Fri, 27 Sep 2013 11:40:08 GMT
Author: cziegeler
Date: Fri Sep 27 11:40:07 2013
New Revision: 1526858

URL: http://svn.apache.org/r1526858
Log:
FELIX-4246 : SCR and Metatype descriptor files get deleted on subsequent (incremental) eclipse
build

Modified:
    felix/trunk/scrplugin/generator/changelog.txt
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
    felix/trunk/scrplugin/maven-scr-plugin/changelog.txt
    felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java

Modified: felix/trunk/scrplugin/generator/changelog.txt
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/changelog.txt?rev=1526858&r1=1526857&r2=1526858&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/changelog.txt (original)
+++ felix/trunk/scrplugin/generator/changelog.txt Fri Sep 27 11:40:07 2013
@@ -3,6 +3,7 @@ Changes from 1.8.2 to 1.8.0
 ** Bug
     * [FELIX-4192] - SCR Generator fails with a NPE in case a class level Reference doesn't
define a referenceInterface
     * [FELIX-4010] - SCR Plugin aborts when scanning a Java 8 class file
+    * [FELIX-4246] - SCR and Metatype descriptor files get deleted on subsequent (incremental)
eclipse build
 
  
 Changes from 1.8.0 to 1.7.0

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java?rev=1526858&r1=1526857&r2=1526858&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java
(original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/Options.java
Fri Sep 27 11:40:07 2013
@@ -43,6 +43,9 @@ public class Options {
     /** The output directory for the generated files. */
     private File outputDirectory;
 
+    /** Is this an incremental build? */
+    private boolean incremental = false;
+
     /**
      * @see #setGenerateAccessors(boolean)
      * @return Whether accessor methods should be generated.
@@ -157,4 +160,18 @@ public class Options {
     public File getComponentDescriptorDirectory() {
         return new File(this.getOutputDirectory(), PARENT_NAME);
     }
+
+    /**
+     * Is this an incremental build
+     */
+    public boolean isIncremental() {
+        return incremental;
+    }
+
+    /**
+     * Set whether this is an incremental build
+     */
+    public void setIncremental(final boolean incremental) {
+        this.incremental = incremental;
+    }
 }

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java?rev=1526858&r1=1526857&r2=1526858&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
(original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
Fri Sep 27 11:40:07 2013
@@ -18,11 +18,9 @@
  */
 package org.apache.felix.scrplugin.xml;
 
-import java.awt.Component;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.security.Provider.Service;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.StringTokenizer;
@@ -210,7 +208,7 @@ public class ComponentDescriptorIO {
     }
 
     /**
-     * Write the xml for a {@link Component}.
+     * Write the xml for a Component
      *
      * @param component
      * @param contentHandler
@@ -266,7 +264,7 @@ public class ComponentDescriptorIO {
     }
 
     /**
-     * Write the xml for a {@link Implementation}.
+     * Write the xml for an Implementation.
      *
      * @param implementation
      * @param contentHandler
@@ -284,7 +282,7 @@ public class ComponentDescriptorIO {
     }
 
     /**
-     * Write the xml for a {@link Service}.
+     * Write the xml for a service.
      *
      * @param service
      * @param contentHandler
@@ -310,7 +308,7 @@ public class ComponentDescriptorIO {
     }
 
     /**
-     * Write the xml for a {@link Interface}.
+     * Write the xml for a interface
      *
      * @param interf
      * @param contentHandler
@@ -328,7 +326,7 @@ public class ComponentDescriptorIO {
     }
 
     /**
-     * Write the xml for a {@link Property}.
+     * Write the xml for a property.
      *
      * @param property
      * @param contentHandler
@@ -369,7 +367,7 @@ public class ComponentDescriptorIO {
     }
 
     /**
-     * Write the xml for a {@link Reference}.
+     * Write the xml for a Reference.
      *
      * @param reference
      * @param contentHandler
@@ -752,7 +750,7 @@ public class ComponentDescriptorIO {
         if (components.isEmpty()) {
             logger.debug("No Service Component Descriptors found in project.");
             // remove files if it exists
-            if ( descriptorDir.exists() ) {
+            if ( descriptorDir.exists() && !options.isIncremental()) {
                 for(final File f : descriptorDir.listFiles()) {
                     if ( f.isFile() ) {
                         logger.debug("Removing obsolete service descriptor " + f);

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java?rev=1526858&r1=1526857&r2=1526858&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
(original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
Fri Sep 27 11:40:07 2013
@@ -174,7 +174,7 @@ public class MetaTypeIO {
 
             return fileNames;
         }
-        if (mtDir.exists()) {
+        if (mtDir.exists() && !options.isIncremental()) {
             for(final File f : mtDir.listFiles()) {
                 if ( f.isFile() ) {
                     logger.debug("Removing obsolete metatype file " + f);

Modified: felix/trunk/scrplugin/maven-scr-plugin/changelog.txt
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/maven-scr-plugin/changelog.txt?rev=1526858&r1=1526857&r2=1526858&view=diff
==============================================================================
--- felix/trunk/scrplugin/maven-scr-plugin/changelog.txt (original)
+++ felix/trunk/scrplugin/maven-scr-plugin/changelog.txt Fri Sep 27 11:40:07 2013
@@ -5,6 +5,7 @@ Changes from 1.15.0 to 1.14.0
 ** Bug
     * [FELIX-4192] - SCR Generator fails with a NPE in case a class level Reference doesn't
define a referenceInterface
     * [FELIX-4010] - SCR Plugin aborts when scanning a Java 8 class file
+    * [FELIX-4246] - SCR and Metatype descriptor files get deleted on subsequent (incremental)
eclipse build
 
 
 Changes from 1.14.0 to 1.13.0

Modified: felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java?rev=1526858&r1=1526857&r2=1526858&view=diff
==============================================================================
--- felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
(original)
+++ felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
Fri Sep 27 11:40:07 2013
@@ -201,6 +201,7 @@ public class SCRDescriptorMojo extends A
         options.setStrictMode(strictMode);
         options.setProperties(properties);
         options.setSpecVersion(SpecVersion.fromName(specVersion));
+        options.setIncremental(this.buildContext.isIncremental());
 
         if ( specVersion != null && options.getSpecVersion() == null ) {
             throw new MojoExecutionException("Unknown spec version specified: " + specVersion);



Mime
View raw message