Files
2025-06-26 13:23:02 +02:00

122 lines
6.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2002-2016 iterate GmbH. All rights reserved.
~ https://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.
-->
<project name="Cyberduck CLI Mac" basedir="." xmlns:unless="ant:unless">
<import file="../../build.xml"/>
<property name="cli.bundle" value="${build}/duck.bundle"/>
<property name="app.name" value="Cyberduck"/>
<property name="app.runtime.archs" value="'x86_64 arm64'"/>
<property name="app.runtime.system.min" value="10.13"/>
<property name="jvm.runtime.args"
value="-client --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED -Djava.library.path=$APP_PACKAGE/Contents/Frameworks -Dlibrary.jansi.path=$APP_PACKAGE/Contents/Frameworks -Djna.boot.library.path=$APP_PACKAGE/Contents/Frameworks -Djna.library.path=$APP_PACKAGE/Contents/Frameworks -Djna.nounpack=true -Djava.awt.headless=true -Dsun.jnu.encoding=utf-8 -Dfile.encoding=utf-8 -Dsun.io.useCanonCaches=false -DLog4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector -XX:+UseG1GC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:+UseStringDeduplication"/>
<condition property="jvm.runtime.debug"
value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 ">
<equals arg1="${configuration}" arg2="debug"/>
</condition>
<property name="build.xcodeoptions"
value="CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO JVM_RUNTIME_ARGS='${jvm.runtime.debug}${jvm.runtime.args}' JAVA_HOME=${java.home} SYMROOT=${build} SDKROOT=macosx ARCHS=${app.runtime.archs} MACOSX_DEPLOYMENT_TARGET=${app.runtime.system.min}"/>
<property name="xcode.configuration" value="Release"/>
<property name="xcode.target" value="cli"/>
<property name="build.lipo.arch.remove" value="i386"/>
<import file="../../runtime.xml"/>
<import file="../../codesign.xml"/>
<import file="../../archive.xml"/>
<target name="build" depends="version">
<echo message="Building ${cli.bundle} with configuration ${xcode.configuration}"/>
<antcall target="tar">
<param name="directory" value="${home}"/>
<param name="source" value="."/>
<param name="target" value="duck-src-${version}.${revision}.tar.gz"/>
</antcall>
<echo message="Calculating SHA256..."/>
<checksum file="${build.deploy}/duck-src-${version}.${revision}.tar.gz"
algorithm="sha-256" property="source.sha256"/>
<local name="build.settings"/>
<property name="build.settings"
value="${build.xcodeoptions} RUNTIME_SOURCE=${runtime.dependency} VERSION=${version} REVISION=${revision} COPYRIGHT='${copyright}'"/>
<echo message="Build settings ${build.settings}"/>
<exec dir="${home}" executable="/usr/bin/xcrun" spawn="false" failonerror="true">
<arg line="xcodebuild -project ${home}/'Cyberduck.xcodeproj' -configuration '${xcode.configuration}' -target '${xcode.target}' ${build.settings}"/>
</exec>
<antcall target="runtime">
<param name="bundle" value="${cli.bundle}"/>
</antcall>
<antcall target="shared-library-install-name">
<param name="oldname" value="/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM"/>
<param name="newname" value="${bundle.runtime.lib}"/>
<param name="directory" value="${cli.bundle}/${bundle.frameworks}"/>
</antcall>
<!-- Remove architectures -->
<foreach target="lipo" param="arch" list="${build.lipo.arch.remove}">
<param name="bundle" value="${cli.bundle}"/>
</foreach>
</target>
<target name="package" depends="build">
<antcall target="codesign" unless:true="${skipSign}">
<param name="bundle" value="${cli.bundle}"/>
</antcall>
<antcall target="tar">
<param name="directory" value="${build}"/>
<param name="source" value="duck.bundle"/>
<param name="target" value="duck-${version}.${revision}.tar.gz"/>
</antcall>
<foreach target="sha1" param="source">
<fileset dir="${build.deploy}">
<include name="*.tar.gz"/>
</fileset>
</foreach>
<checksum file="${build.deploy}/duck-${version}.${revision}.tar.gz"
algorithm="sha-256" property="archive.sha256"/>
<copy todir="${build.deploy}" overwrite="true">
<fileset dir="${setup}/brew">
<include name="*.rb"/>
</fileset>
</copy>
<replace dir="${build.deploy}" summary="true" encoding="UTF-8">
<include name="*.rb"/>
<replacefilter token="${REVISION}" value="${revision}"/>
<replacefilter token="${VERSION}" value="${version}"/>
<replacefilter token="${ARCHIVE.SHA256}" value="${archive.sha256}"/>
<replacefilter token="${ARCHIVE}"
value="https://dist.duck.sh/${sparkle.feed}/duck-${version}.${revision}.tar.gz"/>
<replacefilter token="${SOURCE.SHA256}" value="${source.sha256}"/>
<replacefilter token="${SOURCE}"
value="https://dist.duck.sh/duck-src-${version}.${revision}.tar.gz"/>
</replace>
<exec dir="${build.deploy}" executable="/usr/bin/xcrun" spawn="false" failonerror="true"
unless:true="${skipSign}">
<arg line="pkgbuild --component ${cli.bundle} --install-location /usr/local --version ${version} --scripts ${setup}/pkg --sign '${installer.certificate}' --keychain ${codesign.keychain} ${build.deploy}/duck-${version}.${revision}.pkg"/>
</exec>
<checksum file="${build.deploy}/duck-${version}.${revision}.pkg" algorithm="md5" unless:true="${skipSign}"/>
<exec executable="/usr/bin/xcrun" failonerror="true" unless:true="${skipSign}">
<arg line="pkgutil --check-signature ${build.deploy}/duck-${version}.${revision}.pkg"/>
</exec>
<antcall target="notarize" unless:true="${skipNotarize}">
<param name="notarize.archive.upload" value="${build.deploy}/duck-${version}.${revision}.pkg"/>
<param name="notarize.archive.staple" value="${build.deploy}/duck-${version}.${revision}.pkg"/>
</antcall>
</target>
</project>