Skip to content

Commit

Permalink
Add support for Xcode 14.3.1 and drop support for lower (#79)
Browse files Browse the repository at this point in the history
* Update CI environment

* Update dev packages

* Add some docc options that newly available

* Fix compilation warning

* Update Swift/Xcode versions

* Use smaller machine on CI

* Update testing devices

* Check cancellation
  • Loading branch information
ra1028 authored Sep 21, 2023
1 parent 825e377 commit e0a765d
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 34 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
types: [published]
workflow_dispatch:

env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app

jobs:
publish-docs:
name: Publish Documentation
runs-on: macos-12
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- name: Build docs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:
workflow_dispatch:

env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app

jobs:
test:
name: Test
runs-on: macos-12
runs-on: macos-13
strategy:
matrix:
platform:
Expand All @@ -36,7 +36,7 @@ jobs:

validation:
name: Validation
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- name: Show environments
Expand Down
7 changes: 4 additions & 3 deletions Examples/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -187,7 +187,8 @@
6B590BF25178DC7D824D09CE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1200;
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430;
TargetAttributes = {
0B9FD0BB6D9928064433FF9B = {
ProvisioningStyle = Manual;
Expand All @@ -204,7 +205,7 @@
};
};
buildConfigurationList = B3FD05C59F197F398A0B04AB /* Build configuration list for PBXProject "App" */;
compatibilityVersion = "Xcode 11.0";
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down
2 changes: 1 addition & 1 deletion Examples/App.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ docs:
$(PACKAGE) \
--allow-writing-to-directory docs \
generate-documentation \
--include-extended-types \
--experimental-skip-synthesized-symbols \
--product Atoms \
--disable-indexing \
--transform-for-static-hosting \
Expand All @@ -30,4 +32,6 @@ docs-preview:
$(PACKAGE) \
--disable-sandbox \
preview-documentation \
--include-extended-types \
--experimental-skip-synthesized-symbols \
--product Atoms
16 changes: 8 additions & 8 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "9b1258905c21fc1b97bf03d1b4ca12c4ec4e5fda",
"version" : "1.2.0"
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
}
},
{
Expand All @@ -86,8 +86,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-format.git",
"state" : {
"revision" : "3330aaa0a97fe07e764a4dc9bb032b23df3a948f",
"version" : "508.0.0"
"revision" : "fbfe1869527923dd9f9b2edac148baccfce0dce7",
"version" : "508.0.1"
}
},
{
Expand Down Expand Up @@ -140,17 +140,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/yonaskolb/XcodeGen.git",
"state" : {
"revision" : "ee60884b132078035d30f9892eb8e3e91ba2382c",
"version" : "2.35.0"
"revision" : "b448a6718f1042ccd9f8a783686826d869c44605",
"version" : "2.37.0"
}
},
{
"identity" : "xcodeproj",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tuist/XcodeProj.git",
"state" : {
"revision" : "fae27b48bc14ff3fd9b02902e48c4665ce5a0793",
"version" : "8.9.0"
"revision" : "3797181813ee963fe305d939232bc576d23ddbb0",
"version" : "8.15.0"
}
},
{
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.8

import Foundation
import PackageDescription
Expand Down Expand Up @@ -26,8 +26,8 @@ let package = Package(

if ProcessInfo.processInfo.environment["SWIFTUI_ATOM_PROPERTIES_DEVELOPMENT"] != nil {
package.dependencies.append(contentsOf: [
.package(url: "https://github.com/apple/swift-docc-plugin", exact: "1.2.0"),
.package(url: "https://github.com/apple/swift-format.git", exact: "508.0.0"),
.package(url: "https://github.com/yonaskolb/XcodeGen.git", exact: "2.35.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", exact: "1.3.0"),
.package(url: "https://github.com/apple/swift-format.git", exact: "508.0.1"),
.package(url: "https://github.com/yonaskolb/XcodeGen.git", exact: "2.37.0"),
])
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ Open `Examples/App.xcodeproj` and play around with it!

| |Minimum Version|
|------:|--------------:|
|Swift |5.7 |
|Xcode |14.2 |
|Swift |5.8.1 |
|Xcode |14.3.1 |
|iOS |14.0 |
|macOS |11.0 |
|tvOS |14.0 |
Expand Down
4 changes: 3 additions & 1 deletion Sources/Atoms/Core/Loader/AsyncSequenceAtomLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public struct AsyncSequenceAtomLoader<Node: AsyncSequenceAtom>: RefreshableAtomL

do {
for try await element in sequence {
phase = .success(element)
if !Task.isCancelled {
phase = .success(element)
}
}
}
catch {
Expand Down
4 changes: 3 additions & 1 deletion Sources/Atoms/Core/Loader/PublisherAtomLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public struct PublisherAtomLoader<Node: PublisherAtom>: RefreshableAtomLoader {
var phase = Value.suspending

for await result in results {
phase = AsyncPhase(result)
if !Task.isCancelled {
phase = AsyncPhase(result)
}
}

return phase
Expand Down
4 changes: 3 additions & 1 deletion Sources/Atoms/Core/StoreContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ private extension StoreContext {
// have not yet been updated and are still old when dependent atoms read it.
// As a workaround, the update is executed in the next run loop
// so that the downstream atoms can receive the object that's already updated.
RunLoop.current.perform(notifyUpdate)
RunLoop.current.perform {
notifyUpdate()
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomsTests/Atom/AsyncSequenceAtomTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ final class AsyncSequenceAtomTests: XCTestCase {

let phase = await refreshTask.value

XCTAssertEqual(phase.value, 1)
XCTAssertTrue(phase.isSuspending)
XCTAssertEqual(updateCount, 0)
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomsTests/Atom/PublisherAtomTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ final class PublisherAtomTests: XCTestCase {

let phase = await refreshTask.value

XCTAssertEqual(phase, .success(1))
XCTAssertEqual(phase, .suspending)
XCTAssertEqual(updateCount, 0)
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/swift-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

function swift_build() {
SWIFTUI_ATOM_PROPERTIES_DEVELOPMENT=1 swift build -c release --only-use-versions-from-resolved-file $@
SWIFTUI_ATOM_PROPERTIES_DEVELOPMENT=1 swift build -c release $@
}

PACKAGE=$1
Expand All @@ -29,7 +29,7 @@ if [[ ! -f $BIN || $checksum != $(cat $CHECKSUM_FILE 2>/dev/null) ]]; then

if [[ -e ${SWIFT_PACKAGE_RESOURCES:-} ]]; then
echo "Copying $SWIFT_PACKAGE_RESOURCES..."
cp -R $SWIFT_PACKAGE_RESOURCES $BIN_DIR
cp -Rf $SWIFT_PACKAGE_RESOURCES $BIN_DIR
fi

echo "$checksum" >"$CHECKSUM_FILE"
Expand Down
6 changes: 3 additions & 3 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ pushd "$(cd $(dirname $0)/.. && pwd)" &>/dev/null

case $PLATFORM in
ios)
platform="iOS Simulator,name=iPhone 13 Pro"
platform="iOS Simulator,name=iPhone 14 Pro"
;;
macos)
platform="macOS"
;;
tvos)
platform="tvOS Simulator,name=Apple TV 4K (at 1080p) (2nd generation)"
platform="tvOS Simulator,name=Apple TV 4K (3rd generation)"
;;
watchos)
platform="watchOS Simulator,name=Apple Watch Series 7 (45mm)"
platform="watchOS Simulator,name=Apple Watch Ultra (49mm)"
;;
esac

Expand Down

0 comments on commit e0a765d

Please sign in to comment.