| <!-- |
| 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-java" xmlns:ea="antlib:org.apache.easyant"> |
| <ea:core-version requiredrevision="[0.9,+]" /> |
| |
| <ea:plugin module="abstract-compile" revision="0.10" /> |
| |
| <ea:parameter property="src.main.java" default="${basedir}/src/main/java" description="directory where sources to be compiled are" /> |
| <ea:parameter property="javac.debug.mode" default="false" description="javac debug mode, true or false" /> |
| <ea:parameter property="compile.java.includes.pattern" default="**/*.java" |
| description="Pattern describing files included in compilation process" /> |
| <ea:parameter property="compile.java.excludes.pattern" default="" |
| description="Pattern describing files excluded in compilation process" /> |
| <ea:parameter property="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="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="compile.java.compiler" description="The compiler implementation to use" default="modern"/> |
| <available file="${src.main.java}" property="has.src.main.java" /> |
| |
| <property name="main.sources" value="${src.main.java}"/> |
| <property name="main.sources.includes" value="${compile.java.includes.pattern}"/> |
| <property name="main.sources.excludes" value="${compile.java.excludes.pattern}"/> |
| |
| <path id="java.compiler.classpath" description="A PATH like structure holding the classpath to use when loading the compiler implementation if a custom class has been specified. Doesn't have any effect when using one of the built-in compilers."/> |
| |
| <target name="compile-java:compile" depends="abstract-compile:compile-ready" if="has.src.main.java" |
| extensionOf="abstract-compile:compile"> |
| <mkdir dir="${target.main.classes}" /> |
| <javac srcdir="${src.main.java}" destdir="${target.main.classes}" debug="${javac.debug.mode}" source="${compile.java.source.version}" |
| target="${compile.java.target.version}" classpathref="compile.main.classpath" includes="${compile.java.includes.pattern}" |
| excludes="${compile.java.excludes.pattern}" includeantruntime="no" |
| compiler="${compile.java.compiler}"> |
| <compilerclasspath refid="java.compiler.classpath"/> |
| </javac> |
| </target> |
| </project> |