| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright 2005 The Apache Software Foundation |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <project default="default" |
| xmlns:j="jelly:core" |
| xmlns:ant="jelly:ant" |
| xmlns:maven="jelly:maven" |
| > |
| |
| <!-- ==================== --> |
| <!-- Default Global Goals --> |
| <!-- ==================== --> |
| |
| <goal name="default"> |
| <attainGoal name="jar:install-snapshot"/> |
| </goal> |
| |
| <goal name="build"> |
| <attainGoal name="default"/> |
| </goal> |
| |
| <goal name="rebuild"> |
| <attainGoal name="clean"/> |
| <attainGoal name="build"/> |
| </goal> |
| |
| <postGoal name="test:prepare-filesystem"> |
| <mkdir dir="${jdo.testdir}"/> |
| </postGoal> |
| |
| <preGoal name="java:compile"> |
| <attainGoal name="antlr.compile"/> |
| </preGoal> |
| |
| <preGoal name="test:test"> |
| <attainGoal name="pcclasses"/> |
| <attainGoal name="testjar.build"/> |
| <attainGoal name="fsuid2.build"/> |
| </preGoal> |
| |
| <postGoal name="clean:clean"> |
| <attainGoal name="antlr.clean"/> |
| <delete file="${jdo.pcclasses.jarfile}"/> |
| <delete file="${jdo.testclasses.jarfile}"/> |
| <ant dir="${basedir}/test/fsuid2" target="clean"/> |
| <ant dir="${basedir}/test/enhancer/sempdept" target="clean" inheritAll="false"/> |
| </postGoal> |
| |
| <goal name="clobber" prereqs="clean"> |
| <delete> |
| <fileset dir="." defaultexcludes="no" includes="**/*~"/> |
| </delete> |
| <ant dir="${basedir}/test/fsuid2" target="clobber"/> |
| <ant dir="${basedir}/test/enhancer/sempdept" target="mrproper" inheritAll="false"/> |
| </goal> |
| |
| <!-- ================== --> |
| <!-- Running test cases --> |
| <!-- ================== --> |
| |
| <goal name="runtest"> |
| <attainGoal name="runtest.list"/> |
| <attainGoal name="runtest.security"/> |
| <attainGoal name="runtest.multiJVMtests"/> |
| </goal> |
| |
| <!-- Runs all tests from the specified test list in batch mode. --> |
| <goal name="runtest.list" prereqs="pcclasses, testjar.build"> |
| <ant target="runtest.list" |
| dir="${basedir}/test" antfile="runtest.xml"> |
| <property name="testlist" value="${jdo.testlist}"/> |
| <property name="jdoapi" value="${jdo.jdoapi.jarfile}"/> |
| <property name="jdobtree" value="${jdo.jdobtree.jarfile}"/> |
| <property name="jdori" value="${maven.build.dir}/classes"/> |
| <property name="jdoritests" value="${jdo.testclasses.jarfile}"/> |
| <property name="pcclasses" value="${jdo.pcclasses.jarfile}"/> |
| <property name="testdir" value="${jdo.testdir}"/> |
| <property name="fsuidjar" value="${jdo.fsuid.jarfile}"/> |
| <property name="junit" value="${junit.jarfile}"/> |
| <property name="jta" value="${jta.jarfile}"/> |
| <property name="antlr" value="${antlr.jarfile}"/> |
| <property name="logging" value="${logging.jarfile}"/> |
| <property name="jndi" value="${jndi}"/> |
| <property name="xmlparser" value="${xmlparser}"/> |
| <property name="status.verbose" value="${status.verbose}"/> |
| </ant> |
| </goal> |
| |
| <goal name="runtest.security" prereqs="pcclasses, testjar.build"> |
| <ant target="runtest.security" |
| dir="${basedir}/test" antfile="runtest.xml"> |
| <property name="policyfile" value="${jdo.security.policy}"/> |
| <property name="testlist" value="${jdo.testlist}"/> |
| <property name="jdoapi" value="${jdo.jdoapi.jarfile}"/> |
| <property name="jdobtree" value="${jdo.jdobtree.jarfile}"/> |
| <property name="jdori" value="${maven.build.dir}/classes"/> |
| <property name="jdoritests" value="${jdo.testclasses.jarfile}"/> |
| <property name="pcclasses" value="${jdo.pcclasses.jarfile}"/> |
| <property name="testdir" value="${jdo.testdir}"/> |
| <property name="fsuidjar" value="${jdo.fsuid.jarfile}"/> |
| <property name="junit" value="${junit.jarfile}"/> |
| <property name="jta" value="${jta.jarfile}"/> |
| <property name="antlr" value="${antlr.jarfile}"/> |
| <property name="logging" value="${logging.jarfile}"/> |
| <property name="jndi" value="${jndi}"/> |
| <property name="xmlparser" value="${xmlparser}"/> |
| <property name="status.verbose" value="${status.verbose}"/> |
| </ant> |
| </goal> |
| |
| <!-- Runs tests that cannot be run from a test list |
| (e.g. they require starting a sequence of test programs |
| where each test programs needs to run in its own JVM. |
| --> |
| <goal name="runtest.multiJVMtests" prereqs="pcclasses, testjar.build"> |
| <ant target="runtest.multiJVMtests" |
| dir="${basedir}/test" antfile="runtest.xml"> |
| <property name="jdoapi" value="${jdo.jdoapi.jarfile}"/> |
| <property name="jdobtree" value="${jdo.jdobtree.jarfile}"/> |
| <property name="jdori" value="${maven.build.dir}/classes"/> |
| <property name="jdoritests" value="${jdo.testclasses.jarfile}"/> |
| <property name="pcclasses" value="${jdo.pcclasses.jarfile}"/> |
| <property name="testdir" value="${jdo.testdir}"/> |
| <property name="fsuidjar" value="${jdo.fsuid.jarfile}"/> |
| <property name="junit" value="${junit.jarfile}"/> |
| <property name="jta" value="${jta.jarfile}"/> |
| <property name="antlr" value="${antlr.jarfile}"/> |
| <property name="logging" value="${logging.jarfile}"/> |
| <property name="jndi" value="${jndi}"/> |
| <property name="xmlparser" value="${xmlparser}"/> |
| <property name="status.verbose" value="${status.verbose}"/> |
| </ant> |
| </goal> |
| |
| <!-- ============= --> |
| <!-- ANTLR support --> |
| <!-- ============= --> |
| |
| <preGoal name="antlr.compile"> |
| <condition property="antlr.required"> |
| <not> |
| <and> |
| <uptodate targetfile="${jdo.antlr.src.dir}/JDOQLParser.java" |
| srcfile="${jdo.antlr.src.dir}/JDOQL.g" /> |
| <uptodate targetfile="${jdo.antlr.src.dir}/Semantic.java" |
| srcfile="${jdo.antlr.src.dir}/Semantic.g" /> |
| <uptodate targetfile="${jdo.antlr.src.dir}/Optimizer.java" |
| srcfile="${jdo.antlr.src.dir}/Optimizer.g" /> |
| </and> |
| </not> |
| </condition> |
| </preGoal> |
| |
| <goal name="antlr.compile"> |
| <j:if test="${antlr.required}"> |
| <java dir="${jdo.antlr.src.dir}" classname="antlr.Tool" fork="yes"> |
| <arg value="JDOQL.g"/> |
| <classpath refid="maven.dependency.classpath"/> |
| </java> |
| <java dir="${jdo.antlr.src.dir}" classname="antlr.Tool" fork="yes"> |
| <arg value="Semantic.g"/> |
| <classpath refid="maven.dependency.classpath"/> |
| </java> |
| <java dir="${jdo.antlr.src.dir}" classname="antlr.Tool" fork="yes"> |
| <arg value="Optimizer.g"/> |
| <classpath refid="maven.dependency.classpath"/> |
| </java> |
| </j:if> |
| </goal> |
| |
| <goal name="antlr.clean"> |
| <delete> |
| <fileset dir="${jdo.antlr.src.dir}" |
| includes="JDOQLLexer.java, JDOQLParser.java, Semantic*.java, |
| Optimizer*.java, *TokenTypes.*"/> |
| </delete> |
| </goal> |
| |
| <!-- ================ --> |
| <!-- Enhancer support --> |
| <!-- ================ --> |
| |
| <preGoal name="pcclasses"> |
| <condition property="enhancement.required"> |
| <not> |
| <uptodate targetfile="${jdo.pcclasses.jarfile}"> |
| <srcfiles dir="${basedir}/test/jdo" |
| includes="org/apache/jdo/pc/**/*.jdo, |
| org/apache/jdo/pc/**/*.jdoproperties"/> |
| <srcfiles dir="${basedir}/test/java" |
| includes="org/apache/jdo/pc/**/*.java, |
| org/apache/jdo/util/Util.java, |
| org/apache/jdo/test/Test_PCDerived.java"/> |
| </uptodate> |
| </not> |
| </condition> |
| </preGoal> |
| |
| <goal name="pcclasses"> |
| <j:if test="${enhancement.required}"> |
| <attainGoal name="copymetadata"/> |
| <attainGoal name="checkmetadata"/> |
| <attainGoal name="enhance"/> |
| <attainGoal name="augmentationtest"/> |
| <attainGoal name="annotationtest"/> |
| <attainGoal name="pcclassesjar.build"/> |
| </j:if> |
| </goal> |
| |
| <goal name="copymetadata" |
| description="Copies JDO metadata files to target/test-classes"> |
| <copy todir="${jdo.testclasses.dir}"> |
| <fileset dir="${basedir}/test/jdo" includes="**/*.jdo"/> |
| </copy> |
| <mkdir dir="${jdo.enhancer.enhanced.dir}"/> |
| <copy todir="${jdo.enhancer.enhanced.dir}"> |
| <fileset dir="${basedir}/test/jdo" includes="**/*.jdo"/> |
| </copy> |
| </goal> |
| |
| <goal name="checkmetadata" |
| description="Check existence of XML metadata for pc classes"> |
| <echo>Check existence of XML metadata for pc classes</echo> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.xmlexists.main}" |
| classpath="${jdo.xmlexists.classpath}"> |
| <arg line="${jdo.pcclasses.pc.classes}"/> |
| <arg line="${jdo.pcclasses.empdept.classes}"/> |
| <arg line="${jdo.pcclasses.xempdept.classes}"/> |
| <arg line="${jdo.pcclasses.appid.classes}"/> |
| <arg line="${jdo.pcclasses.serializable.classes}"/> |
| </java> |
| </goal> |
| |
| <goal name="enhance" |
| description="Enhance persistence-capable and persistence-aware classes"> |
| <echo>Enhance persistence-capable and persistence-aware classes</echo> |
| <java failonerror="true" fork="true" |
| classname="${jdo.enhancer.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="${jdo.enhancer.options}"/> |
| <arg line="${jdo.pcclasses.pc.files}"/> |
| <arg line="${jdo.pcclasses.empdept.files}"/> |
| <arg line="${jdo.pcclasses.xempdept.files}"/> |
| <arg line="${jdo.pcclasses.appid.files}"/> |
| <arg line="${jdo.pcclasses.serializable.files}"/> |
| <arg line="${jdo.pawareclasses.test.files}"/> |
| </java> |
| </goal> |
| |
| <goal name="augmentationtest"> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.augmentationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="${jdo.augmentationtest.options}"/> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/pc.jdoproperties"/> |
| <arg line="${jdo.pcclasses.pc.classes}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.augmentationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="${jdo.augmentationtest.options}"/> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/empdept/empdept.jdoproperties"/> |
| <arg line="${jdo.pcclasses.empdept.classes}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.augmentationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="${jdo.augmentationtest.options}"/> |
| <arg line=" --properties ${basedir}/test/jdo/org/apache/jdo/pc/xempdept/xempdept.jdoproperties"/> |
| <arg line="${jdo.pcclasses.xempdept.classes}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.augmentationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="${jdo.augmentationtest.options}"/> |
| <arg line=" --properties ${basedir}/test/jdo/org/apache/jdo/pc/appid/appid.jdoproperties"/> |
| <arg line=" ${jdo.pcclasses.appid.classes}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.augmentationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="${jdo.augmentationtest.options}"/> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/serializable/serializable.jdoproperties"/> |
| <arg line="${jdo.pcclasses.serializable.classes}"/> |
| </java> |
| </goal> |
| |
| <goal name="annotationtest"> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.annotationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/pc.jdoproperties"/> |
| <arg line="${jdo.pcclasses.pc.files}"/> |
| <arg line="${jdo.pawareclasses.test.files}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.annotationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/empdept/empdept.jdoproperties"/> |
| <arg line="${jdo.pcclasses.empdept.files}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.annotationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/xempdept/xempdept.jdoproperties"/> |
| <arg line="${jdo.pcclasses.xempdept.files}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.annotationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/appid/appid.jdoproperties"/> |
| <arg line=" ${jdo.pcclasses.appid.files}"/> |
| </java> |
| <java fork="yes" failonerror="yes" |
| classname="${jdo.annotationtest.main}" |
| classpath="${jdo.enhancer.classpath}"> |
| <arg line="--properties ${basedir}/test/jdo/org/apache/jdo/pc/serializable/serializable.jdoproperties"/> |
| <arg line="${jdo.pcclasses.serializable.files}"/> |
| </java> |
| </goal> |
| |
| <goal name="pcclassesjar.build"> |
| <delete file="${jdo.pcclasses.jarfile}"/> |
| <jar jarfile="${jdo.pcclasses.jarfile}"> |
| <fileset dir="${jdo.testclasses.dir}" |
| includes="org/apache/jdo/util/Util.class, |
| org/apache/jdo/pc/**/*.class, |
| org/apache/jdo/pc/**/*.jdo"/> |
| </jar> |
| </goal> |
| |
| <!-- ==== --> |
| <!-- Misc --> |
| <!-- ==== --> |
| |
| <goal name="testjar.build"> |
| <delete file="${jdo.testclasses.jarfile}"/> |
| <jar jarfile="${jdo.testclasses.jarfile}"> |
| <fileset dir="${jdo.testclasses.dir}" |
| includes="org/apache/jdo/test/**/*.class, |
| org/apache/jdo/impl/fostore/*.class"/> |
| <fileset dir="${basedir}/test/conf" |
| includes="*properties"/> |
| </jar> |
| </goal> |
| |
| <goal name="fsuid2.build"> |
| <ant dir="${basedir}/test/fsuid2" target="build"> |
| <property name="jdoapi" value="${jdo.jdoapi.jarfile}"/> |
| <property name="jdori" value="${maven.build.dest}"/> |
| <property name="logging" value="${logging.jarfile}"/> |
| <property name="fsuid2.jarfile" value="${jdo.fsuid.jarfile}"/> |
| </ant> |
| </goal> |
| |
| </project> |