diff --git a/syncthing.xcodeproj/project.pbxproj b/syncthing.xcodeproj/project.pbxproj index e875c68..1c94dda 100644 --- a/syncthing.xcodeproj/project.pbxproj +++ b/syncthing.xcodeproj/project.pbxproj @@ -294,7 +294,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "${SOURCE_ROOT}/syncthing/Scripts/syncthing-resource.sh\n#${SOURCE_ROOT}/syncthing/Scripts/create-dmg.sh"; + shellScript = "${SOURCE_ROOT}/syncthing/Scripts/syncthing-resource.sh\n${SOURCE_ROOT}/syncthing/Scripts/syncthing-inotify-resource.sh\n${SOURCE_ROOT}/syncthing/Scripts/create-dmg.sh"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -479,6 +479,7 @@ C4576BE11D11E3BB0031BCFD /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; C4A4155B1D0D579D00DC6018 /* Build configuration list for PBXProject "syncthing" */ = { isa = XCConfigurationList; diff --git a/syncthing/Scripts/syncthing-inotify-resource.sh b/syncthing/Scripts/syncthing-inotify-resource.sh new file mode 100755 index 0000000..5bcf4b4 --- /dev/null +++ b/syncthing/Scripts/syncthing-inotify-resource.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -euo pipefail + +# Download and unpack syncthing into ${PRODUCT_NAME}.app/Contents/Resources +SYNCTHING_INOTIFY_ARCH="amd64" +SYNCTHING_INOTIFY_VERSION="0.8.2" +SYNCTHING_INOTIFY_DIST_URL="https://github.com/syncthing/syncthing-inotify/releases/download" +SYNCTHING_INOTIFY_TARBALL_URL="${SYNCTHING_INOTIFY_DIST_URL}/v${SYNCTHING_INOTIFY_VERSION}/syncthing-inotify-darwin-${SYNCTHING_INOTIFY_ARCH}-v${SYNCTHING_INOTIFY_VERSION}.tar.gz" + +CURL_ARGS="--connect-timeout 5 --max-time 10 --retry 5 --retry-delay 3 --retry-max-time 60" +DL_DIR="${BUILT_PRODUCTS_DIR}/dl" +SYNCTHING_INOTIFY_TARBALL="${DL_DIR}/syncthing-inotify-${SYNCTHING_INOTIFY_VERSION}.tar.gz" +APP_RESOURCES_DIR="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Resources" +TAR_DIR="${APP_RESOURCES_DIR}/syncthing-inotify" + +# Download syncthing tarball +if [ -f "${SYNCTHING_INOTIFY_TARBALL}" ]; then + echo "-- Syncthing inotify already downloaded" + echo " > ${SYNCTHING_INOTIFY_TARBALL}" +else + echo "-- Downloading syncthing" + echo " From > ${SYNCTHING_INOTIFY_TARBALL_URL}" + echo " To > ${SYNCTHING_INOTIFY_TARBALL}" + + mkdir -p "${DL_DIR}" + curl ${CURL_ARGS} -s -L -o ${SYNCTHING_INOTIFY_TARBALL} ${SYNCTHING_INOTIFY_TARBALL_URL} +fi + +# Unpack to .app Resources folder +if [ -d "${TAR_DIR}/syncthing-inotify" ]; then + echo "-- Syncthing inotify already unpacked" + echo " > ${TAR_DIR}" +else + echo "-- Unpacking syncthing" + echo " > ${TAR_DIR}" + mkdir -p "${TAR_DIR}" + echo "${SYNCTHING_INOTIFY_TARBALL}" + tar -xf "${SYNCTHING_INOTIFY_TARBALL}" -C "${TAR_DIR}" --strip-components=1 +fi diff --git a/syncthing/Scripts/syncthing-resource.sh b/syncthing/Scripts/syncthing-resource.sh index 8293c93..3018900 100755 --- a/syncthing/Scripts/syncthing-resource.sh +++ b/syncthing/Scripts/syncthing-resource.sh @@ -3,7 +3,7 @@ set -euo pipefail # Download and unpack syncthing into ${PRODUCT_NAME}.app/Contents/Resources SYNCTHING_ARCH="amd64" -SYNCTHING_VERSION="0.13.9" +SYNCTHING_VERSION="0.13.10" SYNCTHING_DIST_URL="https://github.com/syncthing/syncthing/releases/download" SYNCTHING_TARBALL_URL="${SYNCTHING_DIST_URL}/v${SYNCTHING_VERSION}/syncthing-macosx-${SYNCTHING_ARCH}-v${SYNCTHING_VERSION}.tar.gz"