1 <?xml version="1.0" encoding="UTF-8"?>
3 * Simple Ant (http://jakarta.apache.org/ant) build script for Cyberduck
8 * Copyright (c) 2005-2012 David Kocher. All rights reserved.
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.
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.
21 * Bug fixes, suggestions and comments should be sent to:
22 * dkocher@cyberduck.io
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)}"/>
32 <condition property="programFiles" value="${env.ProgramFiles}">
33 <available file="${env.ProgramFiles}"/>
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"/>
50 <target name="version" depends="revision">
51 <taskdef resource="net/sf/antcontrib/antcontrib.properties">
52 <classpath path="${lib.ext}/ant-contrib-1.0b3.jar"/>
54 <propertyregex property="minor"
55 input="${cyberduck.version.minor}.0"
56 regexp="(\d)([\w\d]*)\.(\d)(\.\d)?"
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})"/>
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}"/>
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}"/>
89 <checksum file="duck-${version.full}.exe" algorithm="md5"/>
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"/>
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"/>
109 <resource name="/com/sun/jna/win32-x86/jnidispatch.dll" path="${lib}/jnidispatch.dll"/>
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"/>
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"/>
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"/>
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}"/>
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"/>
154 <arg value="-add=${build}/version.xml"/>
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"/>
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}"'/>
169 <checksum file="${setup.file}" algorithm="md5"/>
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"/>
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"'/>
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}"/>
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"/>
199 <arg value="-add=${build.deploy}/updater.xml"/>
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"
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"