]> source.dussan.org Git - vaadin-framework.git/commitdiff
avoid rewriting gwt module if changes did not happen
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 15 Oct 2009 12:34:28 +0000 (12:34 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 15 Oct 2009 12:34:28 +0000 (12:34 +0000)
svn changeset:9211/svn branch:6.2

src/com/vaadin/terminal/gwt/widgetsetutils/WidgetSetBuilder.java

index c2c888c4bb433203b04185ebaea0c3827f11a587..13516a73c2d41e488dab3a0815ab3014ebbf3114 100644 (file)
@@ -34,6 +34,7 @@ public class WidgetSetBuilder {
 
     public static void updateWidgetSet(final String widgetset, String sourcepath)
             throws IOException, FileNotFoundException {
+        boolean changed = false;
         String widgetsetfilename = sourcepath + "/"
                 + widgetset.replace(".", "/") + ".gwt.xml";
         File widgetsetFile = new File(widgetsetfilename);
@@ -44,9 +45,11 @@ public class WidgetSetBuilder {
                     widgetsetFile));
             printStream.print("<module>\n\n</module>\n");
             printStream.close();
+            changed = true;
         }
 
         String content = readFile(widgetsetFile);
+        String originalContent = content;
 
         Collection<String> oldInheritedWidgetsets = getCurrentWidgetSets(content);
 
@@ -71,7 +74,10 @@ public class WidgetSetBuilder {
             }
         }
 
-        commitChanges(widgetsetfilename, content);
+        changed = changed ? true : content.equals(originalContent);
+        if (changed) {
+            commitChanges(widgetsetfilename, content);
+        }
     }
 
     private static String removeWidgetSet(String ws, String content) {