-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
204 lines (179 loc) · 7.04 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
197
198
199
200
201
202
203
204
<?xml version="1.0" encoding="UTF-8"?>
<!-- GEdit Ant Build -->
<!-- ======================================================================= -->
<project basedir="." default="usage" name="GEdit">
<!-- Directories & Options -->
<property file="build.properties"/>
<!-- JAR Filename Defs -->
<property name="java2html.jar" value="j2h.jar"/>
<property name="swt.jar" value="swt.jar"/>
<!-- Class Path Defs -->
<path id="compile.cp">
<pathelement location="${lib}/${java2html.jar}"/>
<pathelement location="${lib.win32}/${swt.jar}"/>
<fileset dir="target/dependency">
<include name="**/*.jar" />
</fileset>
</path>
<!-- Java 2 Html Task Defs -->
<taskdef name="java2html" classname="com.java2html.Java2HTMLTask" classpath="${lib}/${java2html.jar}"/>
<target name="usage">
<echo>
Build system for GEdit.
Usage: ant [target]
Useful targets:
usage - prints this menu
compile - compiles all source code
build - builds all distributable files
javadoc - generates javadoc documentation
clean - removes all intermeditate class files
clean-all - restores build to original state
</echo>
</target>
<!-- Compile Tasks -->
<target name="gedit-prepare">
<tstamp>
<format property="build.time" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
</tstamp>
<echo>
Welcome to the GEdit Build. We hope you enjoy your stay.
Build Time is: ${build.time}
Buliding GEdit = for ${os.name} ${os.arch} ${os.version}
Using ${java.vendor}'s version ${java.version}
Using ${ant.version}
Using config ./build.properties
</echo>
<pathconvert targetos="unix" property="compile.cp.str" refid="compile.cp">
<map from="${checkout.dir}" to=""/>
<map from="c:" to="/"/>
</pathconvert>
<echo message="compile.classpath = ${compile.cp.str}"/>
</target>
<!-- Compiles all JAVA Source -->
<target name="compile" depends="deps,gedit-prepare">
<mkdir dir="${build.java}"/>
<mkdir dir="${build.stage}"/>
<mkdir dir="${dist}"/>
<!-- Copy any config files to the build classpath -->
<copy todir="${build.java}">
<fileset dir="${src.resources}">
<include name="**/*"/>
</fileset>
</copy>
<!-- Compile JAVA SRC -->
<javac debug="${debug}" optimize="${optimization}" source="${source.level}"
srcdir="${src.java}" destdir="${build.java}"
deprecation="${deprecation}">
<classpath>
<path refid="compile.cp"/>
</classpath>
</javac>
</target>
<!-- Build Tasks -->
<target name="build" depends="compile,gedit-jar,doJnlp,doSignJars,javadoc"/>
<!-- Builds gedit.jar -->
<target name="gedit-jar" depends="compile">
<!-- Create gedit.jar -->
<jar destfile="${dist}/gedit.jar">
<fileset dir="${build.java}">
<include name="**/*"/>
</fileset>
<manifest>
<attribute name="Sealed" value="true"/>
<attribute name="Main-Class" value="com.reformation.graph.gui.GEdit"/>
</manifest>
</jar>
</target>
<target name="doJnlp">
<!-- Create JDIC Jars -->
<mkdir dir="${dist}/${lib.linux}"/>
<mkdir dir="${dist}/${lib.win32}"/>
<copy todir="${dist}/${lib.win32}" file="${lib.win32}/swt.jar"/>
<!--
<jar destfile="${dist}/${lib.linux}/jdicnativelib.jar">
<fileset dir="${src}/${lib.linux}">
<include name="**/*"/>
<exclude name="jdic.jar"/>
</fileset>
<manifest>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
-->
<jar destfile="${dist}/${lib.win32}/swt-native.jar">
<fileset dir="${lib.win32}">
<include name="**/*"/>
<exclude name="swt.jar"/>
</fileset>
<manifest>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
<!-- Replace JNLP CONFIG -->
<copy todir="${dist}" file="${src}/docs/GEdit.jnlp"/>
<replace dir="${dist}" includes="*.jnlp" summary="yes">
<replacefilter token="@JNLP_CODEBASE@" value="${jnlp.codebase}"/>
<replacefilter token="@LIB_WIN32@" value="${lib.win32}"/>
<replacefilter token="@LIB_LINUX@" value="${lib.linux}"/>
</replace>
</target>
<target name="doSignJars">
<signjar jar="${dist}/gedit.jar" alias="Randy Secrist" keystore="${src}/docs/ssl.keystore" storepass="gedit-key"/>
<signjar jar="${dist}/${lib.win32}/swt.jar" alias="Randy Secrist" keystore="${src}/docs/ssl.keystore" storepass="gedit-key"/>
<signjar jar="${dist}/${lib.win32}/swt-native.jar" alias="Randy Secrist" keystore="${src}/docs/ssl.keystore" storepass="gedit-key"/>
<copy todir="${dist}/images" file="${src.resources}/images/Gedit32a.gif"/>
<copy todir="${dist}/html">
<fileset dir="${src.docs}/html">
<include name="**/*"/>
</fileset>
</copy>
</target>
<!-- JavaDoc Source -->
<target name="javadoc">
<property name="runJAVADOC" value="true"/>
<antcall target="do-javadoc" inheritRefs="true"/>
</target>
<target name="do-javadoc" if="runJAVADOC">
<mkdir dir="${dist}/api"/>
<mkdir dir="${dist}/src"/>
<javadoc sourcepath="${src.java}" destdir="${dist}/api"
packagenames="*" linksource="true" breakiterator="true"
author="true" private="false" version="true" source="${source.level}"
windowtitle="GEdit API Documentation"
doctitle="<h1>GEdit Documentation</h1>"
bottom="Copyright © 2004 Randy Secrist">
<classpath>
<path refid="compile.cp"/>
</classpath>
</javadoc>
<java2html title="GEdit Documentation" simple="no" tabsize="4"
marginsize="2" header="true" footer="false"
destination="${dist}/src">
<fileset dir="${src.java}">
<include name="**/*.java"/>
</fileset>
<javadoc localRef="${dist}/api"/>
</java2html>
</target>
<target name="deps">
<exec executable="mvn">
<arg value="dependency:copy-dependencies"/>
</exec>
</target>
<target name="run" depends="gedit-jar">
<exec executable="java">
<arg value="-cp"/>
<arg value="target/dependency/*:dist/gedit.jar"/>
<arg value="com.reformation.graph.gui.GEdit"/>
</exec>
</target>
<!-- Cleans all intermeditate class files -->
<target name="clean">
<delete dir="${build}" quiet="false"/>
</target>
<!-- Cleans build to original state -->
<target name="clean-all" depends="clean">
<delete dir="${dist}" quiet="false"/>
<delete dir="target/dependency" quiet="false"/>
</target>
</project>