-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
159 lines (129 loc) · 5.19 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
<project name="RuleML2TPTP" basedir="." default="jar"
xmlns:if="ant:if" xmlns:unless="ant:unless">
<echo message="ant.home = ${ant.home}" if:set="ant.home"/>
<echo message="ant.java.version = ${ant.java.version}"
if:set="ant.java.version"/>
<property name="debug.address" value="localhost:6789"/>
<property name="debug.suspend" value="n"/>
<property name="main-class" value="ca.unb.meng.${ant.project.name}"/>
<property name="dist.file.basename" value="ruleml2tptp"/>
<property name="src.dir" value="src"/>
<property name="resources.dir.name" value="resources"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="jar.file" value="${jar.dir}/${dist.file.basename}.jar"/>
<property name="lib.dir" value="lib"/>
<property name="doc.dir" value="doc"/>
<property name="dist.dir" value="release"/>
<path id="lib.classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<fileset dir="${lib.dir}" includes="**/*.zip"/>
</path>
<path id="jar.lib.classpath">
<fileset dir="${jar.dir}" includes="**/*.jar"/>
<fileset dir="${jar.dir}" includes="**/*.zip"/>
</path>
<target name="clean" description="Clean the classes and jar files.">
<delete dir="${classes.dir}"/>
<delete includeemptydirs="true" quiet="true">
<fileset file="${jar.file}"/>
</delete>
</target>
<target name="clean-all" description="Clean more thoroughly.">
<delete dir="${build.dir}"/>
<delete dir="${doc.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="compile" description="Compile source code into class files.">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" fork="yes"
classpathref="lib.classpath" includeAntRuntime="false"/>
</target>
<target name="compile-debug"
description="Compile source code into class files with the debug option.">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" fork="yes"
classpathref="lib.classpath" includeAntRuntime="false"
debug="true"/>
</target>
<target name="input-run-args" unless="run.args">
<input message="Enter the command-line option(s) and/or argument(s):"
addproperty="run.args"/>
</target>
<target name="run" depends="compile,input-run-args"
description="Run classes.">
<java classname="${main-class}" fork="true">
<jvmarg line="${run.jvmargs}" if:set="run.jvmargs"/>
<classpath>
<path location="${classes.dir}"/>
<path location="${src.dir}"/>
<path refid="lib.classpath"/>
</classpath>
<arg line="${run.args}" if:set="run.args"/>
</java>
</target>
<target name="run-debug" depends="compile-debug,input-run-args"
description="Run classes for debugging. Assertions are enabled by default.">
<java classname="${main-class}" fork="true">
<jvmarg value="-agentlib:jdwp=transport=dt_socket,address=${debug.address},server=y,suspend=${debug.suspend}"/>
<jvmarg value="-ea"/>
<jvmarg line="${run.jvmargs}" if:set="run.jvmargs"/>
<classpath>
<path location="${classes.dir}"/>
<path location="${src.dir}"/>
<path refid="lib.classpath"/>
</classpath>
<arg line="${run.args}" if:set="run.args"/>
</java>
</target>
<target name="jar" depends="compile"
description="Make classes into a jar file.">
<mkdir dir="${jar.dir}"/>
<copy todir="${jar.dir}">
<fileset dir="${lib.dir}"/>
</copy>
<manifestclasspath property="jar.manifest.classpath" jarfile="${jar.file}"
maxParentLevels="0">
<classpath refid="jar.lib.classpath"/>
</manifestclasspath>
<jar destfile="${jar.file}">
<metainf file="LICENSE"/>
<metainf file="NOTICE"/>
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="${jar.manifest.classpath}"/>
</manifest>
<fileset dir="${classes.dir}"/>
<fileset dir="${src.dir}" includes="${resources.dir.name}/"/>
</jar>
</target>
<target name="run-jar" depends="jar,input-run-args"
description="Run the jar file.">
<java jar="${jar.file}" fork="true">
<jvmarg line="${run.jvmargs}" if:set="run.jvmargs"/>
<arg line="${run.args}" if:set="run.args"/>
</java>
</target>
<!--
<target name="doc" description="Generate documentation.">
<delete dir="${doc.dir}"/>
<mkdir dir="${doc.dir}"/>
<javadoc sourcepath="${src.dir}" destdir="${doc.dir}" access="protected"
author="true">
</javadoc>
</target>
-->
<target name="release" depends="jar">
<input message="Enter the release version:" addproperty="release.version"/>
<property name="release.file.basename"
value="${dist.dir}/${dist.file.basename}_v${release.version}"/>
<tar destfile="${release.file.basename}.tar"
basedir="${jar.dir}" includes="*.jar"/>
<gzip src="${release.file.basename}.tar"
destfile="${release.file.basename}.tar.gz"/>
<zip destfile="${release.file.basename}.zip"
basedir="${jar.dir}" includes="*.jar"/>
<delete file="${release.file.basename}.tar"/>
</target>
</project>