blob: 059e32d686e672643abad26beda032aaf64a22a2 [file] [log] [blame]
<!--
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-groovy" xmlns:ea="antlib:org.apache.easyant">
<ea:core-version requiredrevision="[0.9,+]" />
<ea:plugin module="abstract-provisioning" revision="0.9" />
<ea:plugin module="abstract-compile" revision="0.9" />
<target name="compile-groovy:init">
<ea:parameter property="src.main.groovy" required="true" description="directory where sources to be compiled are" />
<ea:parameter property="compile.groovy.includes.pattern" default="**/*.groovy"
description="Pattern describing files included in compilation process" />
<ea:parameter property="compile.groovy.excludes.pattern" default=""
description="Pattern describing files excluded in compilation process" />
<ea:parameter property="compile.groovy.indy" default="false"
description="Enable compilation with the invoke dynamic support when using Groovy 2.0 and beyond and running on JDK 7" />
<available file="${src.main.groovy}" property="has.src.main.groovy" />
</target>
<target name="-compile-groovy:configure" depends="compile-groovy:init,abstract-compile:compile-ready">
<ea:parameter property="project.ivy.instance" default="project.ivy.instance" description="the ivy instance name for your project" />
<ea:findclasspath pathid="resolved.groovy.classpath" organisation="org.codehaus.groovy" module="groovy-all"
revision="2.0.0">
<ea:project-dependency-strategy />
<ea:environment-strategy env="GROOVY_HOME" />
<ea:basic-configuration-strategy />
</ea:findclasspath>
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="resolved.groovy.classpath" />
</target>
<target name="compile-groovy:compile" depends="-compile-groovy:configure" if="has.src.main.groovy"
extensionOf="abstract-compile:compile">
<mkdir dir="${target.main.classes}" />
<groovyc srcdir="${src.main.groovy}" destdir="${target.main.classes}" classpathref="compile.main.classpath"
indy="${compile.groovy.indy}" includes="${compile.groovy.includes.pattern}" excludes="${compile.groovy.excludes.pattern}" />
</target>
</project>