-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
126 lines (115 loc) · 3.92 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
<project name="JSChat" default="compile" basedir=".">
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="release" value="release"/>
<!--<property name="build.compiler" value="jikes"/>-->
<property name="dist" value="dist"/>
<property name="docs" value="docs"/>
<property name="web.browser" value="iexplore"/>
<target name="help">
<echo>init : Copy Meta-inf file to ${build} directory</echo>
<echo>clean : Delete build and dist directories (default)</echo>
<echo>compile : Compile source code</echo>
<echo>CRC32 : Run CRC32 utility</echo>
<echo>dist : Build JSChat.jar</echo>
<echo>release : Build JSChat.zip and backup source</echo>
<echo>doc : Build API documentation</echo>
<echo>run : Run using classes</echo>
</target>
<target name="init">
<mkdir dir="${build}/classes"/>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${docs}/api"/>
<delete dir="${dist}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}/classes" target="1.5" source="1.5">
<classpath>
<pathelement path="${build}/classes"/>
<pathelement location="lib/bcprov-jdk15on-148.jar"/>
</classpath>
</javac>
</target>
<target name="CRC32" depends="compile">
<java classname="chat.crc.CRC32" fork="yes">
<classpath>
<pathelement path="${build}/classes"/>
</classpath>
</java>
</target>
<target name="run" depends="compile">
<java classname="chat.JSChat" fork="yes">
<sysproperty key="java.security.policy" value="java.policy"/>
<classpath>
<pathelement path="${build}/classes"/>
<pathelement location="lib/jce.zip"/>
</classpath>
</java>
</target>
<target name="jar" depends="compile">
<copy todir="${build}/classes/Meta-inf">
<fileset dir="Meta-inf"/>
</copy>
<mkdir dir="${dist}"/>
<copy file="lib/bcprov-jdk15on-148.jar" todir="${dist}"/>
<jar jarfile="${dist}/JSChat.jar" basedir="${build}/classes" manifest="${build}/classes/Meta-inf/Manifest.mf"/>
</target>
<!-- Retro Guard not working/configured correctly yet -->
<target name="RGgui" depends="jar">
<java classname="RGgui"/>
</target>
<!-- Retro Guard not working/configured correctly yet -->
<target name="dist" depends="jar">
<tstamp>
<format property="DSTAMP" pattern="yyyyMMdd-HH'h'mm'm'ss's'"/>
</tstamp>
<java classname="RetroGuard">
<arg value="${dist}/JSChat.jar"/>
<arg value="${dist}/JSChat-${DSTAMP}.jar"/>
<arg value="scripts.rgs"/>
<classpath>
<pathelement path="${java.class.path}"/>
<pathelement path="${build}/classes"/>
<pathelement location="lib/jce.zip"/>
</classpath>
</java>
</target>
<target name="release" depends="jar">
<tstamp>
<format property="DSTAMP" pattern="yyyyMMdd-HH'h'mm'm'ss's'"/>
</tstamp>
<jar jarfile="${release}/JSChatSource-${DSTAMP}.jar" basedir="${src}"/>
<mkdir dir="${release}/lib"/>
<copy file="${dist}/JSChat.jar" todir="${release}/lib/"/>
<copy file="lib/bcprov-jdk15on-148.jar" todir="${release}/lib/"/>
<delete file="${release}/JSChat.tar"/>
<delete file="${release}/JSChat.tar.gz"/>
<tar longfile="gnu" tarfile="${release}/JSChat.tar" >
<tarfileset dir="${release}" mode="744">
<include name="run.sh"/>
<include name="run.bat"/>
</tarfileset>
<tarfileset dir="${release}" mode="644">
<include name="readme.txt"/>
<!--<include name="java_win32.policy"/>-->
<!--<include name="java_unix.policy"/>-->
</tarfileset>
<tarfileset dir="${release}" mode="550">
<include name="lib/*.jar"/>
</tarfileset>
</tar>
<gzip zipfile="${release}/JSChat.tar.gz" src="${release}/JSChat.tar"/>
<delete dir="${release}/lib"/>
</target>
<target name="html">
<mkdir dir="${docs}/html"/>
<java classname="j2h" fork="yes">
<arg line="-js ${src} -jd ${docs}/api -d ${docs}/html"/>
<classpath>
<pathelement path="lib/j2h.jar"/>
</classpath>
</java>
</target>
</project>