-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
157 lines (130 loc) · 6.03 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0" encoding="UTF-8"?>
<project name="Opad4lsssExperiments" default="build-all" basedir=".">
<property file="build.properties"/>
<!-- Compile classpaths used for javac and javadoc -->
<target name="init-classpaths">
<path id="compile-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="run-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${tslib.jar.file}"/>
</path>
<path id="compile-tests-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${tslib.jar.file}"/>
</path>
<path id="run-tests-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${tslib.build.test.dir}/"/>
<pathelement location="${tslib.jar.file}"/>
</path>
</target>
<target name="init" depends="init-classpaths">
<mkdir dir="${build.main.dir}"/>
<mkdir dir="${build.test.dir}"/>
<mkdir dir="${tmp.dir}"/>
<mkdir dir="${dist.dir}"/>
<antcall target="init-tslib"/>
</target>
<target name="build-all" depends="clean,init,build-tslib">
</target>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<target name="run-tests-junit" depends="build-all">
<delete dir="${tests.junit-results.dir}"/>
<mkdir dir="${tests.junit-results.dir}"/>
<junit printsummary="yes" haltonfailure="no">
<classpath refid="run-tests-classpath"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${tests.junit-results.dir}">
<fileset dir="${tslib.build.test.dir}/">
<include name="**/**/*Test*.class"/>
<include name="**/junit/**/*Test*.class"/>
<exclude name="**/*$*.class"/>
<exclude name="**/Abstract*.class"/>
</fileset>
</batchtest>
</junit>
<antcall target="test.junit.report"/>
</target>
<target name="test.junit.report" depends="">
<junitreport todir="${tests.junit-results.dir}">
<fileset dir="${tests.junit-results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${tests.junit-results.dir}"/>
</junitreport>
<echo message="To see the test report, open ${tests.junit-results.dir}/index.html in your Web browser."/>
</target>
<target name="clean">
<!-- <delete dir="tmp"/>-->
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="init-tslib">
<mkdir dir="${tslib.build.main.dir}"/>
<mkdir dir="${tslib.build.test.dir}"/>
</target>
<target name="build-tslib" depends="clean, init">
<!-- compile all sources
(TODO: workaround as long as there is a (cyclic) dependency between meta-model and framework)
-->
<echo>Building...${line.separator} -> build main dir: ${tslib.build.main.dir}</echo>
<javac destDir="${tslib.build.main.dir}" source="1.5" debug="true" classpathref="compile-classpath" includeantruntime="false">
<!--<src path="${tslib.src-gen.dir}"/>-->
<src path="${tslib.src.dir}"/>
<compilerarg value="-Xlint:-path"/>
</javac>
<!-- TODO: re-activate as soon as dependency meta-model->framework resolved -->
<!-- compile generated sources -->
<!--<javac destDir="${tslib.build.main.dir}" source="1.5" srcdir="${tslib.src-gen.dir}" debug="true" classpathref="compile-classpath">
<compilerarg value="-Xlint:-path" />
</javac>-->
<!-- compile main sources -->
<!--<javac destDir="${tslib.build.main.dir}" source="1.5" srcdir="${tslib.src.dir}" debug="true" classpathref="compile-classpath">
<compilerarg value="-Xlint:-path" />
</javac>-->
<mkdir dir="${tslib.build.main.dir}/META-INF"/>
<!-- include libs in jar and set classpath in MANIFEST file -->
<!-- TODO: Note the jars build in this way can only be executed using
java -jar from directories with the subdirectory lib/ including
the required jars. We will have to find a solution such as
OneJar for this in the future -->
<mkdir dir="${tslib.build.main.dir}/lib"/>
<copy todir="${tslib.build.main.dir}/lib/">
<fileset dir="lib/">
<include name="*.jar"/>
</fileset>
</copy>
<path id="build-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<manifestclasspath property="jar.classpath" jarfile="${opad.jar.file}">
<classpath refid="compile-classpath"/>
</manifestclasspath>
<!-- excludes test classses since they haven't been built so far -->
<jar destfile="${tslib.jar.file}" basedir="${tslib.build.main.dir}">
<manifest>
<!-- Who is building this jar? -->
<attribute name="Built-By" value="${tslib.jar.author}"/>
<attribute name="Main-Class" value="${tslib.main.class}"/>
<attribute name="Implementation-Title" value="${tslib.jar.title}"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</jar>
<!-- compile tests -->
<javac source="1.5" destDir="${tslib.build.test.dir}" classpathref="compile-tests-classpath" includeantruntime="false">
<src path="${tslib.test.dir}"/>
</javac>
</target>
</project>