blob: 8beb9be36946699ad4321e54ce1c127526f87821 [file] [log] [blame]
Index: extra-targets.xml
===================================================================
--- extra-targets.xml (revision 1555925)
+++ extra-targets.xml (working copy)
@@ -105,7 +105,10 @@
<groovy taskname="svn" classpathref="svnkit.classpath"><![CDATA[
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.wc.*;
+ import org.apache.tools.ant.Project;
+ def RECOMMENDED_SVNKIT_18 = '1.8.2';
+
SVNClientManager manager = SVNClientManager.newInstance();
SVNStatusClient statusClient = manager.getStatusClient();
SVNWCClient wcClient = manager.getWCClient();
@@ -115,6 +118,24 @@
def convertRelative = {
file -> '.' + file.getAbsolutePath().substring(baseLen).replace(File.separatorChar, (char)'/');
}
+
+ // do some fake check, to verify if this is valid SVN working copy. If this fails ignore checks but log some useful message.
+ try {
+ statusClient.doStatus(basedir, false);
+ } catch (SVNException ex) {
+ int code = ex.getErrorMessage().getErrorCode().getCode();
+ if (code == SVNErrorCode.WC_UNSUPPORTED_FORMAT.getCode()) {
+ task.log('WARNING: Unsupported SVN working copy version! Disabling checks...', Project.MSG_WARN);
+ task.log('If your working copy is on version 1.8 already, please pass -Dsvnkit.version=' + RECOMMENDED_SVNKIT_18 + ' to successfully run checks.', Project.MSG_INFO);
+ return;
+ } else if (code == SVNErrorCode.WC_NOT_DIRECTORY.getCode() || code == SVNErrorCode.WC_NOT_FILE.getCode()) {
+ task.log('WARNING: Development directory is not an SVN checkout! Disabling checks...', Project.MSG_WARN);
+ return;
+ } else {
+ task.log('WARNING: Development directory is not a valid SVN checkout (' + ex.getErrorMessage() + '). Disabling checks...', Project.MSG_WARN);
+ return;
+ }
+ }
Set missingProps = new TreeSet(), unversioned = new TreeSet(), changed = new TreeSet();