Author: desruisseaux
Date: Thu May 19 00:14:11 2016
New Revision: 1744472

URL: http://svn.apache.org/viewvc?rev=1744472&view=rev
Log:
Do not overwrite the standard CSS file when Javadoc plugin is executed more 
than once without "mvn clean".

Modified:
    sis/branches/JDK7/   (props changed)
    
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
    
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 19 00:14:11 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1744335
+/sis/branches/JDK8:1584960-1744471
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: 
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java?rev=1744472&r1=1744471&r2=1744472&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
 [UTF-8] Thu May 19 00:14:11 2016
@@ -52,7 +52,7 @@ import com.sun.tools.doclets.formats.htm
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.7
  * @module
  */
 public final class Doclet extends HtmlDoclet {
@@ -99,7 +99,7 @@ public final class Doclet extends HtmlDo
             copyResources(customCSS.getParentFile(), output);
             final Rewriter r = new Rewriter();
             for (final File file : output.listFiles()) {
-                if (file.isDirectory()) {  // Do not process files in the root 
directory, only in sub-directories.
+                if (file.isDirectory()) {       // Do not process files in the 
root directory, only in sub-directories.
                     r.processDirectory(file);
                 }
             }
@@ -150,6 +150,7 @@ public final class Doclet extends HtmlDo
 
     /**
      * Copies the standard CSS file, then copies the custom CSS file.
+     * If the {@value #RENAMED_CSS} file already exists, it will not be 
overwritten.
      *
      * @param  inputFile        The custom CSS file to copy in the destination 
directory.
      * @param  outputDirectory  The directory where to copy the CSS file.
@@ -158,18 +159,20 @@ public final class Doclet extends HtmlDo
     private static void copyStylesheet(final File inputFile, final File 
outputDirectory) throws IOException {
         final File stylesheetFile = new File(outputDirectory, STYLESHEET);
         final File standardFile   = new File(outputDirectory, RENAMED_CSS);
-        /*
-         * Copy the standard CSS file, skipping the import of DejaVu font
-         * since our custom CSS file does not use it.
-         */
-        try (final BufferedReader in  = openReader(stylesheetFile);
-             final BufferedWriter out = openWriter(standardFile))
-        {
-            String line;
-            while ((line = in.readLine()) != null) {
-                if (!line.equals("@import 
url('resources/fonts/dejavu.css');")) {
-                    out.write(line);
-                    out.newLine();
+        if (!standardFile.exists()) {
+            /*
+             * Copy the standard CSS file, skipping the import of DejaVu font
+             * since our custom CSS file does not use it.
+             */
+            try (final BufferedReader in  = openReader(stylesheetFile);
+                 final BufferedWriter out = openWriter(standardFile))
+            {
+                String line;
+                while ((line = in.readLine()) != null) {
+                    if (!line.equals("@import 
url('resources/fonts/dejavu.css');")) {
+                        out.write(line);
+                        out.newLine();
+                    }
                 }
             }
         }

Modified: 
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java?rev=1744472&r1=1744471&r2=1744472&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java
 [UTF-8] Thu May 19 00:14:11 2016
@@ -21,7 +21,7 @@
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.7
  * @module
  */
 package org.apache.sis.internal.doclet;


Reply via email to