1 <?xml version="1.0" encoding="UTF-8"?>
6 * Copyright (c) 2005-2012 David Kocher. All rights reserved.
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.
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.
19 * Bug fixes, suggestions and comments should be sent to:
20 * dkocher@cyberduck.io
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)}"/>
30 <condition property="programFiles" value="${env.ProgramFiles}">
31 <available file="${env.ProgramFiles}"/>
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="app.icon" value="cyberduck-application.ico"/>
40 <property name="jvm.runtime.bin" value="${java.home}/bin"/>
42 <taskdef name="msbuild" classname="org.apache.ant.dotnet.build.MSBuildTask">
43 <classpath path="${lib.ext}/ant-dotnet-1.1.jar"/>
46 <target name="version" depends="revision">
47 <taskdef resource="net/sf/antcontrib/antcontrib.properties">
48 <classpath path="${lib.ext}/ant-contrib-1.0b3.jar"/>
50 <propertyregex property="minor"
51 input="${cyberduck.version.minor}.0"
52 regexp="(\d)([\w\d]*)\.(\d)(\.\d)?"
54 <property name="version.full"
55 value="${cyberduck.version.major}.${minor}.${revision}"/>
56 <property name="version.short"
57 value="${version} (${revision})"/>
58 <!-- pattern = "[revision] ([major].[minor])" -->
59 <property name="updaterversion"
60 value="${revision} (${version})"/>
63 <target name="_build" depends="dll">
64 <msbuild buildfile="source/ch/cyberduck/Cyberduck.csproj">
65 <target name="Clean"/>
66 <target name="Build"/>
68 <property name="Version" value="${version.full}"/>
69 <property name="ShortVersion" value="${version.short}"/>
70 <property name="Configuration" value="${configuration}"/>
71 <property name="Platform" value="${architecture}"/>
75 <target name="_cli" depends="dll">
76 <msbuild buildfile="source/ch/cyberduck/CLI-WiX-Bootstrapper.wixproj">
77 <target name="Clean"/>
78 <target name="Build"/>
80 <property name="Version" value="${version.full}"/>
81 <property name="ShortVersion" value="${version.short}"/>
82 <property name="Configuration" value="${configuration}"/>
83 <property name="Platform" value="${architecture}"/>
85 <checksum file="${build.deploy}/duck-${version.full}.exe" algorithm="md5"/>
88 <target name="dll" depends="archive, version">
89 <taskdef name="ikvmc" classname="net.ikvm.ant.IkvmcTask">
90 <classpath path="${lib.ext}/ant-ikvmc.0.5.jar"/>
92 <ikvmc target="library" out="${build}/core.dll" home="${ikvm.home}"
93 version="${version.full}" debug="false" verbose="true">
94 <fileset file="${build}/config.jar"/>
95 <fileset file="${build}/core.jar"/>
96 <fileset file="${build}/cli.jar"/>
97 <fileset file="${build}/ui.jar"/>
98 <fileset dir="${lib}">
99 <include name="*.jar"/>
100 <exclude name="asm-*.jar"/>
101 <exclude name="cglib-*.jar"/>
102 <exclude name="dns_sd.jar"/>
103 <exclude name="rococoa-*.jar"/>
105 <resource name="/com/sun/jna/win32-x86/jnidispatch.dll" path="${lib}/jnidispatch.dll"/>
109 <target name="package" depends="build">
110 <loadfile property="changes" srcFile="${www.update}/changelog.txt"/>
112 <copy file="${www.update}/version.xml" todir="${build}" overwrite="true"/>
113 <replace file="${build}/version.xml" summary="true" encoding="UTF-8">
114 <replacefilter token="${VERSION}" value="${updaterversion}"/>
115 <replacefilter token="${CHANGES}" value="${changes}"/>
116 <replacefilter token="${BUILDPATH}" value="${build}"/>
119 <!-- copy wyUpdate project over to the build directory -->
120 <copy file="${www.update}/${app.update.feed}/changelog.wyp" tofile="${build}/changelog.wyp" overwrite="true"/>
122 <exec executable="${wybuild.home}/wybuild.cmd.exe" failonerror="true" dir="${build}">
123 <arg value="${build}/changelog.wyp"/>
126 <arg value="-add=${build}/version.xml"/>
129 <!-- overwrite generated wyUpdate.exe -->
130 <copy file="${www.update}/Updater.exe" todir="${build}/update" overwrite="true"/>
132 <property name="setup.file"
133 location="${build.deploy}/${app.name}-Installer-${version}.${revision}.exe"/>
134 <exec executable="${nsis.home}/makensis" failonerror="true">
135 <arg value="/DBASEDIR=${build}"/>
136 <arg value="/DPRODUCT_VERSION=${version.short}"/>
137 <arg value="/DSETUPFILE=${setup.file}"/>
138 <arg value="${setup}/cyberduck.nsi"/>
140 <exec executable="${winsdk.home}/signtool.exe" failonerror="true">
141 <arg line='sign /r "StartCom" /tr http://timestamp.globalsign.com/scripts/timestamp.dll "${setup.file}"'/>
143 <checksum file="${setup.file}" algorithm="md5"/>
146 <target name="updater-release">
147 <!-- Updater .NET4 build -->
148 <msbuild buildfile="${wyupdate.home}/wyUpdate.NET4.csproj">
149 <target name="Clean"/>
150 <target name="Build"/>
151 <property name="Configuration" value="Release"/>
152 <property name="Platform" value="x86"/>
155 <copy file="${wyupdate.home}/bin4/Release/wyUpdate.exe" tofile="${www.update}/Updater.exe"/>
156 <!-- sign wyUpdate.exe with our code signing certificate -->
157 <exec executable="${winsdk.home}/signtool.exe" failonerror="true">
158 <arg line='sign /r "StartCom" /tr http://timestamp.globalsign.com/scripts/timestamp.dll "${www.update}/Updater.exe"'/>
161 <!-- copy wyUpdate project over to the build directory -->
162 <copy todir="${build.deploy}">
163 <fileset dir="${www.update}">
164 <include name="updater.xml"/>
165 <include name="updater.wyp"/>
166 <include name="Updater.exe"/>
169 <replace file="${build.deploy}/updater.xml" summary="true" encoding="UTF-8">
170 <replacefilter token="${VERSION}" value="${updater.version}"/>
173 <exec executable="${wybuild.home}/wybuild.cmd.exe" failonerror="true">
174 <arg value="${build.deploy}/updater.wyp"/>
176 <arg value="-add=${build.deploy}/updater.xml"/>