forked from INRIA/spoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spooned-project-builder.xml
68 lines (57 loc) · 2.54 KB
/
spooned-project-builder.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!-- An generic example Ant build file to process/build a project with Spoon -->
<!-- WARNING: the build process may significantly vary depending on your
use of Spoon -->
<project name="spooned-project-builder" basedir="." default="process">
<!-- The root dir of the project to be spooned (REPLACE WITH YOUR PROJECT
DIRECTORY) -->
<property name="target.dir" value="PROJECT-DIR" />
<!-- The source dir to be processed (input dir) -->
<property name="src.dir" value="${target.dir}/src" />
<!-- The source ouput dir -->
<property name="spooned.dir" value="${target.dir}/spooned" />
<!-- The bytecode ouput dir -->
<property name="bin.dir" value="${target.dir}/bin" />
<!-- The lib dir that contains the jars to be used in the source compilation
classpath -->
<property name="lib.dir" value="${target.dir}/lib" />
<!-- assumes that AJava is deployed in the target libs -->
<property name="ajava.lib" value="${lib.dir}/ajava.jar" />
<!-- The Spoon lib dir that contains the jars to be used in the Spoon's
classpath -->
<property name="spoon.lib.dir" value="target" />
<path id="classpath">
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<path id="template-classpath">
<fileset dir="${spoon.lib.dir}" includes="*.jar" />
</path>
<path id="spoon-classpath">
<fileset dir="${spoon.lib.dir}" includes="*.jar" />
</path>
<taskdef name="spoon" classname="spoon.SpoonTask" classpathref="spoon-classpath" />
<target name="clean">
<delete dir="${spooned.dir}" />
<delete dir="${bin.dir}" />
</target>
<target name="process">
<spoon input="${src.dir}" output="${spooned.dir}" classpathref="spoon-classpath"
sourceClasspathref="classpath" templateClasspathref="template-classpath"
verbose="true" debug="true" outputType="compilationunits">
<!-- Add as many processors as required -->
<processor type="fully.qualified.ProcessorClass" />
<!-- Set your templates here if any -->
<templateSet file="mytemplatelib.jar" />
</spoon>
</target>
<target name="process-and-compile">
<spoon input="${src.dir}" output="${spooned.dir}" classpathref="spoon-classpath"
sourceClasspathref="classpath" templateClasspathref="template-classpath"
destination="${bin.dir}" verbose="true" debug="true" outputType="compilationunits"
compile="true">
<!-- Add as many processors as required -->
<processor type="fully.qualified.ProcessorClass" />
<!-- Set your templates here if any -->
<templateSet file="mytemplatelib.jar" />
</spoon>
</target>
</project>