forked from erikw/cs142a-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
163 lines (134 loc) · 5.4 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
158
159
160
161
162
163
<?xml version="1.0" encoding="UTF-8"?>
<project name="crxc" basedir="." default="compile">
<description>
Build script for the crux project by Erik Westrup.
</description>
<!-- *** Global Variables *** -->
<property name="project.name" value="cruxc" />
<property name="project.authors" value="Erik Westrup" />
<property name="path.source" value="src" />
<property name="path.destination" value="bin" />
<property name="path.library" value="lib" />
<property name="path.documentation" value="doc/gen/" />
<property name="path.release" value="release" />
<property name="path.test" value="test" />
<property name="path.mainClass" value="crux/Compiler" />
<!-- Library versions in use. Please update path externalLibs if you add/remove from here.-->
<property name="junit" value="junit-4.10.jar" />
<!-- *** Paths *** -->
<path id="externalLibs">
<fileset dir="${path.library}">
<include name="${junit}" />
</fileset>
</path>
<path id="classpath.tests">
<pathelement location="${path.destination}" />
</path>
<!-- *** Targets *** -->
<!-- Here all targets exists. -->
<target name="compile" depends="tags" description="Compile the sources to the destination.">
<mkdir dir="bin" />
<javac destdir="${path.destination}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
<src path="${path.source}" />
<classpath refid="externalLibs" />
<compilerarg value="-Xlint" /> <!-- Enable all recommended warnings. -->
</javac>
</target>
<target name="tags" description="Generate a tags file.">
<exec executable="ctags">
<arg value="-R"/>
<arg value="."/>
</exec>
</target>
<target name="release" depends="distribute,test" description="Make a full release.">
<property name="jarName" value="${path.release}/${project.name}.jar" />
<echo message="A full release was successfully created!" />
<echo message="File: ${jarName}" />
</target>
<target name="cc" depends="clean,compile" description="Short hand for clean and compile.">
</target>
<target name="distribute" depends="compile,doc" description="Make a releaseable JAR.">
<property name="jarName" value="${path.release}/${project.name}.jar" />
<delete file="${jarName}" />
<jar destfile="${jarName}" update="no">
<zipgroupfileset dir="${path.library}">
<include name="**/*.jar" />
</zipgroupfileset>
<fileset dir="${path.documentation}" includes="**/*" />
<fileset dir="${path.destination}" includes="**/*.class" />
<manifest>
<attribute name="Main-class" value="${path.mainClass}" />
</manifest>
</jar>
</target>
<target name="clean" description="Delete old binaries and text files.">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${path.destination}" includes="**/*" />
<fileset dir="${path.documentation}" includes="**/*" />
</delete>
</target>
<target name="test" depends="compile" description="Run JUnit tests and stop build if one fails.">
<junit printsummary="true" fork="yes" haltonfailure="true">
<formatter type="plain" usefile="no" />
<classpath refid="classpath.tests" />
<classpath refid="externalLibs" />
<!-- Enalbe java keyword assert. Can by enable on commandline with $(java [-ea|-enableassertions]). -->
<assertions><enable/></assertions>
<batchtest>
<!-- The $* excludes inner classes. -->
<fileset dir="${path.destination}/" includes="${path.test}/**/**Test**.class" excludes="**/*$*.class" />
</batchtest>
</junit>
</target>
<target name="doc" description="Generate javadocs from sourcefiles">
<mkdir dir="${path.documentation}" />
<javadoc destdir="${path.documentation}" author="true" version="true" use="true" doctitle="${project.name} Documentation" windowtitle="${project.name} Documentation" bottom="Documentation produly presented by the authors ${project.authors}." encoding="UTF-8">
<fileset dir="${path.source}">
<include name="**/*.java" />
<exclude name="**/*Test*.java" />
</fileset>
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://opencsv.sourceforge.net/api/" />
</javadoc>
</target>
</project>
<!--
Old configurations:
<property name="path.report" value="report_junittest" />
<property name="mail.user" value="[email protected]" />
<property name="mail.password" value="" />
<property name="uispec4j" value="uispec4j-2.4-jdk16.jar" />
>>clean
<delete dir="${path.report}" />
>>test
<mkdir dir="${path.report}"/>
>>test>>junit
<formatter type="xml" usefile="yes"/>
<batchtest todir="${path.report}">
<target name="mail" description="Mail the current version to the customer.">
<property prefix="svn" file="svn.properties"/>
<property name="jarName" value="${path.release}/${project.name}-${svn.Revision}.jar" />
<mail
charset="UTF-8"
encoding="mime"
failonerror="true"
tolist="[email protected]"
bcclist="[email protected]"
from="[email protected]"
replyto="[email protected]"
subject="[Endueo ${project.group}] new release!"
mailhost="smtp.gmail.com"
mailport="465"
ssl="true"
user="${mail.user}"
password="${mail.password}">
<message>
Hello,
a new release of ${project.name} is available. It is built from revision ${svn.Revision} and an executable JAR is attached in this email. Please enjoy the software.
Greetings from the members of group ${project.group}:
${project.authors}.
</message>
<fileset dir="." includes="${jarName}"/>
</mail>
</target>
-->