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

Compile cleanly with 15.3 #49

Merged
merged 7 commits into from
Mar 6, 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: 15 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,44 @@ jobs:
- tvOS
- watchOS
- macOS
runs-on: macos-12
#- visionOS
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build
uses: mxcl/xcodebuild@v1
uses: mxcl/xcodebuild@v2
with:
platform: ${{ matrix.platform }}
scheme: FetchRequests-${{ matrix.platform }}
xcode: 15.2
action: test
code-coverage: true
- name: Code Coverage
#uses: codecov/codecov-action@v2
run: bash <(curl -s https://codecov.io/bash);
validate:
runs-on: macos-12
runs-on: macos-14
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Swift Lint
run: swiftlint --strict
run: |
command -v swiftlint || brew install --quiet swiftlint
swiftlint --reporter github-actions-logging --strict
- name: Swift Format
run: swiftformat --lint .
run: |
command -v swiftformat || brew install --quiet swiftformat
swiftformat --reporter github-actions-log --lint .
- name: Pod Lint
run: pod lib lint --quick --fail-fast --verbose --skip-tests
- name: Example Project
uses: mxcl/xcodebuild@v1
uses: mxcl/xcodebuild@v2
with:
platform: iOS
scheme: iOS Example
xcode: 15.2
action: build
warnings-as-errors: true
working-directory: Example
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--swiftversion 5.7
--swiftversion 5.9

--exclude Pods

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
`FetchRequests` adheres to [Semantic Versioning](https://semver.org/).

## [6.0.3](https://github.com/square/FetchRequests/releases/tag/6.0.3)
Released on 2024-03-06

* Cleanup warnings in Xcode 15.3

## [6.0.2](https://github.com/square/FetchRequests/releases/tag/6.0.2)
Released on 2023-09-21

Expand Down
11 changes: 9 additions & 2 deletions Example/iOS-Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -199,8 +199,9 @@
47ACD18722CBE39600B3F1FE /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1530;
ORGANIZATIONNAME = "Speramus Inc.";
TargetAttributes = {
47ACD18E22CBE39600B3F1FE = {
Expand Down Expand Up @@ -345,6 +346,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -379,6 +381,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -400,13 +403,15 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = targeted;
};
name = Debug;
};
47ACD1A022CBE39700B3F1FE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -441,6 +446,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -455,6 +461,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_STRICT_CONCURRENCY = targeted;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"object": {
"pins": [
{
"package": "swift-collections",
"repositoryURL": "https://github.com/apple/swift-collections.git",
"state": {
"branch": null,
"revision": "48254824bb4248676bf7ce56014ff57b142b77eb",
"version": "1.0.2"
}
"pins" : [
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
}
]
},
"version": 1
}
],
"version" : 2
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1530"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
18 changes: 12 additions & 6 deletions Example/iOS-Example/Observable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ class Observable<Value> {
fileprivate var observers: Atomic<[UUID: Handler]> = Atomic(wrappedValue: [:])

var wrappedValue: Value {
@MainActor(unsafe)
didSet {
assert(Thread.isMainThread)
unsafeHandler {
let change = Change(oldValue: oldValue, newValue: wrappedValue)
let observers = self.observers.wrappedValue

let change = Change(oldValue: oldValue, newValue: wrappedValue)
let observers = self.observers.wrappedValue

observers.values.forEach { $0(change) }
observers.values.forEach { $0(change) }
}
}
}

Expand All @@ -46,6 +45,13 @@ class Observable<Value> {
}
}

@MainActor(unsafe)
private func unsafeHandler(for handler: @MainActor () -> Void) {
assert(Thread.isMainThread)
// This is a dumb wrapper, but I can't otherwise have a "clean" compile
handler()
}

extension Observable where Value: Equatable {
func observeChanges(handler: @escaping Handler) -> InvalidatableToken {
observe { change in
Expand Down
5 changes: 4 additions & 1 deletion FetchRequests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FetchRequests'
s.version = '6.0.2'
s.version = '6.0.3'
s.license = 'MIT'
s.summary = 'NSFetchedResultsController inspired eventing'
s.homepage = 'https://github.com/square/FetchRequests'
Expand All @@ -11,11 +11,13 @@ Pod::Spec.new do |s|
tvos_deployment_target = '14.0'
watchos_deployment_target = '7.0'
macos_deployment_target = '11'
visionos_deployment_target = '1'

s.ios.deployment_target = ios_deployment_target
s.tvos.deployment_target = tvos_deployment_target
s.watchos.deployment_target = watchos_deployment_target
s.macos.deployment_target = macos_deployment_target
s.visionos.deployment_target = visionos_deployment_target

s.swift_version = '5.0'

Expand All @@ -31,6 +33,7 @@ Pod::Spec.new do |s|
test_spec.tvos.deployment_target = tvos_deployment_target
test_spec.watchos.deployment_target = watchos_deployment_target
test_spec.macos.deployment_target = macos_deployment_target
test_spec.visionos.deployment_target = visionos_deployment_target
end

end
Loading
Loading