-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.xml
More file actions
82 lines (82 loc) · 3.36 KB
/
build.xml
File metadata and controls
82 lines (82 loc) · 3.36 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
<!-- Ant build script for Java Signals port
http://paulmoore.mit-license.org/
-->
<project name="Java Signals" default="build" basedir=".">
<!-- Property file -->
<property file="build.properties" />
<!-- Define the java classpath -->
<path id="classpath">
<fileset dir="${lib}" includes="**/*.jar" />
</path>
<target name="clean" description="delete old build">
<!-- Delete the build directory -->
<delete includeemptydirs="true" quiet="true">
<fileset dir="${build}" defaultexcludes="false" />
</delete>
</target>
<target name="-init" depends="clean" description="make neccessary build directories">
<tstamp>
<format property="TODAY_US" pattern="yyyy-mm-dd-hhhh-ss" locale="en,US" />
</tstamp>
<!-- Create the build directory -->
<mkdir dir="${build}" />
<!-- Create the bin for class files -->
<mkdir dir="${classes}" />
<!-- Create the jar directory -->
<mkdir dir="${jar}" />
</target>
<target name="-compile" depends="-init" description="compile the source">
<javac srcdir="${src}" destdir="${classes}" debug="on" debuglevel="lines,vars,source" />
</target>
<target name="generate-docs" description="generate the javadocs">
<!-- Create the java docs directory -->
<mkdir dir="${javadocs}" />
<javadoc sourcepath="${src}" destdir="${javadocs}" doctitle="Java Signals API Documentation" />
</target>
<target name="-create-manifest" description="create the manifest file for the jar to use">
<manifest file="${jar}/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Project-Author" value="${project.author}" />
<section name="common">
<attribute name="Specification-Title" value="${project.title}" />
<attribute name="Specification-Version" value="${project.version} ${TODAY}" />
<attribute name="Specification-Vendor" value="Paul Moore" />
</section>
<section name="com/paulm/jsignal/">
<attribute name="Sealed" value="true" />
</section>
</manifest>
</target>
<target name="-create-jar" depends="-compile,-create-manifest" description="generate signals jar library file">
<jar destfile="${jar}/${project.name}-${project.version}.jar" basedir="${classes}" excludes="**/Test.class" manifest="${jar}/MANIFEST.MF">
<fileset file="MIT-LICENSE.txt" />
</jar>
<delete file="${jar}/MANIFEST.MF" />
</target>
<target name="-compile-tests" description="compile the test source">
<javac srcdir="${test-src}" destdir="${classes}" classpathref="classpath" debug="on" debuglevel="lines,vars,source" />
</target>
<target name="run-tests" depends="-compile,-compile-tests" description="run the junit test cases">
<!-- Create the junit test results directory -->
<mkdir dir="${test-results}" />
<junit printsummary="withOutAndErr" haltonfailure="no" fork="yes" timeout="60000">
<!--1 minute timeout-->
<classpath>
<path refid="classpath" />
<pathelement location="${classes}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${test-results}">
<fileset dir="${test-src}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="build" description="build the jsignal library">
<record name="build.log" loglevel="verbose" append="false" action="start" />
<antcall target="-create-jar" />
<record name="build.log" action="stop" />
<move file="build.log" todir="${build}" />
</target>
</project>