| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You 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 name="org.apache.easyant.plugins#compile-test-java" |
| xmlns:ea="antlib:org.apache.easyant"> |
| |
| <ea:core-version requiredrevision="[0.9,+]" /> |
| |
| <ea:import mrid="org.apache.easyant.plugins#abstract-compile;0.9" /> |
| |
| <ea:parameter property="src.test.java" default="${basedir}/src/test/java" |
| description="directory where test sources to be compiled are" /> |
| <ea:parameter property="src.test.integration.java" default="${basedir}/src/integration-test/java" |
| description="directory where integration test sources to be compiled are" /> |
| |
| <ea:parameter property="javac.debug.mode" default="true" |
| description="javac debug mode, true or false" /> |
| |
| <available file="${src.test.java}" property="has.src.test.java" /> |
| <available file="${src.test.integration.java}" property="has.src.test.integration.java" /> |
| |
| |
| <macrodef name="compile-java-tests"> |
| <attribute name="prefix"/> |
| <sequential> |
| <mkdir dir="${target.@{prefix}.classes}" /> |
| <javac srcdir="${src.@{prefix}.java}" |
| destdir="${target.@{prefix}.classes}" |
| classpathref="compile.test.classpath" |
| debug="${javac.debug.mode}" |
| source="${@{prefix}.compile.java.source.version}" |
| target="${@{prefix}.compile.java.target.version}" |
| includes="${@{prefix}.compile.includes.pattern}" |
| excludes="${@{prefix}.compile.excludes.pattern}" |
| includeantruntime="no"> |
| </javac> |
| </sequential> |
| </macrodef> |
| |
| <target name="compile-test-java:compile" depends="abstract-compile:compile-ready" if="has.src.test.java" extensionOf="abstract-compile:compile"> |
| <ea:parameter property="test.compile.java.target.version" default="${ant.java.version}" |
| description="Specify a VM version for Generated class files (e.g., 1.1 or 1.2)." /> |
| <ea:parameter property="test.compile.java.source.version" default="${ant.java.version}" |
| description="Specify a value of the -source command-line switch; will be ignored by all implementations prior to javac1.4 (or modern when Ant is not running in a 1.3 VM) and jikes" /> |
| <ea:parameter property="test.compile.includes.pattern" default="**/*.java" |
| description="Pattern describing files included in test compilation process" /> |
| <ea:parameter property="test.compile.excludes.pattern" default="" |
| description="Pattern describing files excluded in test compilation process" /> |
| |
| <compile-java-tests prefix="test"/> |
| </target> |
| |
| <target name="compile-test-java:compile-integration" depends="abstract-compile:compile-ready" if="has.src.test.integration.java" extensionOf="abstract-compile:compile"> |
| <ea:parameter property="test.integration.compile.java.target.version" default="${ant.java.version}" |
| description="Specify a VM version for Generated class files (e.g., 1.1 or 1.2)." /> |
| <ea:parameter property="test.integration.compile.java.source.version" default="${ant.java.version}" |
| description="Specify a value of the -source command-line switch; will be ignored by all implementations prior to javac1.4 (or modern when Ant is not running in a 1.3 VM) and jikes" /> |
| <ea:parameter property="test.integration.compile.includes.pattern" default="**/*.java" |
| description="Pattern describing files included in integration test compilation process" /> |
| <ea:parameter property="test.integration.compile.excludes.pattern" default="" |
| description="Pattern describing files excluded in integration test compilation process" /> |
| |
| <compile-java-tests prefix="test.integration"/> |
| </target> |
| |
| </project> |