-
-
Notifications
You must be signed in to change notification settings - Fork 278
/
build-windows.xml
234 lines (208 loc) · 10.5 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
<!--
* 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:
* dkocher@cyberduck.ch
-->
<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="jdk.home" value="${env.ProgramFiles}/Java/jdk1.5.0_22"/>
<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"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<taskdef name="ikvmc" classname="net.ikvm.ant.IkvmcTask"/>
<path id="build.bootclasspath">
<pathelement location="${jdk.home}/jre/lib/rt.jar"/>
<pathelement location="${jdk.home}/jre/lib/jce.jar"/>
<pathelement location="${jdk.home}/jre/lib/jsse.jar"/>
</path>
<target name="version" depends="revision">
<!-- remove any non-digits (e.g. a trailing M) from the current revision -->
<propertyregex property="svn.revision.stripped"
input="${svn.revision}"
regexp="([\d]+).*"
select="\1"/>
<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.stripped}"/>
<property name="shortversion"
value="${cyberduck.version.major}.${cyberduck.version.minor} (${svn.revision.stripped})"/>
</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="AnyCPU"/>
</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>Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in "ch.cyberduck.core.Rendezvous
</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, 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>
<scp file="${setup.file}"
todir="dkocher@update.cyberduck.ch:./update.cyberduck.ch/windows"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<scp file="${build}/update/${app.name}-all-${shortversion}.wyu"
todir="dkocher@update.cyberduck.ch:./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="dkocher@version.cyberduck.ch:./version.cyberduck.ch/"
keyfile="${user.home}/.ssh/version.cyberduck.ch-rsa"
passphrase="">
</scp>
</target>
<target name="nightly" depends="clean, version">
<property name="setup.file"
location="${build}/${app.name}-Installer-${cyberduck.version.major}.${cyberduck.version.minor}.${svn.revision.stripped}.exe"/>
<antcall target="package">
<param name="changelog.wyp" value="${www.update}/changelog-nightly.wyp"/>
</antcall>
<scp file="${setup.file}"
todir="dkocher@update.cyberduck.ch:./update.cyberduck.ch/windows/nightly"
keyfile="${user.home}/.ssh/update.cyberduck.ch-rsa"
passphrase="">
</scp>
<scp file="${build}/update/${app.name}-all-${shortversion}.wyu"
todir="dkocher@update.cyberduck.ch:./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="dkocher@version.cyberduck.ch:./version.cyberduck.ch/nightly"
keyfile="${user.home}/.ssh/version.cyberduck.ch-rsa"
passphrase="">
</scp>
</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="${shortversion}"/>
<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.exe" failonerror="true">
<arg value="${build}/changelog.wyp"/>
<arg value="/bwu"/>
<arg value="/bu"/>
<arg value="-add=${absbuild}/version.xml"/>
</exec>
<property name="wyupdate.file" location="${build}/update/wyUpdate.exe"/>
<!-- patch resource information in order to display 'Cyberduck Updater' -->
<exec executable="verpatch.exe" failonerror="true">
<arg line='${wyupdate.file} /s FileDescription "Cyberduck Updater"'/>
</exec>
<!-- resign 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 "${wyupdate.file}"'/>
</exec>
<antcall target="setup"/>
</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>