-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
110 lines (92 loc) · 4.05 KB
/
build.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version="1.0" encoding="UTF-8"?>
<project name="Processpedia" default="compile" basedir=".">
<description>Processpedia Build File</description>
<property name="javac.encoding" value="UTF-8"/>
<property name="java.file.encoding" value="UTF-8"/>
<property name="src.rel-dir" value="src/main"/>
<property name="test.rel-dir" value="src/test"/>
<property name="build.rel-dir" value="build"/>
<property name="lib.rel-dir" value="lib"/>
<property name="db.rel-dir" value="db"/>
<property name="test-db.rel-dir" value="test-db"/>
<property name="dml.filename" value="processpedia.dml"/>
<property name="java.src.rel-dir" value="${src.rel-dir}/java"/>
<property name="java.test.rel-dir" value="${test.rel-dir}/java"/>
<property name="dml.src.rel-dir" value="${src.rel-dir}/dml"/>
<property name="generated-src.build.rel-dir" value="${build.rel-dir}/src"/>
<property name="classes.build.rel-dir" value="${build.rel-dir}/classes"/>
<property name="dml.rel-file" value="${dml.src.rel-dir}/${dml.filename}"/>
<path id="project.classpath">
<pathelement location="${classes.build.rel-dir}" />
<fileset dir="${lib.rel-dir}">
<include name="**/*.jar" />
</fileset>
</path>
<taskdef resource="pt/ist/fenixframework/dml-ant.xml" classpathref="project.classpath"/>
<target name="prepare">
<echo message="Preparing the project for build..."/>
<mkdir dir="${classes.build.rel-dir}"/>
<mkdir dir="${db.rel-dir}"/>
<mkdir dir="${test-db.rel-dir}"/>
</target>
<target name="generate-domain" depends="prepare">
<echo message="Generating base domain classes..." />
<echo message="Using: ${dml.rel-file}" />
<dml-domain-generator destDirectory="${java.src.rel-dir}"
destDirectoryBase="${generated-src.build.rel-dir}">
<fileset file="${dml.rel-file}"/>
</dml-domain-generator>
</target>
<target name="compile" depends="generate-domain, prepare">
<echo message="Compiling sources..." />
<javac destdir="${classes.build.rel-dir}" debug="true" debuglevel="lines,vars,source"
optimize="true" deprecation="true" verbose="false" includeantruntime="false" encoding="${javac.encoding}">
<classpath refid="project.classpath" />
<src>
<pathelement path="${generated-src.build.rel-dir}:${java.src.rel-dir}"/>
</src>
<compilerarg line=""/>
</javac>
<copy todir="${classes.build.rel-dir}">
<fileset file="${dml.rel-file}"/>
</copy>
</target>
<target name="instrument-classes" depends="compile">
<echo message="Injecting FenixFramework Voodoo Magic..." />
<dml-post-processor dir="${classes.build.rel-dir}">
<fileset file="${dml.rel-file}"/>
<classpath refid="project.classpath" />
</dml-post-processor>
</target>
<target name="compile-tests" depends="compile, instrument-classes" description="Compile the tests">
<javac destdir="${classes.build.rel-dir}" debug="true" debuglevel="lines,vars,source"
optimize="true" deprecation="true" verbose="false" includeantruntime="false" encoding="${javac.encoding}">
<classpath refid="project.classpath" />
<src>
<pathelement path="${java.test.rel-dir}"/>
</src>
</javac>
</target>
<target name="test" depends="compile-tests" description="Run the tests">
<junit>
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<test name="pt.ist.processpedia.test.UserTest" />
</junit>
</target>
<target name="run" depends="compile, instrument-classes" description="Runs the program">
<java classname="pt.ist.processpedia.ProcesspediaApplication" fork="true">
<classpath>
<path refid="project.classpath" />
</classpath>
<jvmarg value="-Dfile.encoding=${java.file.encoding}" />
</java>
</target>
<target name="clean" description="Cleans the compiled classes and generated sources">
<delete dir="${build.rel-dir}"/>
</target>
<target name="clean-all" depends="clean">
<delete dir="${db.rel-dir}"/>
<delete dir="${test-db.rel-dir}"/>
</target>
</project>