You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2005/02/04 17:48:27 UTC

svn commit: r151367 - incubator/jackrabbit/trunk/maven.xml

Author: mreutegg
Date: Fri Feb  4 08:48:25 2005
New Revision: 151367

URL: http://svn.apache.org/viewcvs?view=rev&rev=151367
Log:
Extended maven.xml to only generate parser classes when necessary. Speeds up test run in maven ;)

Modified:
    incubator/jackrabbit/trunk/maven.xml

Modified: incubator/jackrabbit/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/maven.xml?view=diff&r1=151366&r2=151367
==============================================================================
--- incubator/jackrabbit/trunk/maven.xml (original)
+++ incubator/jackrabbit/trunk/maven.xml Fri Feb  4 08:48:25 2005
@@ -16,124 +16,159 @@
 -->
 
 <project
-  default="jar:jar"
-  xmlns:j="jelly:core"
-  xmlns:ant="jelly:ant">
-
-   <postGoal name="ant:generate-build">
-      <attainGoal   name="jackrabbit:post-ant"/>
-   </postGoal>
-   
-   <!-- Goal adds a line to build.xml to include the ./lib in ant classpath -->
-   <!-- Once jcr.jar is in a maven repository this can be removed -->
-   <goal name="jackrabbit:post-ant">
-      <ant:replace 
-         file="build.xml"
-         token="&lt;path id=&quot;build.classpath&quot;&gt;"
-         value="&lt;path id=&quot;build.classpath&quot;&gt;&lt;fileset dir=&quot;./lib&quot;&gt;&lt;include name=&quot;**/*.jar&quot;>&lt;/include&gt;&lt;/fileset&gt;"
-      />
-   </goal>
-
-   <postGoal name="maven-javadoc-plugin:report">
-      <attainGoal   name="jackrabbit:post-javadoc"/>
-   </postGoal>
-   
-   <!-- Goal strips the javadov generated datestamp -->
-   <goal name="jackrabbit:post-javadoc">
-      <ant:replaceregexp
-           match="-- Generated by javadoc .*--"
-         replace="-- Generated by javadoc --" flags="g" byline="true">
-           <ant:fileset dir="${maven.javadoc.destdir}" includes="**/*.html">
-             <ant:depth max="20"/>
-           </ant:fileset>
-      </ant:replaceregexp>
-   </goal>
-   
-   <!-- Additionally cleans the test data created -->
-   <postGoal name="clean">
-      <attainGoal name="test:clean"/>
-   </postGoal>
-   
-   <!-- deletes the test data -->
-   <goal name="test:clean">
-      <ant:delete includeEmptyDirs="true">
-         <ant:fileset dir="applications/test/repository">
-            <ant:include name="**/*"/>
-            <ant:exclude name="**/custom_nodetypes.xml"/>
-         </ant:fileset>
-      </ant:delete>
-      <ant:delete includeEmptyDirs="true">
-         <ant:fileset dir="applications/test/workspaces">
-            <ant:include name="**/*"/>
-            <ant:exclude name="**/workspace.xml"/>
-         </ant:fileset>
-      </ant:delete>      
-      <ant:delete dir="applications/test/tx"/>
-      <ant:delete dir="applications/test/version"/>
-   </goal>
-   
-   <postGoal name="java:prepare-filesystem">
-      <attainGoal name="jackrabbit:generate-parsers"/>
-   </postGoal>
-   
-   <goal name="jackrabbit:generate-parsers">
-      <!-- SQL Parser -->
-      <ant:java classname="jjtree" fork="true">
-         <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/sql"/>
-         <arg value="src/grammar/sql/JCRSQL.jjt"/>
-         <classpath>
-            <fileset dir="${maven.repo.local}/javacc/jars">
-               <include name="javacc-3.2.jar"/>
-            </fileset>
-         </classpath>
-      </ant:java>
-      <ant:java classname="javacc" fork="true">
-         <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/sql"/>
-         <arg value="src/java/org/apache/jackrabbit/core/search/sql/JCRSQL.jj"/>
-         <classpath>
-            <fileset dir="${maven.repo.local}/javacc/jars">
-               <include name="javacc-3.2.jar"/>
-            </fileset>
-         </classpath>
-      </ant:java>
-
-
-      <!-- XPath Parser -->
-      <!-- The following is a hack to get xslt work with maven (See: http://maven.apache.org/faq.html#BadXSLT ) -->
-      ${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')}
-      
-      <ant:xslt style="src/grammar/xpath/strip.xsl"
-             in="src/grammar/xpath/xpath-grammar.xml"
-             out="src/grammar/xpath/stripped-xpath-grammar.xml"
-             force="yes">
-      </ant:xslt>
-      <ant:xslt style="src/grammar/xpath/jjtree-jackrabbit.xsl"
-             in="src/grammar/xpath/stripped-xpath-grammar.xml"
-             out="src/grammar/xpath/XPath.jjt"
-             force="yes">
-      </ant:xslt>
-
-
-      <ant:java classname="jjtree" fork="true">
-         <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/xpath"/>
-         <arg value="src/grammar/xpath/XPath.jjt"/>
-         <classpath>
-            <fileset dir="${maven.repo.local}/javacc/jars">
-               <include name="javacc-3.2.jar"/>
-            </fileset>
-         </classpath>
-      </ant:java>
-      <ant:java classname="javacc" fork="true">
-         <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/xpath"/>
-         <arg value="-UNICODE_INPUT=true"/>
-         <arg value="src/java/org/apache/jackrabbit/core/search/xpath/XPath.jj"/>
-         <classpath>
-            <fileset dir="${maven.repo.local}/javacc/jars">
-               <include name="javacc-3.2.jar"/>
-            </fileset>
-         </classpath>
-      </ant:java>
-
-   </goal>
-
+    default="jar:jar"
+    xmlns:j="jelly:core"
+    xmlns:ant="jelly:ant">
+
+    <postGoal name="ant:generate-build">
+        <attainGoal name="jackrabbit:post-ant"/>
+    </postGoal>
+
+    <!-- Goal adds a line to build.xml to include the ./lib in ant classpath -->
+    <!-- Once jcr.jar is in a maven repository this can be removed -->
+    <goal name="jackrabbit:post-ant">
+        <ant:replace
+            file="build.xml"
+            token="&lt;path id=&quot;build.classpath&quot;&gt;"
+            value="&lt;path id=&quot;build.classpath&quot;&gt;&lt;fileset dir=&quot;./lib&quot;&gt;&lt;include name=&quot;**/*.jar&quot;>&lt;/include&gt;&lt;/fileset&gt;"
+            />
+    </goal>
+
+    <postGoal name="maven-javadoc-plugin:report">
+        <attainGoal name="jackrabbit:post-javadoc"/>
+    </postGoal>
+
+    <!-- Goal strips the javadov generated datestamp -->
+    <goal name="jackrabbit:post-javadoc">
+        <ant:replaceregexp
+            match="-- Generated by javadoc .*--"
+            replace="-- Generated by javadoc --" flags="g" byline="true">
+            <ant:fileset dir="${maven.javadoc.destdir}" includes="**/*.html">
+                <ant:depth max="20"/>
+            </ant:fileset>
+        </ant:replaceregexp>
+    </goal>
+
+    <!-- Additionally cleans the test data created -->
+    <postGoal name="clean">
+        <attainGoal name="test:clean"/>
+    </postGoal>
+
+    <!-- deletes the test data -->
+    <goal name="test:clean">
+        <ant:delete includeEmptyDirs="true">
+            <ant:fileset dir="applications/test/repository">
+                <ant:include name="**/*"/>
+                <ant:exclude name="**/custom_nodetypes.xml"/>
+            </ant:fileset>
+        </ant:delete>
+        <ant:delete includeEmptyDirs="true">
+            <ant:fileset dir="applications/test/workspaces">
+                <ant:include name="**/*"/>
+                <ant:exclude name="**/workspace.xml"/>
+            </ant:fileset>
+        </ant:delete>
+        <ant:delete dir="applications/test/tx"/>
+        <ant:delete dir="applications/test/version"/>
+    </goal>
+
+    <!-- Generates the SQL / XPath parsers if necessary -->
+    <postGoal name="java:prepare-filesystem">
+        <ant:condition property="sqlparser_stale">
+            <ant:not>
+                <ant:uptodate targetfile="src/java/org/apache/jackrabbit/core/search/sql/JCRSQLParser.java">
+                    <ant:srcfiles dir="src/grammar/sql">
+                        <ant:include name="JCRSQL.jjt"/>
+                    </ant:srcfiles>
+                </ant:uptodate>
+            </ant:not>
+        </ant:condition>
+        <j:choose>
+            <j:when test="${sqlparser_stale == 'true'}">
+                <attainGoal name="jackrabbit:generate-sql-parser"/>
+            </j:when>
+            <j:otherwise>
+                <ant:echo>SQL Parser up-to-date</ant:echo>
+            </j:otherwise>
+        </j:choose>
+        <ant:condition property="xpathparser_stale">
+            <ant:not>
+                <ant:uptodate targetfile="src/java/org/apache/jackrabbit/core/search/xpath/XPath.java">
+                    <ant:srcfiles dir="src/grammar/xpath">
+                        <ant:include name="javacc.xsl"/>
+                        <ant:include name="jjtree.xsl"/>
+                        <ant:include name="jjtree-jackrabbit.xsl"/>
+                        <ant:include name="strip.xsl"/>
+                        <ant:include name="xpath-grammar.xml"/>
+                    </ant:srcfiles>
+                </ant:uptodate>
+            </ant:not>
+        </ant:condition>
+        <j:choose>
+            <j:when test="${xpathparser_stale == 'true'}">
+                <attainGoal name="jackrabbit:generate-xpath-parser"/>
+            </j:when>
+            <j:otherwise>
+                <ant:echo>XPath Parser up-to-date</ant:echo>
+            </j:otherwise>
+        </j:choose>
+    </postGoal>
+
+    <!-- Generates the SQL Parser -->
+    <goal name="jackrabbit:generate-sql-parser">
+        <ant:java classname="jjtree" fork="true">
+            <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/sql"/>
+            <arg value="src/grammar/sql/JCRSQL.jjt"/>
+            <classpath>
+                <fileset dir="${maven.repo.local}/javacc/jars">
+                    <include name="javacc-3.2.jar"/>
+                </fileset>
+            </classpath>
+        </ant:java>
+        <ant:java classname="javacc" fork="true">
+            <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/sql"/>
+            <arg value="src/java/org/apache/jackrabbit/core/search/sql/JCRSQL.jj"/>
+            <classpath>
+                <fileset dir="${maven.repo.local}/javacc/jars">
+                    <include name="javacc-3.2.jar"/>
+                </fileset>
+            </classpath>
+        </ant:java>
+    </goal>
+
+    <!-- Generates the XPath Parser -->
+    <goal name="jackrabbit:generate-xpath-parser">
+        <!-- The following is a hack to get xslt work with maven (See: http://maven.apache.org/faq.html#BadXSLT ) -->
+        ${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')}
+        <ant:xslt style="src/grammar/xpath/strip.xsl"
+            in="src/grammar/xpath/xpath-grammar.xml"
+            out="src/grammar/xpath/stripped-xpath-grammar.xml"
+            force="yes">
+        </ant:xslt>
+        <ant:xslt style="src/grammar/xpath/jjtree-jackrabbit.xsl"
+            in="src/grammar/xpath/stripped-xpath-grammar.xml"
+            out="src/grammar/xpath/XPath.jjt"
+            force="yes">
+        </ant:xslt>
+
+        <ant:java classname="jjtree" fork="true">
+            <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/xpath"/>
+            <arg value="src/grammar/xpath/XPath.jjt"/>
+            <classpath>
+                <fileset dir="${maven.repo.local}/javacc/jars">
+                    <include name="javacc-3.2.jar"/>
+                </fileset>
+            </classpath>
+        </ant:java>
+        <ant:java classname="javacc" fork="true">
+            <arg value="-OUTPUT_DIRECTORY=src/java/org/apache/jackrabbit/core/search/xpath"/>
+            <arg value="-UNICODE_INPUT=true"/>
+            <arg value="src/java/org/apache/jackrabbit/core/search/xpath/XPath.jj"/>
+            <classpath>
+                <fileset dir="${maven.repo.local}/javacc/jars">
+                    <include name="javacc-3.2.jar"/>
+                </fileset>
+            </classpath>
+        </ant:java>
+    </goal>
 </project>