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