Revision: 4500
Author: jasvir
Date: Fri Jun 10 16:01:26 2011
Log: Error message for workaround to ant classpath bug
http://codereview.appspot.com/4581054
Adds a more understandable error message with workaround for ant bug.
Adds missing .xsd file in new version of appengine in third_party that
makes "ant deploy" work correctly.
[email protected]
http://code.google.com/p/google-caja/source/detail?r=4500
Added:
/trunk/third_party/java/appengine/docs/appengine-web.xsd
Modified:
/trunk/src/com/google/caja/tools/AbstractCajaAntTask.java
=======================================
--- /dev/null
+++ /trunk/third_party/java/appengine/docs/appengine-web.xsd Fri Jun 10
16:01:26 2011
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://appengine.google.com/ns/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="appengine-web-app" type="ns:appengine-web-appType"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:complexType name="env-varType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute type="xs:string" name="name" use="required"/>
+ <xs:attribute type="xs:string" name="value" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="system-propertiesType">
+ <xs:sequence>
+ <xs:element type="ns:propertyType" name="property"
maxOccurs="unbounded" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="propertyType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute type="xs:string" name="name" use="required"/>
+ <xs:attribute type="xs:string" name="value" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="appengine-web-appType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="application"/>
+ <xs:element type="xs:string" name="version"/>
+ <xs:element type="ns:static-filesType" name="static-files"
minOccurs="0" xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:element type="ns:resource-filesType" name="resource-files"
minOccurs="0" xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:element type="ns:system-propertiesType" name="system-properties"
minOccurs="0" xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:element type="ns:env-variablesType" name="env-variables"
minOccurs="0" xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:element type="xs:boolean" name="ssl-enabled" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:element type="xs:boolean" name="sessions-enabled" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="env-variablesType">
+ <xs:sequence>
+ <xs:element type="ns:env-varType" name="env-var"
maxOccurs="unbounded" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="includeType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute type="xs:string" name="path" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="resource-filesType">
+ <xs:sequence>
+ <xs:element type="ns:includeType" name="include"
maxOccurs="unbounded" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:element type="ns:excludeType" name="exclude"
maxOccurs="unbounded" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="static-filesType">
+ <xs:sequence>
+ <xs:element type="ns:includeType" name="include"
maxOccurs="unbounded" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ <xs:element type="ns:excludeType" name="exclude"
maxOccurs="unbounded" minOccurs="0"
xmlns:ns="http://appengine.google.com/ns/1.0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="excludeType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute type="xs:string" name="path" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+</xs:schema>
+
=======================================
--- /trunk/src/com/google/caja/tools/AbstractCajaAntTask.java Thu Apr 14
16:04:47 2011
+++ /trunk/src/com/google/caja/tools/AbstractCajaAntTask.java Fri Jun 10
16:01:26 2011
@@ -32,6 +32,7 @@
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
+import org.w3c.dom.DOMException;
/**
* An ANT task that operates on a set of files to produce a single output
file
@@ -210,6 +211,14 @@
} else {
throw new BuildException("Failed to build " + output);
}
+ } catch (DOMException e) {
+ // Report a more understandble message for Ant bug
+ if (DOMException.NAMESPACE_ERR == e.code) {
+ throw new RuntimeException("\n\nCaja encountered a bug in
Ant. " +
+ "Please rerun ant with xercesImpl.jar on the path eg.:\n" +
+ "CLASSPATH=third_party/java/xerces/xercesImpl.jar: ant",
e);
+ }
+ throw e;
} finally {
if (!success) {
if (outputTimeFile.exists()) { outputTimeFile.delete(); }