Add SPM binary target support

This commit is contained in:
Jonas Zaugg committed 2020-08-03 02:06:48 +02:00
1 parent 438f4a21d5
commit 6a55563307
6 files changed
+72 -2

No files matched your search

+4
View File
@@ -41,3 +41,7 @@ Carthage/Build
Network Trash Folder
Temporary Items
.apdisk
# Swift Package Manager
/.build
.swiftpm
+17
View File
@@ -57,4 +57,21 @@ if [ "$ACTION" = "" ] ; then
# Sorted file list groups similar files together, which improves tar compression
find . \! -type d | rev | sort | rev | tar cv --files-from=- | xz -9 > "../Sparkle-$CURRENT_PROJECT_VERSION.tar.xz"
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
# Generate zip containing the xcframework for SPM
cd "$CONFIGURATION_BUILD_DIR"
rm -rf "Sparkle.xcarchive"
zip -rqyX "Sparkle-SPM-$CURRENT_PROJECT_VERSION.zip" "Sparkle.xcframework"
# Generate new Package manifest
cp "$SRCROOT/Package-template.swift" "$CONFIGURATION_BUILD_DIR"
mv "Package-template.swift" "Package.swift"
# is equivalent to shasum -a 256 FILE
spm_checksum=$(swift package compute-checksum "Sparkle-SPM-$CURRENT_PROJECT_VERSION.zip")
rm -rf ".build"
sed -i '' -e "s/VERSION_PLACEHOLDER/$CURRENT_PROJECT_VERSION/g" "Package.swift"
sed -i '' -e "s/CHECKSUM_PLACEHOLDER/$spm_checksum/g" "Package.swift"
cp "Package.swift" "$SRCROOT"
echo "Package.swift updated with the following values:"
echo "Version: $CURRENT_PROJECT_VERSION"
echo "Checksum: $spm_checksum"
fi
+4 -1
View File
@@ -13,10 +13,13 @@ localizable-strings:
rm Sparkle/en.lproj/Localizable.strings
release:
xcodebuild -scheme Sparkle -configuration Release -derivedDataPath "$(BUILDDIR)" -archivePath "$(BUILDDIR)/Build/Products/Release/Sparkle.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO archive
xcodebuild -create-xcframework -framework "$(BUILDDIR)/Build/Products/Release/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -output "$(BUILDDIR)/Build/Products/Release/Sparkle.xcframework"
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(BUILDDIR)" build
open -R "$(BUILDDIR)/Build/Products/Release/Sparkle-"*.tar.bz2
open "$(BUILDDIR)/Build/Products/Release/"
cat Sparkle.podspec
@echo "Don't forget to update CocoaPods! pod trunk push"
@echo "Don't forget to commit the updated Package manifest before releasing!"
build:
xcodebuild clean build
+23
View File
@@ -0,0 +1,23 @@
// swift-tools-version:5.3
import PackageDescription
let version = "VERSION_PLACEHOLDER"
let checksum = "CHECKSUM_PLACEHOLDER"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(version)/Sparkle-SPM-\(version).zip"
let package = Package(
name: "Sparkle",
platforms: [.macOS(.v10_11)],
products: [
.library(
name: "Sparkle",
targets: ["Sparkle"])
],
targets: [
.binaryTarget(
name: "Sparkle",
url: url,
checksum: checksum
)
]
)
+23
View File
@@ -0,0 +1,23 @@
// swift-tools-version:5.3
import PackageDescription
let version = "2.0.0"
let checksum = "ced6b1d5691f948df49206eba9abe75fcabbef3dcfae685e8352c8df5d60ea22"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(version)/Sparkle-SPM-\(version).zip"
let package = Package(
name: "Sparkle",
platforms: [.macOS(.v10_11)],
products: [
.library(
name: "Sparkle",
targets: ["Sparkle"])
],
targets: [
.binaryTarget(
name: "Sparkle",
url: url,
checksum: checksum
)
]
)
@@ -3,7 +3,7 @@
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry