From a56ca505ea19a74c33e5ec3df0c43984be7dd390 Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Mon, 3 Aug 2020 01:43:33 +0200 Subject: [PATCH] Distribution target now builds the XCFramework as well --- .travis.yml | 2 - Makefile | 2 - Package.swift | 2 +- Sparkle.xcodeproj/project.pbxproj | 66 ++++++++++++++++++ .../xcschemes/Sparkle.xcframework.xcscheme | 67 +++++++++++++++++++ 5 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcframework.xcscheme diff --git a/.travis.yml b/.travis.yml index d6938001..12ad29e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,4 @@ osx_image: - xcode11.4 - xcode12u script: - - set -o pipefail && xcodebuild -scheme Sparkle -configuration Debug -derivedDataPath build -archivePath build/Build/Products/Debug/Sparkle.xcarchive BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO archive | xcpretty - - set -o pipefail && xcodebuild -create-xcframework -framework build/Build/Products/Debug/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework -output build/Build/Products/Debug/Sparkle.xcframework - set -o pipefail && xcodebuild test -project Sparkle.xcodeproj -scheme Distribution -derivedDataPath build -enableCodeCoverage YES | xcpretty diff --git a/Makefile b/Makefile index b04ca9d2..3be62e3e 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,6 @@ 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" -debug-symbols "$(BUILDDIR)/Build/Products/Release/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM" -output "$(BUILDDIR)/Build/Products/Release/Sparkle.xcframework" xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(BUILDDIR)" build open "$(BUILDDIR)/Build/Products/Release/" cat Sparkle.podspec diff --git a/Package.swift b/Package.swift index a386cd7c..4e0df0e9 100644 --- a/Package.swift +++ b/Package.swift @@ -2,7 +2,7 @@ import PackageDescription let version = "1.24.0" -let checksum = "099ae1e045e254fbf803f98ff74607123bbd288c4f17725e19be5704b8039ef4" +let checksum = "2b6fec0cad2bb643ed222b708f37bf9e98f5ed84d77c9ba69e66dd2b82b0fffa" let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(version)/Sparkle-SPM-\(version).zip" let package = Package( diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 15c0ad6e..cbc717f5 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -25,6 +25,17 @@ name = All; productName = All; }; + 895C5DB924D75F370058A82D /* Sparkle.xcframework */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 895C5DBC24D75F370058A82D /* Build configuration list for PBXAggregateTarget "Sparkle.xcframework" */; + buildPhases = ( + 895C5DBD24D75F590058A82D /* ShellScript */, + ); + dependencies = ( + ); + name = Sparkle.xcframework; + productName = Sparkle.xcframework; + }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ @@ -468,6 +479,13 @@ remoteGlobalIDString = 61B5F90109C4CEE200B25A18; remoteInfo = "Sparkle Test App"; }; + 895C5DBE24D764DD0058A82D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 895C5DB924D75F370058A82D; + remoteInfo = Sparkle.xcframework; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -1749,6 +1767,7 @@ 14732BCB1960F73500593899 /* PBXTargetDependency */, 1454BA1619637EDB00344E57 /* PBXTargetDependency */, 14732BCF1960F73500593899 /* PBXTargetDependency */, + 895C5DBF24D764DD0058A82D /* PBXTargetDependency */, 1454BA1819637EE900344E57 /* PBXTargetDependency */, ); name = Distribution; @@ -2008,6 +2027,9 @@ LastSwiftMigration = 0800; TestTargetID = 61B5F90109C4CEE200B25A18; }; + 895C5DB924D75F370058A82D = { + CreatedOnToolsVersion = 12.0; + }; 8DC2EF4F0486A6940098B216 = { LastSwiftMigration = 0920; }; @@ -2080,6 +2102,7 @@ 14732BC51960F69300593899 /* Distribution */, 1420DF491962329200203BB0 /* Documentation */, 1495005F195FB89400BC5B5B /* All */, + 895C5DB924D75F370058A82D /* Sparkle.xcframework */, 726B2B5C1C645FC900388755 /* UI Tests */, 722954B31D04ADAF00ECF9CA /* fileop */, 5AA96C541E0AE0DB00CA4346 /* generate_appcast */, @@ -2225,6 +2248,23 @@ shellScript = "ln -sfh \"pt_BR.lproj\" \"$BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/pt.lproj\""; showEnvVarsInLog = 0; }; + 895C5DBD24D75F590058A82D /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Deleting old products\nrm -rd \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive\"\nrm -rd \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\n\nxcodebuild archive -scheme Sparkle -archivePath \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive\" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO\n\n# These build number checks are only because -debug-symbols is only available since Xcode 12 beta 3. Once Travis CI updates its Xcode images to the latests betas, this check can simplified to `[ $XCODE_VERSION_MAJOR -ge \"1200\" ]`\nre='^([0-9]+)[A-Z]{1}([0-9]+)[a-z]$'\n[[ $XCODE_PRODUCT_BUILD_VERSION =~ $re ]]\nXCODE_SHORT_BUILD=${BASH_REMATCH[2]}\nif [ $XCODE_VERSION_MAJOR -ge \"1200\" ] && [ $XCODE_SHORT_BUILD -ge \"8169\" ]; then\nxcodebuild -create-xcframework -framework \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework\" -debug-symbols \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM\" -output \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\nelse\necho \"warning: Your Xcode version does not support bundling dSYMs in XCFrameworks directly. You should copy them manually into the XCFramework.\"\necho \"note: cp '$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM' '$BUILT_PRODUCTS_DIR/Sparkle.xcframework/your_architecture/dSYMs'\"\nxcodebuild -create-xcframework -framework \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework\" -output \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\nfi\n"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -2560,6 +2600,11 @@ target = 61B5F90109C4CEE200B25A18 /* Sparkle Test App */; targetProxy = 726B2B621C645FC900388755 /* PBXContainerItemProxy */; }; + 895C5DBF24D764DD0058A82D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 895C5DB924D75F370058A82D /* Sparkle.xcframework */; + targetProxy = 895C5DBE24D764DD0058A82D /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -2984,6 +3029,18 @@ }; name = Release; }; + 895C5DBA24D75F370058A82D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Debug; + }; + 895C5DBB24D75F370058A82D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Release; + }; EA4311A2229D5FBC00A5503D /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = EA4311C9229D614300A5503D /* ed25519-Debug.xcconfig */; @@ -3141,6 +3198,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 895C5DBC24D75F370058A82D /* Build configuration list for PBXAggregateTarget "Sparkle.xcframework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 895C5DBA24D75F370058A82D /* Debug */, + 895C5DBB24D75F370058A82D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; EA4311A1229D5FBC00A5503D /* Build configuration list for PBXNativeTarget "ed25519" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcframework.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcframework.xcscheme new file mode 100644 index 00000000..322eb6cd --- /dev/null +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcframework.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +