forked from iterate-ch/cyberduck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·204 lines (178 loc) · 8.99 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"?>
<!--
* $Revision$
* $Date$
*
* Copyright (c) 2005-2012 David Kocher. All rights reserved.
* http://cyberduck.io/
*
* 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=".">
<import file="../build.xml"/>
<import file="../archive.xml"/>
<property name="app.name" value="Cyberduck"/>
<property name="cpack.bin" value="${env.ChocolateyInstall}/bin/cpack"/>
<property name="chocolatey.source" value="${setup}/chocolatey/cyberduck"/>
<property name="chocolatey.target" value="${build.deploy}"/>
<condition property="msbuild.configuration" value="Debug">
<equals arg1="${configuration}" arg2="debug" />
</condition>
<condition property="msbuild.configuration" value="Release">
<equals arg1="${configuration}" arg2="release" />
</condition>
<property name="cpack.bin" value="${env.ChocolateyInstall}/bin/cpack"/>
<target name="init-msbuild">
<taskdef name="msbuild" classname="org.apache.ant.dotnet.build.MSBuildTask">
<classpath path="${lib.ext}/ant-dotnet-1.1.jar"/>
</taskdef>
</target>
<target name="restore" depends="init-msbuild, version">
<msbuild buildfile="src/main/csharp/Cyberduck.csproj">
<target name="Restore" />
</msbuild>
<msbuild buildfile="src/test/csharp/Cyberduck.Test.csproj">
<target name="Restore" />
</msbuild>
<msbuild buildfile="src/main/wix/WindowsVersionCustomAction/WindowsVersionCustomAction.vcxproj">
<target name="Restore" />
</msbuild>
<msbuild buildfile="src/main/appx/Cyberduck.Package.proj">
<target name="Restore" />
</msbuild>
</target>
<target name="build" depends="init-msbuild, version">
<msbuild buildfile="src/main/csharp/Cyberduck.csproj">
<target name="Build" />
<property name="Version" value="${version}.${revision}" />
<property name="Copyright" value="${copyright}" />
<property name="Configuration" value="${msbuild.configuration}" />
</msbuild>
</target>
<target name="test" depends="init-msbuild, version" unless="${skip}">
<msbuild buildfile="src/test/csharp/Cyberduck.Test.csproj">
<target name="Build,Test" />
<property name="BuildProjectReferences" value="false" />
<property name="Configuration" value="${msbuild.configuration}" />
</msbuild>
</target>
<target name="package" depends="init-msbuild, version">
<copy todir="${build}">
<fileset dir="${home}">
<include name="*.ico"/>
</fileset>
</copy>
<condition property="msbuild.sign" value="false">
<istrue value="${skip}" />
</condition>
<property name="msbuild.sign" value="" />
<msbuild buildfile="src/main/wix/WindowsVersionCustomAction/WindowsVersionCustomAction.vcxproj">
<target name="Build" />
<property name="Version" value="${normalized.version}.${revision}" />
<property name="ShortVersion" value="${version} (${revision})" />
<property name="Copyright" value="${copyright}" />
<property name="Platform" value="Win32" />
<property name="Configuration" value="${msbuild.configuration}" />
<property name="SignOutput" value="${msbuild.sign}" />
</msbuild>
<msbuild buildfile="src/main/wix/Bundle/Cyberduck.Bundle.wixproj">
<target name="Build" />
<property name="BuildProjectReferences" value="false" />
<property name="Version" value="${normalized.version}.${revision}" />
<property name="ShortVersion" value="${version} (${revision})" />
<property name="Copyright" value="${copyright}" />
<property name="Configuration" value="${msbuild.configuration}" />
<property name="SignOutput" value="${msbuild.sign}" />
</msbuild>
<msbuild buildfile="src/main/wix/Bootstrapper/Cyberduck.Bootstrapper.wixproj">
<target name="Build"/>
<property name="BuildProjectReferences" value="false" />
<property name="Version" value="${normalized.version}.${revision}" />
<property name="ShortVersion" value="${version} (${revision})" />
<property name="Copyright" value="${copyright}" />
<property name="Configuration" value="${msbuild.configuration}" />
<property name="SignOutput" value="${msbuild.sign}" />
</msbuild>
<msbuild buildfile="src/main/appx/Cyberduck.Package.proj">
<target name="Build" />
<property name="Version" value="${normalized.version}.0" />
<property name="Copyright" value="${copyright}" />
<property name="Configuration" value="${msbuild.configuration}" />
<property name="SignOutput" value="${msbuild.sign}" />
</msbuild>
</target>
<target name="deploy" depends="version">
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
<classpath path="${lib.ext}/xmltask.jar"/>
</taskdef>
<mkdir dir="${build}/update"/>
<echo message="Calculating DSA signature..."/>
<exec dir="${home}" executable="sh" outputproperty="signature.dsa" failonerror="true">
<arg value="-o"/>
<arg value="pipefail"/>
<arg value="-c"/>
<arg
value="openssl dgst -sha1 -binary '${build.deploy}/Cyberduck-Installer-${version}.${revision}.exe' | openssl dgst -sha1 -sign '${www.update}/private.pem' | openssl enc -base64"/>
</exec>
<echo message="DSASIGNATURE=${signature.dsa}"/>
<!-- prepare WinSparkle stuff -->
<xmltask source="${www.update}/changelog.rss" destbuffer="xmltaskbuffer">
<remove path="//*[local-name()='minimumSystemVersion']"/>
</xmltask>
<xmltask sourcebuffer="xmltaskbuffer" dest="${build}/update/changelog.rss">
<attr path="//item/enclosure" attr="sparkle:installerArguments" value="/passive Autostart=1"/>
</xmltask>
<copy todir="${build}/update" overwrite="true">
<fileset dir="${www.update}">
<include name="changelog.html"/>
</fileset>
</copy>
<replace dir="${build}/update" summary="true" encoding="UTF-8">
<include name="changelog.rss"/>
<replacefilter token="${TIMESTAMP}" value="${touch.time}"/>
<replacefilter token="${ARCHIVE}"
value="https://update.cyberduck.io/${sparkle.feed}/${app.name}-Installer-${normalized.version}.${revision}.exe"/>
<replacefilter token="${CHANGELOG}" value="https://version.cyberduck.io/windows/${sparkle.feed}/changelog.html"/>
<replacefilter token="${REVISION}" value="${revision}"/>
<replacefilter token="${VERSION}" value="${version}"/>
<replacefilter token="${HASH}" value="${hash}"/>
<replacefilter token="${DSASIGNATURE}" value="${signature.dsa}"/>
<replacefilter token="${COPYRIGHT}" value="${copyright}"/>
</replace>
<foreach target="md5" param="source">
<fileset dir="${build.deploy}">
<include name="*.msi"/>
<exclude name="*.exe"/>
</fileset>
</foreach>
<checksum file="${build.deploy}/Cyberduck-Installer-${version}.${revision}.exe"
algorithm="sha-256" property="archive.sha256"/>
<copy todir="${chocolatey.target}">
<fileset dir="${chocolatey.source}">
<include name="*/**"/>
</fileset>
</copy>
<replace dir="${chocolatey.target}" summary="true" encoding="UTF-8">
<include name="*.nuspec"/>
<include name="tools/*.ps1"/>
<replacefilter token="${VERSION}" value="${version}"/>
<replacefilter token="${REVISION}" value="${revision}"/>
<replacefilter token="${FEED}" value="${sparkle.feed}"/>
<replacefilter token="${CHANGELOG}" value="https://version.cyberduck.io/windows/${sparkle.feed}/changelog.html"/>
<replacefilter token="${CHECKSUM}" value="${archive.sha256}"/>
<replacefilter token="${COPYRIGHT}" value="${copyright}"/>
</replace>
<exec executable="${cpack.bin}" dir="${chocolatey.target}" failonerror="true"/>
</target>
</project>