1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="Package JetGroovy plugin" default="all">
5 In order for plugin packaging to work, you should have a groovy.properties file
6 next to this one, under the module content root. The template file is groovy.template.properties
10 <property file="groovy.properties"/>
11 <property name="idea.home" value="${jdk.home.jetgroovy_idea_sdk}"/>
12 <property name="javac2.home" value="${idea.home}/lib"/>
13 <path id="javac2.classpath">
14 <pathelement location="${javac2.home}/javac2.jar"/>
15 <pathelement location="${javac2.home}/jdom.jar"/>
16 <pathelement location="${javac2.home}/jgoodies-forms.jar"/>
17 <pathelement location="${javac2.home}/asm.jar"/>
18 <pathelement location="${javac2.home}/asm-commons.jar"/>
20 <taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
21 <taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions" classpathref="javac2.classpath"/>
23 <!-- Compiler options -->
25 <property name="compiler.debug" value="on"/>
26 <property name="compiler.generate.no.warnings" value="off"/>
27 <property name="compiler.args" value=""/>
28 <property name="compiler.max.memory" value="128m"/>
29 <patternset id="ignored.files">
30 <exclude name="**/CVS/**"/>
31 <exclude name="**/SCCS/**"/>
32 <exclude name="**/RCS/**"/>
33 <exclude name="**/rcs/**"/>
34 <exclude name="**/.DS_Store/**"/>
35 <exclude name="**/.svn/**"/>
36 <exclude name="**/vssver.scc/**"/>
37 <exclude name="**/vssver2.scc/**"/>
38 <exclude name="**/.sbas/**"/>
39 <exclude name="**/.IJI.*/**"/>
40 <exclude name="**/.pyc/**"/>
41 <exclude name="**/.pyo/**"/>
42 <exclude name="**/*.pyc/**"/>
43 <exclude name="**/*.pyo/**"/>
44 <exclude name="**/.git/**"/>
46 <patternset id="library.patterns">
47 <include name="*.zip"/>
48 <include name="*.war"/>
49 <include name="*.egg"/>
50 <include name="*.ear"/>
51 <include name="*.swc"/>
52 <include name="*.jar"/>
54 <patternset id="compiler.resources">
55 <include name="**/?*.properties"/>
56 <include name="**/?*.xml"/>
57 <include name="**/?*.gif"/>
58 <include name="**/?*.png"/>
59 <include name="**/?*.jpeg"/>
60 <include name="**/?*.jpg"/>
61 <include name="**/?*.html"/>
62 <include name="**/?*.ft"/>
63 <include name="**/?*.dtd"/>
64 <include name="**/?*.tld"/>
65 <include name="**/?*.groovy"/>
68 <!-- JDK definitions -->
70 <property name="jdk.bin.jetgroovy_idea_sdk" value="${jdk.home.jetgroovy_compile_with_jdk}/bin"/>
71 <path id="jdk.classpath.jetgroovy_idea_sdk">
72 <fileset dir="${jdk.home.jetgroovy_idea_sdk}">
73 <include name="lib/alloy.jar"/>
74 <include name="lib/annotations.jar"/>
75 <include name="lib/asm-commons.jar"/>
76 <include name="lib/asm-tree-3.0.jar"/>
77 <include name="lib/asm.jar"/>
78 <include name="lib/boot.jar"/>
79 <include name="lib/bootstrap.jar"/>
80 <include name="lib/cglib-nodep-2.1_3.jar"/>
81 <include name="lib/commons-codec-1.3.jar"/>
82 <include name="lib/commons-collections.jar"/>
83 <include name="lib/commons-lang-2.4.jar"/>
84 <include name="lib/commons-net-1.4.1.jar"/>
85 <include name="lib/coverage-agent.jar"/>
86 <include name="lib/emma-agent.jar"/>
87 <include name="lib/emma.jar"/>
88 <include name="lib/extensions.jar"/>
89 <include name="lib/forms_rt.jar"/>
90 <include name="lib/icons.jar"/>
91 <include name="lib/idea_rt.jar"/>
92 <include name="lib/j2ee.jar"/>
93 <include name="lib/jasper21_rt.jar"/>
94 <include name="lib/jasper2_rt.jar"/>
95 <include name="lib/javac2.jar"/>
96 <include name="lib/javaee.jar"/>
97 <include name="lib/jaxen-1.1.1.jar"/>
98 <include name="lib/jdom.jar"/>
99 <include name="lib/jgoodies-forms.jar"/>
100 <include name="lib/jh.jar"/>
101 <include name="lib/jna-utils.jar"/>
102 <include name="lib/jna.jar"/>
103 <include name="lib/JNIWrap.jar"/>
104 <include name="lib/jsf-api.jar"/>
105 <include name="lib/jsp-api.jar"/>
106 <include name="lib/junit-4.6.jar"/>
107 <include name="lib/junit.jar"/>
108 <include name="lib/log4j.jar"/>
109 <include name="lib/microba.jar"/>
110 <include name="lib/nanoxml-2.2.3.jar"/>
111 <include name="lib/openapi.jar"/>
112 <include name="lib/org.eclipse.jdt.core*.jar"/>
113 <include name="lib/oromatcher.jar"/>
114 <include name="lib/picocontainer.jar"/>
115 <include name="lib/resolver.jar"/>
116 <include name="lib/resources.jar"/>
117 <include name="lib/resources_en.jar"/>
118 <include name="lib/serviceMessages.jar"/>
119 <include name="lib/servlet-api.jar"/>
120 <include name="lib/trove4j.jar"/>
121 <include name="lib/trove4j_src.jar"/>
122 <include name="lib/util.jar"/>
123 <include name="lib/velocity.jar"/>
124 <include name="lib/xerces.jar"/>
125 <include name="lib/xml-apis.jar"/>
126 <include name="lib/xmlrpc-2.0.jar"/>
127 <include name="lib/xpp3-1.1.3.4d_b4_min.jar"/>
128 <include name="lib/xstream.jar"/>
129 <include name="lib/yjp-controller-api-redist.jar"/>
130 <include name="plugins/JavaEE/lib/javaee-openapi.jar"/>
131 <include name="plugins/JavaEE/lib/resources_en.jar"/>
132 <include name="plugins/JSF/lib/jsf-openapi.jar"/>
133 <include name="plugins/JSF/lib/resources_en.jar"/>
134 <include name="plugins/PersistenceSupport/lib/persistence-openapi.jar"/>
135 <include name="plugins/PersistenceSupport/lib/resources_en.jar"/>
136 <include name="lib/idea.jar"/>
137 <include name="plugins/Spring/lib/spring.jar"/>
138 <include name="plugins/JavaEE/lib/javaee-impl.jar"/>
139 <include name="plugins/JavaScriptLanguage/lib/JavascriptLanguage.jar"/>
140 <include name="plugins/CSS/lib/css-openapi.jar"/>
141 <include name="plugins/CSS/lib/css.jar"/>
142 <include name="${jdk.home.jetgroovy_compile_with_jdk}/lib/tools.jar"/>
143 <include name="lib/ant/lib/ant.jar"/>
144 <include name="lib/groovy-all-1.6.0.jar"/>
145 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/charsets.jar"/>
146 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/deploy.jar"/>
147 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/javaws.jar"/>
148 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/jce.jar"/>
149 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/jsse.jar"/>
150 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/plugin.jar"/>
151 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/rt.jar"/>
152 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/ext/dnsns.jar"/>
153 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/ext/localedata.jar"/>
154 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/ext/sunjce_provider.jar"/>
155 <include name="${jdk.home.jetgroovy_compile_with_jdk}/jre/lib/ext/sunpkcs11.jar"/>
159 <property name="jdk.bin.jetgroovy_runtime_jdk" value="${jdk.home.jetgroovy_runtime_jdk}/bin"/>
160 <path id="jdk.classpath.jetgroovy_runtime_jdk">
161 <fileset dir="${jdk.home.jetgroovy_runtime_jdk}">
162 <include name="jre/lib/charsets.jar"/>
163 <include name="jre/lib/deploy.jar"/>
164 <include name="jre/lib/javaws.jar"/>
165 <include name="jre/lib/jce.jar"/>
166 <include name="jre/lib/jsse.jar"/>
167 <include name="jre/lib/plugin.jar"/>
168 <include name="jre/lib/rt.jar"/>
169 <include name="jre/lib/ext/dnsns.jar"/>
170 <include name="jre/lib/ext/localedata.jar"/>
171 <include name="jre/lib/ext/sunjce_provider.jar"/>
172 <include name="jre/lib/ext/sunpkcs11.jar"/>
173 <include name="${path.variable.groovy_sdk_path}/lib/groovy-all*.jar"/>
177 <property name="project.jdk.home" value="${jdk.home.jetgroovy_idea_sdk}"/>
178 <property name="project.jdk.bin" value="${jdk.bin.jetgroovy_idea_sdk}"/>
179 <property name="project.jdk.classpath" value="jdk.classpath.jetgroovy_idea_sdk"/>
182 <!-- Project Libraries -->
184 <path id="library.groovy.classpath">
185 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="ant-*.jar"/>
186 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="antlr-*.jar"/>
187 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="asm-*.jar"/>
188 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="bsf-*.jar"/>
189 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="commons-cli-*.jar"/>
190 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="commons-logging-*.jar"/>
191 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="groovy-*.jar"/>
192 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="jline-*.jar"/>
193 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="jsp-api-*.jar"/>
194 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="junit-*.jar"/>
195 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="mockobjects-core-*.jar"/>
196 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="mx4j-*.jar"/>
197 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="servlet-api-*.jar"/>
198 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="xpp3_min-*.jar"/>
199 <fileset dir="${path.variable.groovy_sdk_path}/lib" includes="xstream-*.jar"/>
202 <path id="library.idea.classpath"/>
205 <!-- Global Libraries -->
212 <dirname property="module.rt.basedir" file="${ant.file}"/>
215 <property name="module.jdk.home.rt" value="${jdk.home.jetgroovy_runtime_jdk}"/>
216 <property name="module.jdk.bin.rt" value="${jdk.bin.jetgroovy_runtime_jdk}"/>
217 <property name="module.jdk.classpath.rt" value="jdk.classpath.jetgroovy_runtime_jdk"/>
219 <property name="compiler.args.rt" value="${compiler.args}"/>
221 <property name="rt.output.dir" value="${module.rt.basedir}/classes/production/rt"/>
222 <property name="rt.testoutput.dir" value="${module.rt.basedir}/classes/test/rt"/>
224 <path id="rt.module.bootclasspath">
225 <!-- Paths to be included in compilation bootclasspath -->
228 <path id="rt.module.classpath">
229 <path refid="${module.jdk.classpath.rt}"/>
230 <path refid="library.groovy.classpath"/>
233 <path id="rt.runtime.module.classpath">
234 <pathelement location="${rt.output.dir}"/>
235 <pathelement location="${rt.testoutput.dir}"/>
236 <path refid="library.groovy.classpath"/>
240 <patternset id="excluded.from.module.rt">
241 <patternset refid="ignored.files"/>
244 <patternset id="excluded.from.compilation.rt">
245 <patternset refid="excluded.from.module.rt"/>
248 <path id="rt.module.sourcepath">
249 <dirset dir="${module.rt.basedir}/rt">
250 <include name="src"/>
255 <target name="compile.module.rt" depends="compile.module.rt.production,compile.module.rt.tests" description="Compile module rt"/>
257 <target name="compile.module.rt.production" description="Compile module rt; production classes">
258 <mkdir dir="${rt.output.dir}"/>
259 <javac2 destdir="${rt.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.rt}/javac">
260 <compilerarg line="${compiler.args.rt}"/>
261 <bootclasspath refid="rt.module.bootclasspath"/>
262 <classpath refid="rt.module.classpath"/>
263 <src refid="rt.module.sourcepath"/>
264 <patternset refid="excluded.from.compilation.rt"/>
267 <copy todir="${rt.output.dir}">
268 <fileset dir="${module.rt.basedir}/rt/src">
269 <patternset refid="compiler.resources"/>
275 <target name="compile.module.rt.tests" depends="compile.module.rt.production" description="compile module rt; test classes" unless="skip.tests"/>
277 <target name="clean.module.rt" description="cleanup module">
278 <delete dir="${rt.output.dir}"/>
279 <delete dir="${rt.testoutput.dir}"/>
283 <!-- Module groovy -->
285 <dirname property="module.groovy.basedir" file="${ant.file}"/>
288 <property name="module.jdk.home.groovy" value="${project.jdk.home}"/>
289 <property name="module.jdk.bin.groovy" value="${project.jdk.bin}"/>
290 <property name="module.jdk.classpath.groovy" value="${project.jdk.classpath}"/>
292 <property name="compiler.args.groovy" value="${compiler.args}"/>
294 <property name="groovy.output.dir" value="${module.groovy.basedir}/classes/production/groovy"/>
295 <property name="groovy.testoutput.dir" value="${module.groovy.basedir}/classes/test/groovy"/>
297 <path id="groovy.module.bootclasspath">
298 <!-- Paths to be included in compilation bootclasspath -->
301 <path id="groovy.module.classpath">
302 <path refid="${module.jdk.classpath.groovy}"/>
303 <pathelement location="${rt.output.dir}"/>
304 <pathelement location="${rt.testoutput.dir}"/>
305 <path refid="library.groovy.classpath"/>
306 <path refid="library.idea.classpath"/>
309 <path id="groovy.runtime.module.classpath">
310 <pathelement location="${groovy.output.dir}"/>
311 <pathelement location="${groovy.testoutput.dir}"/>
312 <path refid="rt.runtime.module.classpath"/>
313 <path refid="library.groovy.classpath"/>
314 <path refid="library.idea.classpath"/>
318 <patternset id="excluded.from.module.groovy">
319 <patternset refid="ignored.files"/>
322 <patternset id="excluded.from.compilation.groovy">
323 <patternset refid="excluded.from.module.groovy"/>
326 <path id="groovy.module.sourcepath">
327 <dirset dir="${module.groovy.basedir}">
328 <include name="resources"/>
329 <include name="src"/>
333 <path id="groovy.module.test.sourcepath">
334 <dirset dir="${module.groovy.basedir}">
335 <include name="test"/>
340 <target name="compile.module.groovy" depends="compile.module.groovy.production,compile.module.groovy.tests" description="Compile module groovy"/>
342 <target name="compile.module.groovy.production" depends="compile.module.rt" description="Compile module groovy; production classes">
343 <mkdir dir="${groovy.output.dir}"/>
344 <javac2 destdir="${groovy.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.groovy}/javac">
345 <compilerarg line="${compiler.args.groovy}"/>
346 <bootclasspath refid="groovy.module.bootclasspath"/>
347 <classpath refid="groovy.module.classpath"/>
348 <src refid="groovy.module.sourcepath"/>
349 <patternset refid="excluded.from.compilation.groovy"/>
352 <copy todir="${groovy.output.dir}">
353 <fileset dir="${module.groovy.basedir}/resources">
354 <patternset refid="compiler.resources"/>
357 <fileset dir="${module.groovy.basedir}/src">
358 <patternset refid="compiler.resources"/>
364 <target name="compile.module.groovy.tests" depends="compile.module.groovy.production" description="compile module groovy; test classes" unless="skip.tests">
365 <mkdir dir="${groovy.testoutput.dir}"/>
366 <javac2 destdir="${groovy.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.groovy}/javac">
367 <compilerarg line="${compiler.args.groovy}"/>
368 <classpath refid="groovy.module.classpath"/>
370 <path refid="groovy.module.classpath"/>
371 <pathelement location="${groovy.output.dir}"/>
373 <src refid="groovy.module.test.sourcepath"/>
374 <patternset refid="excluded.from.compilation.groovy"/>
377 <copy todir="${groovy.testoutput.dir}">
378 <fileset dir="${module.groovy.basedir}/test">
379 <patternset refid="compiler.resources"/>
385 <target name="clean.module.groovy" description="cleanup module">
386 <delete dir="${groovy.output.dir}"/>
387 <delete dir="${groovy.testoutput.dir}"/>
390 <property name="groovy.plugin.exploded.dir" value="${idea.home}/system/plugins-sandbox/plugins/groovy"/>
391 <property name="groovy.path.jar" value="${module.groovy.basedir}/Groovy.zip"/>
392 <target name="plugin.build.groovy" depends="compile.module.groovy" description="Build configured plugin directories and archives for module 'groovy'">
393 <antcall target="plugin.build.exploded.groovy">
394 <param name="plugin.dir.exploded" value="${groovy.plugin.exploded.dir}"/>
396 <antcall target="plugin.build.jar.groovy">
397 <param name="plugin.path.jar" value="${groovy.path.jar}"/>
401 <!-- Call the target to build exploded directory for module 'groovy'.\n Path to the exploded directory is specified by parameter 'plugin.dir.exploded' -->
402 <target name="plugin.build.exploded.groovy" description="Plugin exploded directory for module 'groovy'">
404 <copy todir="${plugin.dir.exploded}/lib/">
405 <fileset dir="${path.variable.groovy_sdk_path}/lib/">
406 <include name="xstream-*.jar"/>
407 <include name="xpp3_min-*.jar"/>
408 <include name="servlet-api-*.jar"/>
409 <include name="mx4j-*.jar"/>
410 <include name="mockobjects-core-*.jar"/>
411 <include name="junit-*.jar"/>
412 <include name="jsp-api-*.jar"/>
413 <include name="jline-*.jar"/>
414 <include name="groovy-*.jar"/>
415 <include name="commons-logging-*.jar"/>
416 <include name="commons-cli-*.jar"/>
417 <include name="bsf-*.jar"/>
418 <include name="asm-*.jar"/>
419 <include name="antlr-*.jar"/>
420 <include name="ant-*.jar"/>
424 <copy todir="${plugin.dir.exploded}/classes">
425 <fileset dir="${module.groovy.basedir}/classes/production/rt"/>
427 <copy todir="${plugin.dir.exploded}/classes">
428 <fileset dir="${module.groovy.basedir}/classes/production/groovy"/>
430 <copy file="${module.groovy.basedir}/src/META-INF/groovy-javaee-integration.xml" tofile="${plugin.dir.exploded}/META-INF/groovy-javaee-integration.xml"/>
431 <copy file="${module.groovy.basedir}/src/META-INF/groovy-spring-integration.xml" tofile="${plugin.dir.exploded}/META-INF/groovy-spring-integration.xml"/>
432 <copy file="${module.groovy.basedir}/src/META-INF/groovy-js-integration.xml" tofile="${plugin.dir.exploded}/META-INF/groovy-js-integration.xml"/>
433 <copy file="${module.groovy.basedir}/src/META-INF/plugin.xml" tofile="${plugin.dir.exploded}/META-INF/plugin.xml"/>
436 <!-- Call the target to build archive for module 'groovy'.\n Path to the archive file is specified by parameter 'plugin.path.jar' -->
437 <target name="plugin.build.jar.groovy" description="Build plugin archive for module 'groovy'">
438 <property name="tmp.dir.groovy" value="${module.groovy.basedir}/temp"/>
439 <mkdir dir="${tmp.dir.groovy}"/>
440 <mkdir dir="${tmp.dir.groovy}/lib"/>
441 <jar destfile="${tmp.dir.groovy}/lib/Groovy.jar" duplicate="preserve">
442 <zipfileset dir="${module.groovy.basedir}/classes/production/groovy" prefix=""/>
444 <jar destfile="${tmp.dir.groovy}/lib/groovy-rt.jar" duplicate="preserve">
445 <zipfileset dir="${module.groovy.basedir}/classes/production/rt" prefix=""/>
447 <copy file="${module.groovy.basedir}/resources/conf/groovy-starter.conf" todir="${tmp.dir.groovy}/lib"/>
448 <zip destfile="${groovy.path.jar}">
449 <fileset dir="${module.groovy.basedir}/temp"/>
451 <delete dir="${tmp.dir.groovy}"/>
454 <target name="init" description="Build initialization">
455 <!-- Perform any build initialization in this target -->
458 <target name="clean" depends="clean.module.rt, clean.module.groovy" description="cleanup all"/>
460 <target name="all" depends="init, clean, compile.module.rt, plugin.build.groovy" description="build all"/>