-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
95 lines (86 loc) · 3.69 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
<project name="byron" basedir="." default="compile">
<property name="home.dir" value="." />
<property name="src.dir" value="src" />
<property name="build.dir" value="out" />
<property name="lib.dir" value="lib" />
<property name="dist.dir" value="${basedir}" />
<!--
This version number is sourced in org.joedog.pinochle.Version
This target parses that file, trims white space and newlines
and assigns the release number to the version property.
-->
<target name="release">
<loadfile srcfile="${src.dir}/org/joedog/${ant.project.name}/Version.java" property="version">
<filterchain>
<linecontainsregexp>
<regexp pattern='public final static String version = ".*";'/>
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern='public final static String version = "(.*)";' replace='\1'/>
<replaceregex pattern=" " replace="" flags="g"/>
</tokenfilter>
</filterchain>
</loadfile>
<script language="javascript">
var version = project.getProperty("version");
project.setProperty("version", version.replaceAll("\n", ""));
</script>
<echo>"${version}"</echo>
</target>
<target name="clean">
<delete dir="${build.dir}"></delete>
</target>
<path id="classpath">
<pathelement location="${build.dir}" />
<!--<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>-->
</path>
<target name="compile">
<mkdir dir="${build.dir}" />
<javac debug="true" includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}">
<!-- <compilerarg value="-Xlint"/> -->
<classpath refid="classpath" />
<include name="**/*.java"/>
</javac>
</target>
<target name="resources" >
<copy todir="${build.dir}/org/joedog/byron/images" >
<fileset dir="${src.dir}/org/joedog/byron/images" includes="*.png" />
</copy>
<copy todir="${build.dir}/org/joedog/byron/engine/menace" >
<fileset dir="${src.dir}/org/joedog/byron/engine/menace" includes="*.properties" />
</copy>
<copy todir="${build.dir}/org/joedog/byron/model" >
<fileset dir="${src.dir}/org/joedog/byron/model" includes="*.ser" />
</copy>
<copy todir="${build.dir}//org/joedog/byron/files">
<fileset dir="${src.dir}/org/joedog/byron/files" includes="*.html" />
</copy>
</target>
<target name="run" depends="clean,compile,resources">
<java classname="org.joedog.byron.Main" fork="yes">
<classpath refid="classpath" />
<jvmarg value="-splash:${build.dir}org/joedog/byron/images/splash.png"/>
</java>
</target>
<target name="jar" depends="release,clean,compile,resources">
<jar jarfile="${dist.dir}/${ant.project.name}-${version}.jar" basedir="${build.dir}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="org.joedog.byron.Main" />
<attribute name="SplashScreen-Image" value="org/joedog/byron/images/splash.png" />
<section name="common">
<attribute name="Specification-Title" value="${component.name}" />
<attribute name="Specification-Version" value="${component.version}" />
<attribute name="Specification-Vendor" value="${component.vendor}" />
<attribute name="Implementation-Title" value="${component.name}" />
<attribute name="Implementation-Version" value="${component.version} ${TODAY}" />
<attribute name="Implementation-Vendor" value="${component.vendor}" />
</section>
<attribute name="Class-Path" value="${libs.dir}" />
</manifest>
</jar>
</target>
<target name="main" depends="clean,run" />
</project>