directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r109985 - /incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly /incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java
Date Mon, 06 Dec 2004 15:43:51 GMT
Author: akarasulu
Date: Mon Dec  6 07:43:50 2004
New Revision: 109985

URL: http://svn.apache.org/viewcvs?view=rev&rev=109985
Log:
Changes ...

 o added member and methods to test for failures in task and capture the fault
 o used these methods to trigger plugin failure rather than using <catch>
 o this fixes the following issue in JIRA:

     http://nagoya.apache.org/jira/browse/DIREVE-106


Modified:
   incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly
   incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java

Modified: incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly?view=diff&rev=109985&p1=incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly&r1=109984&p2=incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly&r2=109985
==============================================================================
--- incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly	(original)
+++ incubator/directory/eve/trunk/maven-eve-plugin/plugin.jelly	Mon Dec  6 07:43:50 2004
@@ -45,29 +45,24 @@
           
             <j:set var="ownerProp" value="maven.eve.schema.owner.${schema}"/>
             <j:set var="owner" value="${context.getVariable(ownerProp)}"
-            	defaultValue="${maven.eve.schema.ownerDefault}"/>
-			
+                defaultValue="${maven.eve.schema.ownerDefault}"/>
             <j:set var="packageProp" value="maven.eve.schema.package.${schema}"/>
             <j:set var="package" value="${context.getVariable(packageProp)}"
-            	defaultValue="${maven.eve.schema.packageDefault}"/>
-			
+                defaultValue="${maven.eve.schema.packageDefault}"/>
             <j:set var="depsProp" value="maven.eve.schema.deps.${schema}"/>
             <j:set var="deps" value="${context.getVariable(depsProp)}"/>
 
-			<!--
-			<echo>======= schema: ${schema} ======= </echo>
-			<echo>maven.eve.schema.owner.${schema} = ${owner}</echo>
-			<echo>maven.eve.schema.package.${schema} = ${package}</echo>
-			<echo>maven.eve.schema.deps.${schema} = ${deps}</echo>
-			-->
-
                         <!-- Basedir sysprop not set when not forking -->
-                        <j:set var="noop" value="${systemScope.setProperty('basedir',
basedir)}"/>
-			<j:useBean var="task" class="org.apache.eve.tools.schema.EveSchemaToolTask" 
-				name="${schema}" owner="${owner}" package="${package}" dependencies="${deps}"/>
+            <j:set var="noop" value="${systemScope.setProperty('basedir', basedir)}"/>
+
+            <j:useBean var="task" class="org.apache.eve.tools.schema.EveSchemaToolTask"
+			    name="${schema}" owner="${owner}" package="${package}" dependencies="${deps}"/>
 			<j:expr value="${task.execute()}"/>
-			<echo>Generated schema producer classes for ${schema}.schema</echo>
-                        <!-- TODO: need to honour failures! -->
+            <j:if test="${task.hasFaulted()}">
+                <fail message="${task.getLastFault().getMessage()}"/>
+            </j:if>
+            <echo>Generated schema producer classes for ${schema}.schema</echo>
+
           </j:forEach>
           
         </j:if>

Modified: incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java
Url: http://svn.apache.org/viewcvs/incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java?view=diff&rev=109985&p1=incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java&r1=109984&p2=incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java&r2=109985
==============================================================================
--- incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java
(original)
+++ incubator/directory/eve/trunk/maven-eve-plugin/src/java/org/apache/eve/tools/schema/EveSchemaToolTask.java
Mon Dec  6 07:43:50 2004
@@ -33,6 +33,7 @@
     private String name;
     private String owner;
     private String[] dependencies;
+    private BuildException lastFault;
 
 
     public void setPackage( String pkg )
@@ -75,7 +76,8 @@
         }
         catch ( Exception e )
         {
-            throw new BuildException( "Failed to create schema tool", e );
+            lastFault = new BuildException( "Failed to create schema tool", e );
+            throw lastFault;
         }
 
         AbstractBootstrapSchema schema =
@@ -88,12 +90,25 @@
         }
         catch ( Exception e )
         {
-            throw new BuildException( "Failed to generate " + name +
+            lastFault = new BuildException( "Failed to generate " + name +
                     " schema classes in package " + pkg, e );
+            throw lastFault;
         }
     }
-    
-    
+
+
+    public BuildException getLastFault()
+    {
+        return lastFault;
+    }
+
+
+    public boolean hasFaulted()
+    {
+        return lastFault != null;
+    }
+
+
     public String toString()
     {
     	StringBuffer buf = new StringBuffer();

Mime
View raw message