Files
cyberduck/windows/build.xml
T
2025-06-26 13:23:01 +02:00

155 lines
6.3 KiB
XML
Executable File

<?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:
* dkocher@cyberduck.io
-->
<project name="Cyberduck for Windows" basedir=".">
<import file="../build.xml"/>
<import file="../archive.xml"/>
<property name="app.name" value="Cyberduck"/>
<property name="chocolatey.source" value="${setup}/chocolatey/cyberduck"/>
<property name="chocolatey.target" value="${build.deploy}"/>
<target name="restore" depends="msbuild">
<msbuild buildfile="dirs.proj">
<target name="Restore" />
</msbuild>
</target>
<target name="build" depends="restore,msbuild">
<msbuild buildfile="dirs.proj">
<target name="Build" />
<property name="BuildModule" value="Project" />
<property name="Configuration" value="${msbuild.configuration}" />
</msbuild>
</target>
<target name="test" depends="msbuild" unless="${skip}">
<msbuild buildfile="src/test/csharp/Cyberduck.Test.csproj">
<target name="Test" />
<property name="Configuration" value="${msbuild.configuration}" />
</msbuild>
</target>
<target name="package" depends="msbuild">
<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="" />
<copy todir="${build}/generated" overwrite="True" encoding="UTF-8" outputencoding="UTF-8">
<fileset dir="${module}/src/main/package">
<include name="**/*.template"/>
</fileset>
<filterchain>
<expandproperties/>
</filterchain>
<globmapper from="*.template" to="*"/>
</copy>
<msbuild buildfile="dirs.proj">
<target name="Build" />
<property name="BuildModule" value="Installer" />
<property name="Configuration" value="${msbuild.configuration}" />
</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 InstallBonjour=0 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="${EDSIGNATURE}" value=""/>
<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="choco" dir="${chocolatey.target}" failonerror="true">
<arg value="pack"/>
</exec>
</target>
</project>