[r5985]: common.build / trunk / common-webstart-targets.xml  Maximize  Restore  History

Download this file

235 lines (194 with data), 8.7 kB

  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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<project name="imported" xmlns:props="antlib:org.apache.ant.props" basedir="." default="init">
<!--
You must ensure that the Pack200Task.jar is in the classpath; simplest is to copy it to ~/.ant/lib
but this allows the file to be part of a SCM system. Ditto for the antlib-props
-->
<taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task">
<classpath>
<pathelement location="../common.build/lib/Pack200Task.jar" />
</classpath>
</taskdef>
<taskdef name="unpack200" classname="com.sun.tools.apache.ant.pack200.Unpack200Task">
<classpath>
<pathelement location="../common.build/lib/Pack200Task.jar" />
</classpath>
</taskdef>
<target name="init">
<property file="conf/build.properties" />
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="../dist" />
<property name="tmp" location="tmp" />
<property name="lib" location="lib" />
<property name="tmp.zipdir" location="${tmp}/${ant.project.name}-${app.version}" />
</target>
<target name="setup" depends="init">
<mkdir dir="${build}" />
<delete dir="${tmp}" />
<mkdir dir="${tmp}" />
<mkdir dir="${tmp.zipdir}" />
</target>
<target name="compile" depends="setup">
<javac srcdir="${src}" destdir="${build}" includeantruntime="false" target="1.6" source="1.6" debug="true" debuglevel="lines,source,vars">
<classpath>
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="generate-manifest" depends="init">
<pathconvert dirsep="/" pathsep=" " property="manifest.class.path">
<map from="${lib}" to="lib" />
<path>
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
</path>
</pathconvert>
<manifest file="conf/manifest.mf">
<attribute name="Main-Class" value="${java.launch.mainClass}" />
<attribute name="Class-Path" value="${manifest.class.path}" />
</manifest>
</target>
<target name="generate-jar" depends="compile, generate-version-file, generate-manifest, copy-resources">
<property name="jar.file" value="${tmp}/${ant.project.name}.jar" />
<jar destfile="${jar.file}" manifest="conf/manifest.mf" basedir="${build}" />
</target>
<target name="copy-resources" depends="setup">
<mkdir dir="${build}" />
<copy todir="${build}">
<fileset dir="${src}" casesensitive="no">
<include name="**/*.xml" />
<include name="**/*.jpg" />
<include name="**/*.gif" />
<include name="**/*.png" />
<include name="**/*.jpeg" />
<include name="**/*.jpg" />
<include name="**/*.txt" />
<include name="**/*.html" />
<include name="**/*.rpgame" />
<include name="**/*.rpgrp" />
<include name="**/*.rpdat" />
<include name="**/*.rpenc" />
<include name="**/*.jfrm" />
</fileset>
</copy>
</target>
<target name="increment-version" depends="init" unless="use.existing.version">
<propertyfile file="conf/build.number">
<entry key="build.number" type="int" operation="+" value="1" default="1" pattern="00" />
</propertyfile>
</target>
<target name="generate-version" depends="increment-version" unless="build.version">
<property file="conf/build.number" />
<property name="build.version" value="${app.version}.b${build.number}" />
</target>
<target name="generate-version-file" depends="setup, generate-version" if="version.file">
<touch file="${build}/${version.file}" mkdirs="true" />
<echo message="${build.version}" file="${build}/${version.file}" />
</target>
<target name="prepare-dist" depends="init">
<scriptdef name="pack200fs" language="javascript">
<attribute name="destdir" />
<attribute name="repack" />
<attribute name="gzipoutput" />
<attribute name="fileextension" />
<element name="fileset" type="fileset" />
<![CDATA[
function pack200(srcfile, destfile, repack, gzipoutput) {
project.log("repacking src=" + srcfile + " to " + destfile);
var task = project.createTask("pack200");
task.setSrc(srcfile);
task.setDestfile(destfile);
if (repack == "true" || repack == "1") {
task.setRepack(true);
}
if (gzipoutput == "true" || gzipoutput == "1") {
task.setGZIPOutput(true);
}
task.execute();
}
var destdir = project.resolveFile(attributes.get("destdir"));
var repack = attributes.get("repack");
var gzipoutput = attributes.get("gzipoutput");
var fileextension = attributes.get("fileextension");
if (!fileextension)
fileextension = "";
project.log("Destdir = " + destdir.getAbsolutePath());
var filesets = elements.get("fileset");
for (i = 0; i < filesets.size(); i++) {
var basedir = filesets.get(i).getDir(project);
project.log("fileset " + i + " basedir = " + basedir);
var ds = filesets.get(i).getDirectoryScanner(project);
var files = ds.getIncludedFiles();
for (j = 0; j < files.length; j++) {
var srcfile = new java.io.File(basedir, files[j]);
var destfile = new java.io.File(destdir, files[j] + fileextension);
pack200(srcfile, destfile, repack, gzipoutput);
}
}
]]>
</scriptdef>
</target>
<target name="unpack-launcher" if="mtl.app.buildDate">
<unzip dest="${tmp.zipdir}" src="${dist}/zip/${launcher}.zip" />
</target>
<target name="dist-build" depends="generate-jar, prepare-dist, unpack-launcher">
<!-- ZIP FILE CREATION -->
<property name="jar.file.versioned.name" value="${ant.project.name}-${build.version}.jar" />
<property name="jar.file.versioned" location="${tmp.zipdir}/${jar.file.versioned.name}" />
<copy file="${jar.file}" tofile="${jar.file.versioned}" />
<copy todir="${tmp.zipdir}/lib">
<fileset dir="lib">
<exclude name="javadoc/**" />
<exclude name="src/**" />
</fileset>
</copy>
<copy todir="${tmp.zipdir}">
<fileset dir="resource/bin" />
</copy>
<property name="zip.file" value="zip/${ant.project.name}-${build.version}.zip" />
<delete file="${dist}/${zip.file}" />
<zip destfile="${dist}/${zip.file}" update="false" basedir="${tmp.zipdir}" />
<!-- WEBSTART FILE CREATION -->
<!-- Packing alters the order of the classes in the jar. The repack
step MUST precede a signing -->
<!-- UNCOMMENT TO RE-ENABLE PACKING AND SIGNING!!!!!! -->
<echo message="Beginning repack (pack and unpack)" />
<mkdir dir="${tmp}/webstart" />
<pack200fs destdir="${tmp}/webstart" repack="true">
<fileset dir="${lib}">
<include name="*.jar" />
<include name="*.txt" />
</fileset>
<fileset file="${jar.file.versioned}" />
</pack200fs>
<echo message="Beginning signing" />
<signjar keystore="../common.build/keystore" keypass="rptools" alias="rptools" storepass="rptools" lazy="true">
<fileset dir="${tmp}/webstart">
<include name="*.jar" />
</fileset>
</signjar>
<echo message="Before copy" />
<copy todir="${dist}/lib">
<fileset dir="${tmp}/webstart">
<present present="srconly" targetdir="${dist}/lib" />
</fileset>
</copy>
<!-- WEBSTART DEPLOYMENT -->
<echo file="${dist}/${ant.project.name}-development.txt">
${application.name}
${app.version}
${build.version}
${zip.file}
lib/${jar.file.versioned.name} ${manifest.class.path}
${java.launch.mainClass}
${java.launch.args}
</echo>
</target>
<target name="dist" depends="dist-build">
<!-- CLEANUP -->
<delete dir="${tmp}" />
</target>
</project>

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks