forked from yxxiwang/cyberduck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-windows.xml
306 lines (269 loc) · 13.6 KB
/
build-windows.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
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!--
* Simple Ant (http://jakarta.apache.org/ant) build script for Cyberduck
*
* $Revision$
* $Date$
*
* Copyright (c) 2005-2010 David Kocher. All rights reserved.
* http://cyberduck.ch/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Bug fixes, suggestions and comments should be sent to:
-->
<project name="Cyberduck for Windows" basedir="." xmlns:dn="antlib:org.apache.ant.dotnet">
<!-- the following path needs to be set appropriately -->
<property name="ikvm.home" value="C:/workspace/ikvm-0.44.0.5"/>
<!-- try to detect the process architecture (32/64bit) -->
<condition property="programFiles" value="${env.ProgramFiles(x86)}">
<available file="${env.ProgramFiles(x86)}"/>
</condition>
<condition property="programFiles" value="${env.ProgramFiles}">
<available file="${env.ProgramFiles}"/>
</condition>
<property name="architecture" value="x86"/>
<property name="build.deploy" value="${build}/${configuration}/${architecture}"/>
<property name="setup" value="${home}/setup"/>
<property name="nsis.home" value="${programFiles}/NSIS"/>
<property name="winsdk.home" value="${programFiles}/Microsoft SDKs/Windows/v7.0A/Bin"/>
<property name="wybuild.home" value="${programFiles}/wyBuild"/>
<property name="wyupdate.home" value="c:/workspace/wyupdate-read-only"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<taskdef name="ikvmc" classname="net.ikvm.ant.IkvmcTask"/>
<target name="version" depends="revision">
<propertyregex property="minor"
input="${cyberduck.version.minor}.0"
regexp="(\d)([\w\d]*)\.(\d)(\.\d)?"
select="\1.\3"/>
<property name="version"
value="${cyberduck.version.major}.${minor}.${svn.revision}"/>
<property name="shortversion"
value="${cyberduck.version.major}.${cyberduck.version.minor} (${svn.revision})"/>
<!-- pattern = "[revision] ([major].[minor])" -->
<property name="updaterversion"
value="${svn.revision} (${cyberduck.version.major}.${cyberduck.version.minor})"/>
</target>
<target name="build" depends="version, archive">
<copy todir="${build.deploy}">
<fileset dir=".">
<include name="cyberduck-document.ico"/>
</fileset>
</copy>
<dn:msbuild buildfile="source/ch/cyberduck/Cyberduck.csproj">
<target name="Clean"/>
<target name="Build"/>
<property name="Version" value="${version}"/>
<property name="ShortVersion" value="${shortversion}"/>
<property name="Configuration" value="${configuration}"/>
<property name="Platform" value="${architecture}"/>
</dn:msbuild>
</target>
<target name="dll" depends="version, archive" description="Convert core.jar and ui.jar to core.dll">
<ikvmc target="library" out="${build}/core.dll" home="${ikvm.home}" version="${version}" debug="false"
verbose="true">
<fileset file="${build}/core.jar"/>
<fileset file="${build}/ui.jar"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<exclude name="jna-*.jar"/>
<exclude name="activation-*.jar"/>
<exclude name="asm-*.jar"/>
<exclude name="cglib-*.jar"/>
<exclude name="slf4j-*.jar"/>
<exclude name="ext/*.jar"/>
</fileset>
<outputfilter>
<contains>Warning IKVMC0107: skipping resource (name clash): "META-INF/</contains>
<contains>Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in "ch.cyberduck.core.Native
</contains>
<contains>org.apache.commons.cli</contains>
<contains>ch.cyberduck.ui.cocoa</contains>
<contains>org.apache.avalon</contains>
<contains>org.apache.commons.logging.impl</contains>
<contains>Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in "com.rackspacecloud</contains>
<contains>javax.servlet.ServletContextListener</contains>
<contains>org.dom4j</contains>
<contains>org.gjt.xpp</contains>
<contains>org.apache.webdav.lib</contains>
<contains>org.apache.commons.xmlio</contains>
<contains>org.apache.log</contains>
<contains>com.sun.msv</contains>
<contains>org.xmlpull</contains>
<contains>com.google.gdata.data.apt.Data</contains>
<contains>com.sun</contains>
<contains>javax.annotation</contains>
<contains>nu.xom</contains>
<contains>org.jaxen.xom</contains>
<contains>org.w3c.dom.UserDataHandler</contains>
<contains>(class is already available in referenced assembly "IKVM.OpenJDK.XML.API</contains>
<contains>javax.jms</contains>
<contains>.JMS</contains>
</outputfilter>
<!-- only 25 outputfilters are allowed! -->
</ikvmc>
</target>
<target name="release" depends="clean, package-release">
<scp file="${setup.file}"
todir="[email protected]:./update.cyberduck.ch/windows"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<scp file="${build}/update/${app.name}-all-${updaterversion}.wyu"
todir="[email protected]:./update.cyberduck.ch/windows/update"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<!-- Changelog Release - version.cyberduck.ch -->
<scp file="${build}/update/changelog.wys"
todir="[email protected]:./version.cyberduck.ch/"
keyfile="${user.home}/.ssh/version.cyberduck.ch-rsa"
passphrase="">
</scp>
</target>
<target name="nightly" depends="clean, package-nightly">
<scp file="${setup.file}"
todir="[email protected]:./update.cyberduck.ch/windows/nightly"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<scp file="${build}/update/${app.name}-all-${updaterversion}.wyu"
todir="[email protected]:./update.cyberduck.ch/windows/nightly/update"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<!-- Changelog Release - version.cyberduck.ch -->
<scp file="${build}/update/changelog.wys"
todir="[email protected]:./version.cyberduck.ch/nightly"
keyfile="${user.home}/.ssh/version.cyberduck.ch-rsa"
passphrase="">
</scp>
</target>
<target name="beta" depends="clean, package-beta">
<scp file="${setup.file}"
todir="[email protected]:./update.cyberduck.ch/windows/beta"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<scp file="${build}/update/${app.name}-all-${updaterversion}.wyu"
todir="[email protected]:./update.cyberduck.ch/windows/beta/update"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<!-- Changelog Release - version.cyberduck.ch -->
<scp file="${build}/update/changelog.wys"
todir="[email protected]:./version.cyberduck.ch/beta"
keyfile="${user.home}/.ssh/version.cyberduck.ch-rsa"
passphrase="">
</scp>
</target>
<target name="package-release" depends="version">
<property name="setup.file"
location="${build}/${app.name}-Installer-${cyberduck.version.major}.${cyberduck.version.minor}.exe"/>
<antcall target="package">
<param name="changelog.wyp" value="${www.update}/changelog.wyp"/>
</antcall>
</target>
<target name="package-beta" depends="version">
<property name="setup.file"
location="${build}/${app.name}-Installer-${cyberduck.version.major}.${cyberduck.version.minor}.${svn.revision}.exe"/>
<antcall target="package">
<param name="changelog.wyp" value="${www.update}/changelog-beta.wyp"/>
</antcall>
</target>
<target name="package-nightly" depends="version">
<property name="setup.file"
location="${build}/${app.name}-Installer-${cyberduck.version.major}.${cyberduck.version.minor}.${svn.revision}.exe"/>
<antcall target="package">
<param name="changelog.wyp" value="${www.update}/changelog-nightly.wyp"/>
</antcall>
</target>
<target name="package-dev" depends="version">
<property name="setup.file"
location="${build}/${app.name}-Installer-${cyberduck.version.major}.${cyberduck.version.minor}.${svn.revision}.exe"/>
<antcall target="package">
<param name="changelog.wyp" value="${www.update}/changelog-dev.wyp"/>
</antcall>
</target>
<target name="package" depends="dll, build">
<loadfile property="changes" srcFile="${www.update}/changelog.txt"/>
<property name="buildpath" location="${build.deploy}"/>
<property name="absbuild" location="${build}"/>
<copy file="${www.update}/version.xml" todir="${build}" overwrite="true"/>
<replace file="${build}/version.xml" summary="true" encoding="UTF-8">
<replacefilter token="_VERSION_" value="${updaterversion}"/>
<replacefilter token="_CHANGES_" value="${changes}"/>
<replacefilter token="_BUILDPATH_" value="${buildpath}"/>
</replace>
<!-- copy wyUpdate project over to the build directory -->
<copy file="${changelog.wyp}" tofile="${build}/changelog.wyp" overwrite="true"/>
<exec executable="${wybuild.home}/wybuild.cmd.exe" failonerror="true">
<arg value="${build}/changelog.wyp"/>
<arg value="/bwu"/>
<arg value="/bu"/>
<arg value="-add=${absbuild}/version.xml"/>
</exec>
<!-- overwrite generated wyUpdate.exe -->
<copy file="${www.update}/Updater.exe" todir="${build}/update" overwrite="true"/>
<antcall target="setup"/>
</target>
<target name="updater-release">
<property name="absbuild" location="${build}"/>
<!-- Updater .NET4 build -->
<dn:msbuild buildfile="${wyupdate.home}/wyUpdate.NET4.csproj">
<target name="Clean"/>
<target name="Build"/>
<property name="Configuration" value="Release"/>
<property name="Platform" value="x86"/>
</dn:msbuild>
<copy file="${wyupdate.home}/bin4/Release/wyUpdate.exe" tofile="${www.update}/Updater.exe"/>
<!-- sign wyUpdate.exe with our code signing certificate -->
<exec executable="${winsdk.home}/signtool.exe" failonerror="true">
<arg line='sign /r "StartCom" /t http://timestamp.globalsign.com/scripts/timestamp.dll "${www.update}/Updater.exe"'/>
</exec>
<copy file="${www.update}/updater.xml" todir="${build}" overwrite="true"/>
<replace file="${build}/updater.xml" summary="true" encoding="UTF-8">
<replacefilter token="_VERSION_" value="${updater.version}"/>
<replacefilter token="_BUILDPATH_" value="${build}"/>
</replace>
<!-- copy wyUpdate project over to the build directory -->
<copy file="${www.update}/updater.wyp" todir="${build}" overwrite="true"/>
<copy file="${www.update}/Updater.exe" todir="${build}/update" overwrite="true"/>
<exec executable="${wybuild.home}/wybuild.cmd.exe" failonerror="true">
<arg value="${build}/updater.wyp"/>
<arg value="/bu"/>
<arg value="-add=${absbuild}/updater.xml"/>
</exec>
<scp file="${build}/update/${app.name}Updater-all-${updater.version}.wyu"
todir="[email protected]:./update.cyberduck.ch/windows/update"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<!-- Changelog Release - version.cyberduck.ch -->
<scp file="${build}/update/updater.wys"
todir="[email protected]:./version.cyberduck.ch/"
keyfile="${user.home}/.ssh/version.cyberduck.ch-rsa"
passphrase="">
</scp>
</target>
<target name="setup">
<property name="setup.basedir" location="${build.deploy}"/>
<exec executable="${nsis.home}/makensis" failonerror="true">
<arg value="/DBASEDIR=${setup.basedir}"/>
<arg value="/DPRODUCT_VERSION=${shortversion}"/>
<arg value="/DSETUPFILE=${setup.file}"/>
<arg value="${setup}/cyberduck.nsi"/>
</exec>
<exec executable="${winsdk.home}/signtool.exe" failonerror="true">
<arg line='sign /r "StartCom" /t http://timestamp.globalsign.com/scripts/timestamp.dll "${setup.file}"'/>
</exec>
</target>
</project>