forked from florinpatrascu/micro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
196 lines (166 loc) · 7.41 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c)2012-2013 Florin T.PATRASCU
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project name="Micro" default="dist">
<presetdef name="javac">
<javac includeantruntime="false"/>
</presetdef>
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
<property environment="env"/>
<property name="release.major" value="0"/>
<property name="release.minor" value="1"/>
<property file="build.properties"/>
<property name="skip.tests" value="true"/>
<!-- Compiler options -->
<property name="compiler.debug" value="on"/>
<property name="compiler.optimize" value="on"/>
<property name="compiler.generate.no.warnings" value="off"/>
<property name="compiler.encoding" value="utf-8"/>
<property name="compiler.args" value=""/>
<property name="compiler.source" value="1.6"/>
<property name="compiler.target" value="1.6"/>
<!-- Compiler resources -->
<patternset id="compiler.resources">
<include name="**/?*.properties"/>
<include name="**/?*.xml"/>
<include name="**/?*.vm"/>
<include name="**/?*.yaml"/>
<include name="**/?*.json"/>
</patternset>
<!-- ==================================================== -->
<!-- Initialize Ant -->
<!-- ==================================================== -->
<target name="init">
<tstamp/>
</target>
<!-- unlock the automatic numbering when Micro is released to public -->
<!--
<buildnumber file="build.number"/>
<property name="version" value="${release.major}.${release.minor}.${build.number}"/>
-->
<property name="version" value="${release.major}.${release.minor}.2"/>
<!-- ====================================================================== -->
<!-- Compile the source code. -->
<!-- ====================================================================== -->
<target name="compile" depends="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<copy todir="${build.dir}/sources">
<fileset dir="${src.dir}"/>
</copy>
<replace file="${build.dir}/sources/ca/simplegames/micro/Globals.java">
<!--<replacefilter token="$DATE$" value="${svn.info.lastDate}" />-->
<replacefilter token="$VERSION$" value="${version}" />
</replace>
<javac srcdir="${build.dir}/sources"
destdir="${build.classes}"
debug="${compiler.debug}"
deprecation="${compiler.generate.no.warnings}"
encoding="utf8"
optimize="${compiler.optimize}">
<include name="**/*.java"/>
<classpath>
<fileset dir="${global.libraries}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<copy todir="${build.classes}">
<fileset dir="java/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Create the JAR archive. -->
<!-- ====================================================================== -->
<target name="dist" depends="compile">
<mkdir dir="${build.dist}"/>
<jar jarfile="${build.dist}/${name}-${version}.jar" basedir="${build.classes}">
<manifest>
<attribute name="Signature-Title" value="${name}"/>
<attribute name="Signature-Version" value="${version}"/>
<attribute name="Signature-Vendor" value="${copyright}"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
</jar>
<copy file="LICENSE"
tofile="${build.dist}/LICENSE"
overwrite="true"/>
</target>
<!-- ====================================================================== -->
<!-- Clean up generated stuff -->
<!-- ====================================================================== -->
<target name="clean">
<delete dir="${build.dist}"/>
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Run the tests -->
<!-- ====================================================================== -->
<target name="test" depends="dist, compile_test">
<junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${test.dir}">
<jvmarg value="-Dfile.encoding=UTF-8"/>
<jvmarg value="-Dnet.sf.ehcache.skipUpdateCheck=true"/>
<formatter type="plain"/>
<!--<formatter type="xml"/>-->
<classpath>
<fileset dir="${global.libraries}">
<include name="**/*.jar"/>
</fileset>
<path id="micro" location="${build.dist}/${name}-${version}.jar"/>
<path id="test_classes" location="${build.test.classes}"/>
</classpath>
<batchtest fork="yes" todir="${build.dir}">
<fileset dir="${test.dir}">
<include name="**/MicroTestSuite.java"/>
<!--<include name="**/*Test*.java"/>-->
</fileset>
</batchtest>
</junit>
</target>
<!-- ====================================================================== -->
<!-- Compile the test classes. -->
<!-- ====================================================================== -->
<target name="compile_test" depends="dist">
<mkdir dir="${build.test.classes}"/>
<javac srcdir="${test.dir}"
destdir="${build.test.classes}"
debug="${compiler.debug}"
deprecation="${compiler.generate.no.warnings}"
encoding="utf8"
includeantruntime="false"
optimize="${compiler.optimize}">
<exclude name="${test.dir}/files/**"/>
<classpath>
<fileset dir="${global.libraries}">
<include name="**/*.jar"/>
</fileset>
<path id="micro" location="${build.dist}/${name}-${version}.jar"/>
</classpath>
</javac>
<copy todir="${build.test.classes}/files">
<fileset dir="${test.dir}/files">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
</project>