annotate groovy-ant.xml @ 15:d2901f1c52c3

Add common task for initialiaing groovy ant task.
author smith@nwoca.org
date Tue, 28 Dec 2010 14:48:36 -0500
parents 3cb1ff0297a8
children ea29594bb799
rev   line source
9
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
11
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
2 <project name="groovy-project-tasks" default="all" basedir="."
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
3 xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3">
9
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
4
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
5 <description>Ant tasks shared by Groovy based NetBeans projects.</description>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
6
11
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
7 <!-- Following targets need to be copied to the build.xml.
14
3cb1ff0297a8 TL-32: Add task for creating test properties.
smith@nwoca.org
parents: 11
diff changeset
8 <target name="-javadoc-build" depends="groovydoc"/>
9
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
9 <target name="-init-macrodef-junit" depends="-init-macrodef-junit-groovy"/>
14
3cb1ff0297a8 TL-32: Add task for creating test properties.
smith@nwoca.org
parents: 11
diff changeset
10 <target name="-pre-compile" depends="-groovy-init-macrodef-javac-groovyc"/>
3cb1ff0297a8 TL-32: Add task for creating test properties.
smith@nwoca.org
parents: 11
diff changeset
11 <target name="-do-test-run" depends="init,compile-test,-pre-test-run,-groovy-do-test-run" if="have.tests" />
11
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
12 end copy -->
9
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
13
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
14 <target depends="init" name="groovydoc">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
15 <taskdef name="groovydoc"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
16 classname="org.codehaus.groovy.ant.Groovydoc"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
17 classpath="${javac.classpath}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
18 <mkdir dir="${dist.javadoc.dir}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
19 <groovydoc
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
20 destdir="${dist.javadoc.dir}"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
21 sourcepath="${src.dir}"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
22 windowtitle="${javadoc.windowtitle}"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
23 use="${javadoc.use}"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
24 private="${javadoc.private}"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
25 author="${javadoc.author}"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
26 doctitle="${javadoc.windowtitle}">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
27 <link packages="java.,org.xml.,javax.,org.xml." href="http://java.sun.com/javase/6/docs/api/"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
28 <link packages="org.apache.ant.,org.apache.tools.ant." href="http://www.dpml.net/api/ant/1.7.0"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
29 <link packages="org.junit.,junit.framework." href="http://junit.sourceforge.net/junit3.8.1/javadoc/"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
30 <link packages="groovy.,org.codehaus.groovy." href="http://groovy.codehaus.org/api/"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
31 </groovydoc>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
32 </target>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
33
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
34 <target name="-init-macrodef-junit-groovy">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
35 <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
36 <attribute default="${includes}" name="includes"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
37 <attribute default="${excludes}" name="excludes"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
38 <attribute default="**" name="testincludes"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
39 <sequential>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
40 <if>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
41 <isset property="java.agent.jar"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
42 <then>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
43 <property name="jvm.agent" value="-javaagent:${java.agent.jar}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
44 </then>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
45 <else>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
46 <property name="jvm.agent" value=""/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
47 </else>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
48 </if>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
49 <propertyregex input="@{includes}" property="testg.includes" regexp="\.groovy" replace=".class" defaultValue="@{includes}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
50 <junit dir="${work.dir}"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
51 errorproperty="tests.failed"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
52 failureproperty="tests.failed"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
53 fork="true"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
54 forkmode="once"
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
55 showoutput="true">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
56 <batchtest todir="${build.test.results.dir}">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
57 <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes}" includes="${testg.includes}">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
58 <filename name="@{testincludes}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
59 </fileset>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
60 </batchtest>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
61 <classpath>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
62 <path path="${run.test.classpath}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
63 </classpath>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
64 <syspropertyset>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
65 <propertyref prefix="test-sys-prop."/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
66 <mapper from="test-sys-prop.*" to="*" type="glob"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
67 </syspropertyset>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
68 <formatter type="brief" usefile="false"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
69 <formatter type="xml"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
70 <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
71 <jvmarg line="${run.jvmargs}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
72 <jvmarg line="${jvm.agent}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
73 </junit>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
74 </sequential>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
75 </macrodef>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
76 </target>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
77
11
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
78 <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-groovy-do-test-run">
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
79 <property name="groovy.test.includes" value="**/*Test.*"/>
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
80 <j2seproject3:junit testincludes="${groovy.test.includes}"/>
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
81 </target>
de6f3a495afd Move groovy -do-test-run target into groovy script
smith@nwoca.org
parents: 10
diff changeset
82
9
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
83 <target name="-groovy-init-macrodef-javac-groovyc">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
84 <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
85 <attribute name="srcdir" default="${src.dir}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
86 <attribute name="destdir" default="${build.classes.dir}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
87 <attribute name="classpath" default="${javac.classpath}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
88 <attribute name="includes" default="${includes}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
89 <attribute name="excludes" default="${excludes}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
90 <attribute name="debug" default="${javac.debug}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
91 <attribute name="sourcepath" default="${empty.dir}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
92 <attribute name="gensrcdir" default="${empty.dir}"/>
10
3c87d0aee1f9 TL-32: Modify for compatiblity with NB 6.9.1
smith@nwoca.org
parents: 9
diff changeset
93 <attribute default="" name="processorpath"/>
3c87d0aee1f9 TL-32: Modify for compatiblity with NB 6.9.1
smith@nwoca.org
parents: 9
diff changeset
94 <attribute default="" name="apgeneratedsrcdir"/>
9
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
95 <element name="customize" optional="true"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
96 <sequential>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
97 <taskdef name="groovyc" classpath="${javac.classpath}" classname="org.codehaus.groovy.ant.Groovyc"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
98 <property name="empty.dir" location="${build.dir}/empty"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
99 <mkdir dir="${empty.dir}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
100 <groovyc fork="true" srcdir="@{srcdir}" sourcepath="@{sourcepath}" destdir="@{destdir}" encoding="${source.encoding}" includes="@{includes}" excludes="@{excludes}" includeAntRuntime="false">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
101 <src>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
102 <dirset dir="@{gensrcdir}" erroronmissingdir="false">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
103 <include name="*"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
104 </dirset>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
105 </src>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
106 <classpath>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
107 <path path="@{classpath}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
108 </classpath>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
109 <javac debug="@{debug}" deprecation="${javac.deprecation}" encoding="${source.encoding}" source="${javac.source}" target="${javac.target}">
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
110 <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
111 <customize/>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
112 </javac>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
113 </groovyc>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
114 </sequential>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
115 </macrodef>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
116 </target>
ae7d512164d0 TL-32: Add groovy and and allow scripts to "required" a script to be imported separately.
smith@nwoca.org
parents:
diff changeset
117 </project>