Author: [EMAIL PROTECTED]
Date: Mon Oct  6 11:49:45 2008
New Revision: 3717

Modified:
    trunk/build-tools/ant-gwt/src/com/google/gwt/ant/taskdefs/SvnInfo.java

Log:
Fix SvnInfo to handle a non-svn workspace: can't deduce the version
available, but it won't stop the build either.

Patch by: [EMAIL PROTECTED]
Review by: fabbott



Modified:  
trunk/build-tools/ant-gwt/src/com/google/gwt/ant/taskdefs/SvnInfo.java
==============================================================================
--- trunk/build-tools/ant-gwt/src/com/google/gwt/ant/taskdefs/SvnInfo.java      
 
(original)
+++ trunk/build-tools/ant-gwt/src/com/google/gwt/ant/taskdefs/SvnInfo.java      
 
Mon Oct  6 11:49:45 2008
@@ -57,9 +57,20 @@
      if (!workDirFile.isDirectory()) {
        throw new BuildException(workdir + " is not a directory");
      }
+
+    String branch;
+    String revision;
+
+    File svnDirFile = new File(workdir, ".svn");
+    if (!svnDirFile.exists()) {
+      // This is not svn workdir. We can't guess the version...
+      branch = "unknown";
+      revision = "unknown";
+    } else {
+      branch = getSvnBranch(workDirFile);
+      revision = getSvnVersion(workDirFile);
+    }

-    String branch = getSvnBranch(workDirFile);
-    String revision = getSvnVersion(workDirFile);
      getProject().setNewProperty(outprop, branch + "@" + revision);
      if (fileprop != null) {
        getProject().setNewProperty(fileprop, branch + "-"

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

Reply via email to