Fix transcript in transfer window.
[cyberduck.git] / build-windows.xml
blob1097bdc5dd5c4598665721c26e6b5a1179e46229
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  *      $Revision$
4  *      $Date$
5  *
6  *  Copyright (c) 2005-2012 David Kocher. All rights reserved.
7  *  http://cyberduck.io/
8  *
9  *      This program is free software; you can redistribute it and/or modify
10  *      it under the terms of the GNU General Public License as published by
11  *      the Free Software Foundation; either version 2 of the License, or
12  *      (at your option) any later version.
13  *
14  *      This program is distributed in the hope that it will be useful,
15  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *      GNU General Public License for more details.
18  *
19  *      Bug fixes, suggestions and comments should be sent to:
20  *      dkocher@cyberduck.io
21  -->
22 <project name="Cyberduck for Windows" basedir=".">
24     <import file="build.xml"/>
26     <!-- try to detect the process architecture (32/64bit) -->
27     <condition property="programFiles" value="${env.ProgramFiles(x86)}">
28         <available file="${env.ProgramFiles(x86)}"/>
29     </condition>
30     <condition property="programFiles" value="${env.ProgramFiles}">
31         <available file="${env.ProgramFiles}"/>
32     </condition>
34     <property name="architecture" value="x86"/>
35     <property name="nsis.home" value="${programFiles}/NSIS"/>
36     <property name="winsdk.home" value="${programFiles}/Windows Kits/8.0/bin/x86"/>
37     <property name="wybuild.home" value="${programFiles}/wyBuild"/>
38     <property name="ikvm.home" value="${lib}/ikvmbin-8.1.5561"/>
39     <property name="app.icon" value="cyberduck-application.ico"/>
41     <property name="jvm.runtime.bin" value="${java.home}/bin"/>
42     <property name="cpack.bin" value="${env.ChocolateyInstall}/bin/cpack"/>
44     <property name="chocolatey.source" value="${setup}/chocolatey"/>
45     <property name="chocolatey.target" value="${build.deploy}"/>
47     <taskdef name="msbuild" classname="org.apache.ant.dotnet.build.MSBuildTask">
48         <classpath path="${lib.ext}/ant-dotnet-1.1.jar"/>
49     </taskdef>
51     <target name="version" depends="revision">
52         <taskdef resource="net/sf/antcontrib/antcontrib.properties">
53             <classpath path="${lib.ext}/ant-contrib-1.0b3.jar"/>
54         </taskdef>
55         <propertyregex property="minor"
56                        input="${cyberduck.version.minor}.0"
57                        regexp="(\d)([\w\d]*)\.(\d)(\.\d)?"
58                        select="\1.\3"/>
59         <property name="version.full"
60                   value="${cyberduck.version.major}.${minor}.${revision}"/>
61         <property name="version.short"
62                   value="${version} (${revision})"/>
63         <!-- pattern = "[revision] ([major].[minor])" -->
64         <property name="updaterversion"
65                   value="${revision} (${version})"/>
66     </target>
68     <target name="_build" depends="dll">
69         <msbuild buildfile="source/ch/cyberduck/Cyberduck.csproj">
70             <target name="Clean"/>
71             <target name="Build"/>
73             <property name="Version" value="${version.full}"/>
74             <property name="ShortVersion" value="${version.short}"/>
75             <property name="Configuration" value="${configuration}"/>
76             <property name="Platform" value="${architecture}"/>
77         </msbuild>
78     </target>
80     <target name="_cli" depends="dll">
81         <msbuild buildfile="source/ch/cyberduck/CLI-WiX-Bootstrapper.wixproj">
82             <target name="Clean"/>
83             <target name="Build"/>
85             <property name="Version" value="${version.full}"/>
86             <property name="ShortVersion" value="${version.short}"/>
87             <property name="Configuration" value="${configuration}"/>
88             <property name="Platform" value="${architecture}"/>
89         </msbuild>
90         <checksum file="${build.deploy}/duck-${version.full}.exe" algorithm="md5"/>
92         <copy todir="${chocolatey.target}">
93             <fileset dir="${chocolatey.source}">
94                 <include name="*/**"/>
95             </fileset>
96         </copy>
97         <replace dir="${chocolatey.target}" summary="true" encoding="UTF-8">
98             <include name="*.nuspec"/>
99             <include name="tools/*.ps1"/>
100             <replacefilter token="${VERSION}" value="${version}"/>
101             <replacefilter token="${REVISION}" value="${revision}"/>
102         </replace>
103         <exec executable="${cpack.bin}" dir="${chocolatey.target}" failonerror="true"/>
104     </target>
106     <target name="dll" depends="archive, version">
107         <taskdef name="ikvmc" classname="net.ikvm.ant.IkvmcTask">
108             <classpath path="${lib.ext}/ant-ikvmc.0.5.jar"/>
109         </taskdef>
110         <ikvmc target="library" out="${build}/core.dll" home="${ikvm.home}"
111                version="${version.full}" debug="false" verbose="true">
112             <fileset file="${build}/config.jar"/>
113             <fileset file="${build}/core.jar"/>
114             <fileset file="${build}/cli.jar"/>
115             <fileset file="${build}/ui.jar"/>
116             <fileset dir="${lib}">
117                 <include name="*.jar"/>
118                 <include name="1.8.0*/Contents/Home/lib/ext/sunec.jar"/>
119                 <exclude name="asm-*.jar"/>
120                 <exclude name="cglib-*.jar"/>
121                 <exclude name="dns_sd.jar"/>
122                 <exclude name="rococoa-*.jar"/>
123             </fileset>
124             <resource name="/com/sun/jna/win32-x86/jnidispatch.dll" path="${lib}/jnidispatch.dll"/>
125         </ikvmc>
126     </target>
128     <target name="package" depends="build">
129         <copy todir="${build}">
130             <fileset dir="${home}">
131                 <include name="*.ico"/>
132             </fileset>
133         </copy>
135         <loadfile property="changes" srcFile="${www.update}/changelog.txt"/>
137         <copy file="${www.update}/version.xml" todir="${build}" overwrite="true"/>
138         <replace file="${build}/version.xml" summary="true" encoding="UTF-8">
139             <replacefilter token="${VERSION}" value="${updaterversion}"/>
140             <replacefilter token="${CHANGES}" value="${changes}"/>
141             <replacefilter token="${BUILDPATH}" value="${build}"/>
142         </replace>
144         <!-- copy wyUpdate project over to the build directory -->
145         <copy file="${www.update}/${app.update.feed}/changelog.wyp" tofile="${build}/changelog.wyp" overwrite="true"/>
147         <exec executable="${wybuild.home}/wybuild.cmd.exe" failonerror="true" dir="${build}">
148             <arg value="${build}/changelog.wyp"/>
149             <arg value="/bwu"/>
150             <arg value="/bu"/>
151             <arg value="-add=${build}/version.xml"/>
152         </exec>
154         <!-- overwrite generated wyUpdate.exe -->
155         <copy file="${www.update}/Updater.exe" todir="${build}/update" overwrite="true"/>
157         <property name="setup.file"
158                   location="${build.deploy}/${app.name}-Installer-${version}.${revision}.exe"/>
159         <exec executable="${nsis.home}/makensis" failonerror="true">
160             <arg value="/DBASEDIR=${build}"/>
161             <arg value="/DPRODUCT_VERSION=${version.short}"/>
162             <arg value="/DSETUPFILE=${setup.file}"/>
163             <arg value="${setup}/nsi/cyberduck.nsi"/>
164         </exec>
165         <exec executable="${winsdk.home}/signtool.exe" failonerror="true">
166             <arg line='sign /r "StartCom" /tr http://timestamp.globalsign.com/scripts/timestamp.dll "${setup.file}"'/>
167         </exec>
168         <checksum file="${setup.file}" algorithm="md5"/>
169     </target>
171     <target name="updater-release">
172         <!-- Updater .NET4 build -->
173         <msbuild buildfile="${wyupdate.home}/wyUpdate.NET4.csproj">
174             <target name="Clean"/>
175             <target name="Build"/>
176             <property name="Configuration" value="Release"/>
177             <property name="Platform" value="x86"/>
178         </msbuild>
180         <copy file="${wyupdate.home}/bin4/Release/wyUpdate.exe" tofile="${www.update}/Updater.exe"/>
181         <!-- sign wyUpdate.exe with our code signing certificate -->
182         <exec executable="${winsdk.home}/signtool.exe" failonerror="true">
183             <arg line='sign /r "StartCom" /tr http://timestamp.globalsign.com/scripts/timestamp.dll "${www.update}/Updater.exe"'/>
184         </exec>
186         <!-- copy wyUpdate project over to the build directory -->
187         <copy todir="${build.deploy}">
188             <fileset dir="${www.update}">
189                 <include name="updater.xml"/>
190                 <include name="updater.wyp"/>
191                 <include name="Updater.exe"/>
192             </fileset>
193         </copy>
194         <replace file="${build.deploy}/updater.xml" summary="true" encoding="UTF-8">
195             <replacefilter token="${VERSION}" value="${updater.version}"/>
196         </replace>
198         <exec executable="${wybuild.home}/wybuild.cmd.exe" failonerror="true">
199             <arg value="${build.deploy}/updater.wyp"/>
200             <arg value="/bu"/>
201             <arg value="-add=${build.deploy}/updater.xml"/>
202         </exec>
203     </target>
204 </project>