Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project and installation methods (CocoaPods and Swift Package Manager) for Xcode 15 #56

Merged
merged 1 commit into from May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,45 @@ on:
branches:
- master

env:
# Use Xcode 15.2 or newer to support VisionOS
DEVELOPER_DIR: /Applications/Xcode_15.2.app

jobs:
test:
name: Test
runs-on: macos-latest
strategy:
matrix:
platform: ['iOS Simulator,name=iPhone 13']
platform: ['iOS Simulator,name=iPhone 15']
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Test
run: make test
analyze:
name: Analyze
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: analyze
run: make analyze
cocoapods:
name: CocoaPods
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Cocoapods lint
run: make cocoapods
carthage:
name: Carthage
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: carthage
run: make carthage
swift-package-manager:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Verify that PINCache can be build by SPM
- name: Verify that PINOperation can be built by SPM
run: make spm
8 changes: 5 additions & 3 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ on:
release-type:
description: 'The type of release. Must be major, minor or patch'
required: true

env:
# Use Xcode 15.2 or newer to support VisionOS
DEVELOPER_DIR: /Applications/Xcode_15.2.app

jobs:
create_release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
# Make sure we can lint before creating the release.
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Cocoapods lint
run: make cocoapods
- name: Create Release Commit
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [1.2.3](https://github.com/Pinterest/PINOperation/tree/1.2.3) (TBD)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update the version number and release date before merging, per guidance from the maintainers.


[Full Changelog](https://github.com/Pinterest/PINOperation/compare/1.2.2...1.2.3)


- Update project to build and run using Xcode 15
- Update CocoaPods Podspec to include Privacy Manifest file
- Bump minimum deployment targets to iOS 12, tvOS 12, watchOS 4, and macOS 10.13

## [1.2.2](https://github.com/Pinterest/PINOperation/tree/1.2.2) (2022-11-28)

[Full Changelog](https://github.com/Pinterest/PINOperation/compare/1.2.1...1.2.2)
Expand Down
63 changes: 12 additions & 51 deletions Example/PINOperationExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 60;
objects = {

/* Begin PBXBuildFile section */
1387274F245D5BB500C1F56D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1387274E245D5BB500C1F56D /* AppDelegate.swift */; };
13872758245D5BB800C1F56D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13872757245D5BB800C1F56D /* Assets.xcassets */; };
1387275B245D5BB800C1F56D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 13872759245D5BB800C1F56D /* LaunchScreen.storyboard */; };
13872765245D5D8200C1F56D /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 13872764245D5D8200C1F56D /* MainViewController.m */; };
6DD78925193625590E803994 /* libPods-PINOperationExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BDDE545CD189CC0B424ECD0 /* libPods-PINOperationExample.a */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -23,17 +22,13 @@
13872762245D5D8200C1F56D /* PINOperationExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PINOperationExample-Bridging-Header.h"; sourceTree = "<group>"; };
13872763245D5D8200C1F56D /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
13872764245D5D8200C1F56D /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
15635AC2BB0501241D3126BA /* Pods-PINOperationExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PINOperationExample.release.xcconfig"; path = "Target Support Files/Pods-PINOperationExample/Pods-PINOperationExample.release.xcconfig"; sourceTree = "<group>"; };
2F8A2FBFCEF95140E01995E8 /* Pods-PINOperationExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PINOperationExample.debug.xcconfig"; path = "Target Support Files/Pods-PINOperationExample/Pods-PINOperationExample.debug.xcconfig"; sourceTree = "<group>"; };
7BDDE545CD189CC0B424ECD0 /* libPods-PINOperationExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PINOperationExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
13872748245D5BB500C1F56D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6DD78925193625590E803994 /* libPods-PINOperationExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -43,8 +38,6 @@
110EBBE34DCD59092AC3306C /* Pods */ = {
isa = PBXGroup;
children = (
2F8A2FBFCEF95140E01995E8 /* Pods-PINOperationExample.debug.xcconfig */,
15635AC2BB0501241D3126BA /* Pods-PINOperationExample.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand All @@ -55,7 +48,6 @@
1387274D245D5BB500C1F56D /* PINOperationExample */,
1387274C245D5BB500C1F56D /* Products */,
110EBBE34DCD59092AC3306C /* Pods */,
5C200BF654CB547E7117CE2B /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -81,22 +73,13 @@
path = PINOperationExample;
sourceTree = "<group>";
};
5C200BF654CB547E7117CE2B /* Frameworks */ = {
isa = PBXGroup;
children = (
7BDDE545CD189CC0B424ECD0 /* libPods-PINOperationExample.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
1387274A245D5BB500C1F56D /* PINOperationExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1387275F245D5BB800C1F56D /* Build configuration list for PBXNativeTarget "PINOperationExample" */;
buildPhases = (
6C859F1C363A79193D42EFC9 /* [CP] Check Pods Manifest.lock */,
13872747245D5BB500C1F56D /* Sources */,
13872748245D5BB500C1F56D /* Frameworks */,
13872749245D5BB500C1F56D /* Resources */,
Expand All @@ -116,8 +99,9 @@
13872743245D5BB500C1F56D /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1140;
LastUpgradeCheck = 1140;
LastUpgradeCheck = 1520;
ORGANIZATIONNAME = Pinterest;
TargetAttributes = {
1387274A245D5BB500C1F56D = {
Expand All @@ -127,7 +111,7 @@
};
};
buildConfigurationList = 13872746245D5BB500C1F56D /* Build configuration list for PBXProject "PINOperationExample" */;
compatibilityVersion = "Xcode 9.3";
compatibilityVersion = "Xcode 15.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -156,31 +140,6 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
6C859F1C363A79193D42EFC9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-PINOperationExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
13872747245D5BB500C1F56D /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -231,6 +190,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -255,7 +215,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -291,6 +251,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -309,7 +270,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -321,20 +282,20 @@
};
13872760245D5BB800C1F56D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2F8A2FBFCEF95140E01995E8 /* Pods-PINOperationExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PINOperationExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.pinterest.PINOperationExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "PINOperationExample/PINOperationExample-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -344,20 +305,20 @@
};
13872761245D5BB800C1F56D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 15635AC2BB0501241D3126BA /* Pods-PINOperationExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PINOperationExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.pinterest.PINOperationExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "PINOperationExample/PINOperationExample-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://cdn.cocoapods.org/'
platform :ios, '8.0'
platform :ios, '12.0'

target 'PINOperationExample' do
pod 'PINOperation', :path => '../'
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- PINOperation (1.1.2)
- PINOperation (1.2.3)

DEPENDENCIES:
- PINOperation (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
PINOperation: 24b774353ca248fcf87d67b2d61eef42087c125a
PINOperation: fb563bcc9c32c26d6c78aaff967d405aa2ee74a7

PODFILE CHECKSUM: b83a75d584abe07185e7be951687702dadbabf84
PODFILE CHECKSUM: 590bbecb30df161f3cdb5ab267c95244b0df928f

COCOAPODS: 1.9.1
COCOAPODS: 1.15.2
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PLATFORM="platform=iOS Simulator,name=iPhone 13"
PLATFORM="platform=iOS Simulator,name=iPhone 15"
SDK="iphonesimulator"
SHELL=/bin/bash -o pipefail
XCODE_MAJOR_VERSION=$(shell xcodebuild -version | HEAD -n 1 | sed -E 's/Xcode ([0-9]+).*/\1/')
Expand All @@ -24,15 +24,14 @@ analyze: install_xcbeautify
rm -rf $(shell pwd)/clang

test: install_xcbeautify
# TODO: Fix data races and enable thread sanitizer with '-enableThreadSanitizer YES'
xcodebuild clean test -destination ${PLATFORM} -sdk ${SDK} -project PINOperation.xcodeproj -scheme PINOperation \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGNING_REQUIRED=NO | xcbeautify

spm:
# For now just check whether we can assemble it
# TODO: replace it with "swift test --enable-test-discovery --sanitize=thread" when swiftPM resource-related bug would be fixed.
# https://bugs.swift.org/browse/SR-13560
swift build
# TODO: Fix data races and enable thread sanitizer with '--sanitize thread'
swift test

release-major:

Expand All @@ -41,4 +40,4 @@ release-minor:
release-patch:


all: carthage cocoapods test analyze spm
all: carthage cocoapods test analyze spm
15 changes: 9 additions & 6 deletions PINOperation.podspec
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
Pod::Spec.new do |s|
s.name = 'PINOperation'
s.version = '1.2.2'
s.version = '1.2.3'
s.homepage = 'https://github.com/pinterest/PINOperation'
s.summary = 'Fast, concurrency-limited task queue for iOS and OS X.'
s.authors = { 'Garrett Moon' => '[email protected]' }
s.source = { :git => 'https://github.com/pinterest/PINOperation.git', :tag => "#{s.version}" }
s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
s.requires_arc = true
s.frameworks = 'Foundation'
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.8'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'
s.cocoapods_version = '>= 1.13.0'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a common pattern used across other popular open source libraries, ensuring the VisionOS platform is recognized and Resource Bundles are properly generated.

s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
s.tvos.deployment_target = '12.0'
s.visionos.deployment_target = '1.0'
s.watchos.deployment_target = '4.0'
pch_PIN = <<-EOS
#ifndef TARGET_OS_WATCH
#define TARGET_OS_WATCH 0
#endif
EOS
s.prefix_header_contents = pch_PIN
s.source_files = 'Source/**/*.{h,m,mm}'
s.source_files = 'Source/*.{h,m}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the format used in PINCache. I figured it was best to keep things simple and consistent with PINCache.

s.resource_bundles = { 'PINOperation' => ['Source/PrivacyInfo.xcprivacy'] }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an important line. Adding a Privacy Manifest to resources would end up clobbering an app's Privacy Manifest. Popular open source libraries (Firebase, Alamofire, etc.) have been using this approach for several months with no issues.

end
Loading
Loading