Author: [email protected]
Date: Fri May 15 11:49:00 2009
New Revision: 5395

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

Log:
This patch fixes issue 3444 -- api-checker now accepts ant patterns in the  
excludes list.

Patch by: amitmanjhi
Review by: rjrjr (desk review)



Modified: trunk/build.xml
==============================================================================
--- trunk/build.xml     (original)
+++ trunk/build.xml     Fri May 15 11:49:00 2009
@@ -96,6 +96,7 @@
          <pathelement location="${gwt.build.out}/tools/api-checker/bin"/>
          <fileset dir="${gwt.build.lib}"  
includes="gwt-user.jar,gwt-dev-*.jar" />
          <pathelement path="${java.class.path}"/>
+        <pathelement location="${gwt.tools.lib}/lib/apache/ant-1.6.5.jar"  
/>
        </classpath>
        <arg value="-configFile"/>
        <arg file="${gwt.build.out}/userApi.conf"/>

Modified: trunk/tools/api-checker/config/gwt15_16userApi.conf
==============================================================================
--- trunk/tools/api-checker/config/gwt15_16userApi.conf (original)
+++ trunk/tools/api-checker/config/gwt15_16userApi.conf Fri May 15 11:49:00  
2009
@@ -10,31 +10,18 @@
  excludedFiles_old user/src/com/google/gwt/benchmarks/BenchmarkReport.java\
  :user/src/com/google/gwt/benchmarks/BenchmarkShell.java\
  :user/src/com/google/gwt/benchmarks/client/Benchmark.java\
-:user/src/com/google/gwt/benchmarks/rebind\
-:user/src/com/google/gwt/i18n/rebind\
-:user/src/com/google/gwt/i18n/tools\
+:**/rebind\
+:**/server\
+:**/tools\
  :user/src/com/google/gwt/junit/GWTMockUtilities.java\
  :user/src/com/google/gwt/junit/GWTDummyBridge.java\
  :user/src/com/google/gwt/junit/JUnitMessageQueue.java\
  :user/src/com/google/gwt/junit/JUnitShell.java\
-:user/src/com/google/gwt/junit/RunStyle.java\
-:user/src/com/google/gwt/junit/RunStyleExternalBrowser.java\
-:user/src/com/google/gwt/junit/RunStyleLocalHosted.java\
-:user/src/com/google/gwt/junit/RunStyleLocalWeb.java\
-:user/src/com/google/gwt/junit/RunStyleManual.java\
-:user/src/com/google/gwt/junit/RunStyleRemote.java\
-:user/src/com/google/gwt/junit/RunStyleRemoteWeb.java\
-:user/src/com/google/gwt/junit/RunStyleSelenium.java\
+:user/src/com/google/gwt/junit/RunStyle*.java\
  :user/src/com/google/gwt/junit/client/GWTTestCase.java\
  :user/src/com/google/gwt/junit/client/impl/GWTRunner.java\
-:user/src/com/google/gwt/junit/rebind\
  :user/src/com/google/gwt/junit/remote\
-:user/src/com/google/gwt/junit/server\
-:user/src/com/google/gwt/junit/tools\
  
:user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java\
-:user/src/com/google/gwt/user/rebind\
-:user/src/com/google/gwt/user/server\
-:user/src/com/google/gwt/user/tools\

  ##############################################
  #new Api
@@ -49,38 +36,22 @@
  excludedFiles_new user/src/com/google/gwt/benchmarks/BenchmarkReport.java\
  :user/src/com/google/gwt/benchmarks/BenchmarkShell.java\
  :user/src/com/google/gwt/benchmarks/client/Benchmark.java\
-:user/src/com/google/gwt/benchmarks/rebind\
-:user/src/com/google/gwt/i18n/server\
-:user/src/com/google/gwt/i18n/rebind\
-:user/src/com/google/gwt/i18n/tools\
+:**/rebind\
+:**/server\
+:**/tools\
  :user/src/com/google/gwt/junit/GWTMockUtilities.java\
  :user/src/com/google/gwt/junit/GWTDummyBridge.java\
  :user/src/com/google/gwt/junit/JUnitMessageQueue.java\
  :user/src/com/google/gwt/junit/JUnitShell.java\
-:user/src/com/google/gwt/junit/RunStyle.java\
-:user/src/com/google/gwt/junit/RunStyleExternalBrowser.java\
-:user/src/com/google/gwt/junit/RunStyleLocalHosted.java\
-:user/src/com/google/gwt/junit/RunStyleLocalWeb.java\
-:user/src/com/google/gwt/junit/RunStyleManual.java\
-:user/src/com/google/gwt/junit/RunStyleNoServerHosted.java\
-:user/src/com/google/gwt/junit/RunStyleRemote.java\
-:user/src/com/google/gwt/junit/RunStyleRemoteWeb.java\
-:user/src/com/google/gwt/junit/RunStyleSelenium.java\
+:user/src/com/google/gwt/junit/RunStyle*.java\
  :user/src/com/google/gwt/junit/client/GWTTestCase.java\
  :user/src/com/google/gwt/junit/client/impl/GWTRunner.java\
-:user/src/com/google/gwt/junit/rebind\
  :user/src/com/google/gwt/junit/remote\
-:user/src/com/google/gwt/junit/server\
-:user/src/com/google/gwt/junit/tools\
  :user/src/com/google/gwt/resources/css\
  :user/src/com/google/gwt/resources/ext\
-:user/src/com/google/gwt/resources/rebind\
  :user/src/com/google/gwt/resources/rg\
  
:user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java\
  :user/src/com/google/gwt/user/linker\
-:user/src/com/google/gwt/user/rebind\
-:user/src/com/google/gwt/user/server\
-:user/src/com/google/gwt/user/tools\

  ##############################################
  #excluded packages

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
         
Fri May 15 11:49:00 2009
@@ -26,6 +26,8 @@
  import com.google.gwt.util.tools.ArgHandlerString;
  import com.google.gwt.util.tools.ToolBase;

+import org.apache.tools.ant.types.ZipScanner;
+
  import java.io.BufferedInputStream;
  import java.io.BufferedReader;
  import java.io.File;
@@ -294,9 +296,9 @@
     * file-system.
     */
    private static class SourceFileCompilationUnits extends CompilationUnits  
{
-    private final Set<String> excludedPaths;
      private final Set<File> includedPaths;
      private Set<CompilationUnit> units = null;
+    private final ZipScanner excludeScanner;

      SourceFileCompilationUnits(String dirRoot,
          Set<String> includedPathsAsString, Set<String>  
excludedPathsAsString,
@@ -311,11 +313,21 @@
              + includedPath));
        }

-      excludedPaths = new HashSet<String>();
+      String fullExcludedPaths[] = new  
String[excludedPathsAsString.size()];
+      int count = 0;
+      String dirRootCanonicalPath = getFileFromName("dirRoot: ",  
dirRoot).getCanonicalPath();
        for (String excludedPath : excludedPathsAsString) {
-        excludedPaths.add(getFileFromName("excluded file: ",
-            dirRoot + excludedPath).getCanonicalPath());
+        fullExcludedPaths[count++] = dirRootCanonicalPath + "/" +  
excludedPath;
+      }
+
+      // initialize the ant scanner
+      excludeScanner = new ZipScanner();
+      if (fullExcludedPaths.length > 0) {
+        excludeScanner.setIncludes(fullExcludedPaths);
        }
+      excludeScanner.addDefaultExcludes();
+      excludeScanner.setCaseSensitive(true);
+      excludeScanner.init();
      }

      @Override
@@ -337,7 +349,7 @@
        if (fileName.indexOf(pattern) == 0) {
          fileName = fileName.substring(pattern.length());
        }
-      return excludedPaths.contains(fileName);
+      return excludeScanner.match(fileName);
      }

      private void updateCompilationUnitsInPath(File sourcePathEntry)

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

Reply via email to