Author: [email protected]
Date: Mon Jul 13 05:30:55 2009
New Revision: 5721

Modified:
    trunk/build.xml
     
trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java

Log:
Fixes so apichecker works on Windows, by making the refJar path an  
ant "path" <arg> and splitting
on path.separator, not ":".  Also, arg parsing is changed to return an  
error status, so typos and
such stop the builds.

Modified: trunk/build.xml
==============================================================================
--- trunk/build.xml     (original)
+++ trunk/build.xml     Mon Jul 13 05:30:55 2009
@@ -152,7 +152,7 @@
          <pathelement location="${gwt.tools.lib}/apache/ant-1.6.5.jar" />
        </classpath>
        <arg value="-refJar"/>
-      <arg  
value="${gwt.root}/tools/api-checker/reference/gwt-dev-modified.jar:${gwt.root}/tools/api-checker/reference/gwt-user-modified.jar"/>
+      <arg  
path="${gwt.root}/tools/api-checker/reference/gwt-dev-modified.jar:${gwt.root}/tools/api-checker/reference/gwt-user-modified.jar"/>
        <arg value="-configFile"/>
        <arg file="${gwt.build.out}/userApi.conf"/>
        <arg value="-logLevel"/>

Modified:  
trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
==============================================================================
---  
trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
         
(original)
+++  
trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
         
Mon Jul 13 05:30:55 2009
@@ -455,66 +455,70 @@
    public static void main(String args[]) {
      try {
        ApiCompatibilityChecker checker = new ApiCompatibilityChecker();
-      if (checker.processArgs(args)) {
-        ApiContainer newApi = null, existingApi = null;
-
-        AbstractTreeLogger logger = new PrintWriterTreeLogger();
-        logger.setMaxDetail(checker.type);
-        logger.log(TreeLogger.INFO, "gwtDevJar = " + checker.gwtDevJar
-            + ", userJar = " + checker.gwtUserJar + ", refjars = "
-            + Arrays.toString(checker.refJars) + ", logLevel = " +  
checker.type
-            + ", printAllApi = " + checker.printAllApi, null);
-
-        Set<String> excludedPackages =  
checker.getSetOfExcludedPackages(checker.configProperties);
-        if (PROCESS_NEW_API) {
-          Set<CompilationUnit> units = new HashSet<CompilationUnit>();
+      if (!checker.processArgs(args)) {
+        // if we couldn't parse arguments, return non-zero so the build  
breaks
+        System.exit(1);
+      }
+
+      ApiContainer newApi = null, existingApi = null;
+
+      AbstractTreeLogger logger = new PrintWriterTreeLogger();
+      logger.setMaxDetail(checker.type);
+      logger.log(TreeLogger.INFO, "gwtDevJar = " + checker.gwtDevJar
+          + ", userJar = " + checker.gwtUserJar + ", refjars = "
+          + Arrays.toString(checker.refJars) + ", logLevel = " +  
checker.type
+          + ", printAllApi = " + checker.printAllApi, null);
+
+      Set<String> excludedPackages =  
checker.getSetOfExcludedPackages(checker.configProperties);
+      if (PROCESS_NEW_API) {
+        Set<CompilationUnit> units = new HashSet<CompilationUnit>();
+        units.addAll(new SourceFileCompilationUnits(
+            checker.configProperties.getProperty("dirRoot_new"),
+            checker.getConfigPropertyAsSet("sourceFiles_new"),
+            checker.getConfigPropertyAsSet("excludedFiles_new"),  
logger).getCompilationUnits());
+        units.addAll(checker.getGwtCompilationUnits(logger));
+        newApi = new ApiContainer(
+            checker.configProperties.getProperty("name_new"), units,
+            excludedPackages, logger);
+        if (checker.printAllApi) {
+          logger.log(TreeLogger.INFO, newApi.getApiAsString());
+        }
+      }
+      if (PROCESS_EXISTING_API) {
+        Set<CompilationUnit> units = new HashSet<CompilationUnit>();
+        if (checker.refJars == null) {
            units.addAll(new SourceFileCompilationUnits(
-              checker.configProperties.getProperty("dirRoot_new"),
-              checker.getConfigPropertyAsSet("sourceFiles_new"),
-              checker.getConfigPropertyAsSet("excludedFiles_new"),  
logger).getCompilationUnits());
-          units.addAll(checker.getGwtCompilationUnits(logger));
-          newApi = new ApiContainer(
-              checker.configProperties.getProperty("name_new"), units,
-              excludedPackages, logger);
-          if (checker.printAllApi) {
-            logger.log(TreeLogger.INFO, newApi.getApiAsString());
-          }
+              checker.configProperties.getProperty("dirRoot_old"),
+              checker.getConfigPropertyAsSet("sourceFiles_old"),
+              checker.getConfigPropertyAsSet("excludedFiles_old"),  
logger).getCompilationUnits());
+        } else {
+          units.addAll(new JarFileCompilationUnits(checker.refJars,
+              checker.getConfigPropertyAsSet("sourceFiles_old"),
+              checker.getConfigPropertyAsSet("excludedFiles_old"),  
logger).getCompilationUnits());
          }
-        if (PROCESS_EXISTING_API) {
-          Set<CompilationUnit> units = new HashSet<CompilationUnit>();
-          if (checker.refJars == null) {
-            units.addAll(new SourceFileCompilationUnits(
-                checker.configProperties.getProperty("dirRoot_old"),
-                checker.getConfigPropertyAsSet("sourceFiles_old"),
-                checker.getConfigPropertyAsSet("excludedFiles_old"),  
logger).getCompilationUnits());
-          } else {
-            units.addAll(new JarFileCompilationUnits(checker.refJars,
-                checker.getConfigPropertyAsSet("sourceFiles_old"),
-                checker.getConfigPropertyAsSet("excludedFiles_old"),  
logger).getCompilationUnits());
-          }
-          units.addAll(checker.getGwtCompilationUnits(logger));
-          existingApi = new ApiContainer(
-              checker.configProperties.getProperty("name_old"), units,
-              excludedPackages, logger);
-          if (checker.printAllApi) {
-            logger.log(TreeLogger.INFO, existingApi.getApiAsString());
-          }
+        units.addAll(checker.getGwtCompilationUnits(logger));
+        existingApi = new ApiContainer(
+            checker.configProperties.getProperty("name_old"), units,
+            excludedPackages, logger);
+        if (checker.printAllApi) {
+          logger.log(TreeLogger.INFO, existingApi.getApiAsString());
          }
+      }

-        if (PROCESS_NEW_API && PROCESS_EXISTING_API) {
-          Collection<ApiChange> apiDifferences = getApiDiff(newApi,
-              existingApi, checker.whiteList);
-          for (ApiChange apiChange : apiDifferences) {
-            System.out.println(apiChange);
-          }
-          if (apiDifferences.size() == 0) {
-            System.out.println("API compatibility check SUCCESSFUL");
-          } else {
-            System.out.println("API compatibility check FAILED");
-          }
-          System.exit(apiDifferences.size() == 0 ? 0 : 1);
+      if (PROCESS_NEW_API && PROCESS_EXISTING_API) {
+        Collection<ApiChange> apiDifferences = getApiDiff(newApi,
+            existingApi, checker.whiteList);
+        for (ApiChange apiChange : apiDifferences) {
+          System.out.println(apiChange);
+        }
+        if (apiDifferences.size() == 0) {
+          System.out.println("API compatibility check SUCCESSFUL");
+        } else {
+          System.out.println("API compatibility check FAILED");
          }
+        System.exit(apiDifferences.size() == 0 ? 0 : 1);
        }
+
      } catch (Throwable t) {
        // intercepting all exceptions in main, because I have to exit with  
-1 so
        // that the build breaks.
@@ -658,7 +662,7 @@

        @Override
        public boolean setString(String str) {
-        String refJarStrings[] = str.split(":");
+        String refJarStrings[] =  
str.split(System.getProperty("path.separator"));
          refJars = new JarFile[refJarStrings.length];
          int count = 0;
          for (String refJarString : refJarStrings) {

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to