-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon-build.xml
More file actions
139 lines (114 loc) · 6.23 KB
/
common-build.xml
File metadata and controls
139 lines (114 loc) · 6.23 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
<!--
this build should be imported by each products top-level build file that is
located in conf
-->
<project name="rti-common-build" default="-fail">
<import file="common.xml"/>
<target name="-pre-compile-java" description="hook target called before compilation"/>
<target name="compile-nodeps" description="Compile java but do not compile dependencies" depends="-init">
<property name="nodeps" value="true"/>
<antcall inheritall="true" target="compile"/>
</target>
<target name="-compile-deps" if="product.deps" unless="nodeps">
<collectproducts separator="," property="collected.product.deps"/>
<echo level="verbose">compiling deps for ${product.name} : ${collected.product.deps}</echo>
<deps target="compile" products="${collected.product.deps}"/>
</target>
<target name="-compile-java" depends="-init,-pre-compile-java,-init-javac,-compile-deps" >
<javacompile src="${src.dir}" dest="${build.dir}" cp="${build.classpath}"/>
</target>
<target name="compile" description="Compile product and all dependencies, including tests" depends="-init,-pre-compile-java,-init-javac,-compile-deps,-compile-java,-check-tests,-compile-tests" >
<echo level="verbose">compiling ${product.name}</echo>
<copy todir="${build.dir}">
<fileset dir="${src.dir}" includes="${jar.includes}" excludes="${default.jar.excludes}" />
</copy>
<condition property="no.graphics">
<not><available file="${graphics.dir}"/></not>
</condition>
<antcall target="-copy-graphics"/>
</target>
<target name="-copy-graphics" unless="no.graphics">
<copy todir="${build.dir}">
<fileset dir="${graphics.dir}" includes="**/*"/>
</copy>
</target>
<target name="build" depends="clean,compile" description="clean and compile this product"/>
<target name="javadoc" description="Create javadocs" depends="-init,-init-java">
<mkdir dir="${jdoc.dir}"/>
<javadoc destdir="${jdoc.dir}">
<classpath>
<path path="${build.classpath}" />
</classpath>
<packageset dir="${src.dir}" includes="rti/**,RTi/**"/>
<tag name="todo"/>
<tag name="revisit"/>
</javadoc>
</target>
<target name="clean" description="Clean class files and jar file, including tests" depends="-init">
<delete dir="${build.dir}" quiet="true" />
<delete quiet="true">
<fileset dir="${dist.dir}" includes="*.jar"/>
</delete>
<delete dir="${test.build.dir}" quiet="true" />
<delete dir="${coverage.dir}" quiet="true" />
</target>
<target name="clean-deps" depends="-init,-init-deps,clean" if="product.deps" description="clean this product and all dependencies">
<collectproducts separator=","/>
<deps target="clean" products="${collected.product.deps}"/>
</target>
<target name="clean-all" description="Clean all build products" depends="-init,clean">
<delete dir="${jdoc.dir}" quiet="true" />
<delete dir="${dist.dir}" quiet="true" />
<delete dir="${test.dir}/results" quiet="true" />
</target>
<target name="clean-all-deps" description="Clean all build products and clean-all on all dependencies" depends="-init,-init-deps,clean-all">
<collectproducts separator="," property="collected.product.deps"/>
<deps target="clean-all" products="${collected.product.deps}"/>
</target>
<target name="test" description="Run all tests" depends="-init,-check-tests,compile">
<fail unless="tests.exist" message="No build file exists for this product - create one at ${test.dir}/build.xml"/>
<ant antfile="${test.dir}/build.xml" target="all-tests" />
</target>
<target name="-check-tests">
<available filepath="${test.dir}" file="build.xml" property="tests.exist"/>
</target>
<target name="test-deps" description="Test with dependencies" depends="-init-deps,test">
<deps target="test" products="${collected.product.deps}"/>
</target>
<target name="-compile-tests" description="foo" depends="-check-tests" if="tests.exist">
<!-- todo figure out way to pass emma.disabled through to here -->
<ant antfile="${test.dir}/build.xml" target="build-all-tests"/>
</target>
<target name="run" description="Run java.main.class as defined in product" depends="-init-deps,-init-java,-init-build">
<requireprop name="java.main.class" />
<runjava main="${java.main.class}" cp="${run.classpath.computed}" dir="${java.main.cwd}">
<vmargs><jvmarg value="${java.main.vmargs}"/></vmargs>
<args line="${java.main.args}" />
</runjava>
</target>
<target name="jar" description="Create product jar from name and version" depends="compile" unless="jar.skip">
<dojar jar="${jar.name}" />
</target>
<target name="jar-no-deps" description="Create jar without calling deps" depends="compile-nodeps" unless="jar.skip">
<dojar jar="${jar.name}" />
</target>
<target name="jar-deps" description="Build all dependency jars" depends="-init">
<collectproducts separator="," property="collected.product.deps"/>
<echo level="verbose">compiling deps for ${product.name} : ${collected.product.deps}</echo>
<deps target="jar" products="${collected.product.deps}"/>
<antcall target="jar-no-deps"/>
</target>
<target name="pre-release" description="Complete clean,build,test, and jar" depends="clean-deps,jar"/>
<target name="profile" description="Netbeans profiler target" depends="-init-deps,compile">
<fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<path path="${run.classpath.computed}"/>
</classpath>
</nbprofiledirect>
<java jvm="${profiler.info.jvm}" fork="true" classname="${profile.class}" classpath="${run.classpath.computed}">
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.session.jvm.args}"/>
</java>
</target>
</project>