-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_targets.xml
More file actions
159 lines (146 loc) · 6.61 KB
/
build_targets.xml
File metadata and controls
159 lines (146 loc) · 6.61 KB
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
158
159
<?xml version="1.0" encoding="UTF-8"?>
<project name="adam_targets" default="jar">
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% SRC %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<target name="javac" description="Compile code">
<!--<condition property="libFile" else="libs.res">
<isset property="libFile"/>
</condition>
This was added to separated the MC from the synthesis appraoch.
This would also need to only select the files which should be compiled from the ui
package. Easier to compile all and add the end only pack the needed files into the jar.
-->
<path id="classpath">
<pathelement location="${classesfolder}"/>
<resourcelist id="libs">
<!-- <file file="${subproject.basedir}/${libFile}"/>-->
<file file="${subproject.basedir}/libs.res"/>
</resourcelist>
</path>
<invoke-javac
dependencies="libs"
classpath="classpath"
src="${srcfolder}"
output="${classesfolder}"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% TESTS %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<path id="tests.classpath">
<path refid="classpath" />
<pathelement location="${testclassesfolder}"/>
<path refid="testng.classpath" />
<resourcelist id="subproject.tests.libs">
<file file="${subproject.basedir}/testlibs.res"/>
</resourcelist>
</path>
<target name="tests.javac" depends="javac" description="Compile test code">
<depend srcdir="${testfolder}" destdir="${testclassesfolder}" classpath="${classesfolder}"/>
<invoke-javac
dependencies="tests.libs"
classpath="tests.classpath"
src="${macros.basedir}/testing/src"
output="${testclassesfolder}" />
<invoke-javac
dependencies="subproject.tests.libs"
classpath="tests.classpath"
src="${testfolder}"
output="${testclassesfolder}" />
</target>
<target name="test" depends="tests.javac,create-xml" description="Run tests">
<invoke-testng
outputdir="${reportsfolder}/all"
testclassesclasspath="tests.classpath"
testclassesfolder="${testclassesfolder}"
examplesfolder="${examplesfolder}"
testoutputfolder="${testoutputfolder}"
libfolder="${libfolder}"/>
</target>
<target name="test-class" depends="tests.javac" description="Run test code for a specific class.">
<invoke-test-class
reportsfolder="${reportsfolder}"
testclassesclasspath="tests.classpath"
testclassesfolder="${testclassesfolder}"
examplesfolder="${examplesfolder}"
testoutputfolder="${testoutputfolder}"
libfolder="${libfolder}"/>
</target>
<target name="test-method" depends="tests.javac" description="Run test code for a specific method.">
<invoke-test-method
reportsfolder="${reportsfolder}"
testclassesclasspath="tests.classpath"
testclassesfolder="${testclassesfolder}"
examplesfolder="${examplesfolder}"
testoutputfolder="${testoutputfolder}"
libfolder="${libfolder}"/>
</target>
<target name="create-xml" description="Creates the testng.xml for the test suite">
<java classname="uniolunisaar.adam.ant.tasks.WriteTestsXML" failonerror="true">
<classpath refid="tests.classpath" />
<arg path="testng.xml" />
<arg path="${testclassesfolder}" />
<!-- <arg value="*Test.class" />-->
</java>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% JAVADOC %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<target name="javadoc" description="Generate documentation from java source">
<invoke-javadoc
sourcefolder="${srcfolder}"
testfolder="${testfolder}"
classpath="tests.classpath"
output="${javadocfolder}"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% JAR-STANDALONE %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<target name="jar-standalone" depends="javac" description="Builds a jar file. Also contains all files of the needed dependencies.">
<condition property="libFile" else="libs.res">
<isset property="libFile"/>
</condition>
<loadfile property="libs.jars" srcfile="${subproject.basedir}/${libFile}">
<filterchain>
<linecontains>
<contains value=".jar"></contains> <!-- take only the jars of libs.res -->
</linecontains>
<replaceregex pattern="\$\{libfolder\}/" replace=""/> <!-- get the relativ path for the jars (invoke-jar-standalone adds the libfolder) -->
<prefixlines prefix="," /> <!-- replace linebreaks by ',' to get it prepared for using it as includes -->
<striplinebreaks />
</filterchain>
</loadfile>
<loadfile property="libs.classes" srcfile="${subproject.basedir}/${libFile}">
<filterchain>
<linecontains>
<contains value="classes"></contains> <!-- take only the class entries of libs.res -->
</linecontains>
<replaceregex pattern="\$\{dependenciesfolder\}/" replace="${dependenciesfolder}/"/><!-- replace the dependencies folder with the concrete path -->
<replaceregex pattern="\$\{frameworkfolder\}/" replace="${frameworkfolder}/"/><!-- replace the framework folder with the concrete path-->
<replaceregex pattern="\$\{subproject.basedir\}/" replace="${subproject.basedir}/"/><!-- replace the subproject.basedir folder with the concrete path-->
<replaceregex pattern="$" replace=","/> <!-- put the include pattern at each end -->
<prefixlines prefix="" /> <!-- replace linebreaks by '' to get it prepared for using it as includes -->
<striplinebreaks />
</filterchain>
</loadfile>
<union id="jar.res">
<fileset dir="${classesfolder}"/>
<multirootfileset basedirs="${libs.classes}" includes="**/*"/>
<resources refid="${subproject}.jar.res" />
</union>
<invoke-jar-standalone outputfolder="${subproject.basedir}" filesuffix="${subproject}" resources="jar.res" jarresources="${libs.jars}"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% JAR %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<target name="jar" depends="javac" description="Builds a jar file with all classes belonging to this package.">
<invoke-jar outputfolder="${subproject.basedir}" filesuffix="${subproject}" classesfolder="${classesfolder}"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLEANING %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<target name="clean" description="Cleans this project">
<invoke-clean
classesfolder="${classesfolder}"
testclassesfolder="${testclassesfolder}"
javadocfolder="${javadocfolder}"
subproject="${subproject}"/>
</target>
<target name="clean-all" description="Cleans this project, including the reports">
<invoke-clean-all
classesfolder="${classesfolder}"
testclassesfolder="${testclassesfolder}"
javadocfolder="${javadocfolder}"
subproject="${subproject}"
reportsfolder="${reportsfolder}"
testoutputfolder="${testoutputfolder}" />
</target>
</project>