Skip to content

Commit

Permalink
Swift 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
NikSativa committed Sep 28, 2024
1 parent e5fb1f7 commit 48cab07
Show file tree
Hide file tree
Showing 19 changed files with 120 additions and 177 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/swift_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "NikSativa CI"

on:
push:
branches:
- "main"
paths:
- ".github/workflows/**"
- "Package.swift"
- "Source/**"
- "Tests/**"
pull_request:
paths:
- ".github/workflows/**"
- "Package.swift"
- "Source/**"
- "Tests/**"

concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
jobs:
macOS:
name: "macOS ${{ matrix.xcode }} ${{ matrix.swift }}"
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_16"
runsOn: macOS-15
swift: "6.0"
outputFilter: xcbeautify --renderer github-actions
- xcode: "Xcode_15.4"
runsOn: macOS-14
swift: "5.10"
outputFilter: xcbeautify --renderer github-actions
- xcode: "Xcode_15.2"
runsOn: macOS-14
swift: "5.9"
outputFilter: xcbeautify --renderer github-actions
- xcode: "Xcode_14.3"
runsOn: macOS-13
swift: "5.8"
outputFilter: xcbeautify --renderer github-actions
steps:
- uses: NeedleInAJayStack/setup-swift@feat/swift-6 # swift-actions/setup-swift@main
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v4
- name: "Build ${{ matrix.xcode }} ${{ matrix.swift }}"
run: swift build -v | ${{ matrix.outputFilter }}
- name: "Test ${{ matrix.xcode }} ${{ matrix.swift }}"
run: swift test -v | ${{ matrix.outputFilter }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Pods/*
Carthage/*
Packages/*
.swiftpm/*
Package.resolved

## Bundler
.bundle/
Expand Down
8 changes: 8 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is manifest file for the Swift Package Index for it to
# auto-generate and host DocC documentation.
# For reference see https://swiftpackageindex.com/swiftpackageindex/spimanifest/documentation/spimanifest/commonusecases#Host-DocC-documentation-in-the-Swift-Package-Index.

version: 1
builder:
configs:
- documentation_targets: [DIKit]
32 changes: 0 additions & 32 deletions Package.resolved

This file was deleted.

27 changes: 11 additions & 16 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
// swift-tools-version:5.9
// swift-tools-version:6.0
// swiftformat:disable all
import PackageDescription

let package = Package(
name: "DIKit",
platforms: [
.iOS(.v14),
.macOS(.v11),
.macOS(.v13),
.macCatalyst(.v14),
.visionOS(.v1),
.tvOS(.v14),
.watchOS(.v7)
],
products: [
.library(name: "DIKit", targets: ["DIKit"]),
.library(name: "DIKitTestHelpers", targets: ["DIKitTestHelpers"])
.library(name: "DIKit", targets: ["DIKit"])
],
dependencies: [
.package(url: "https://github.com/NikSativa/SpryKit.git", .upToNextMajor(from: "2.2.3"))
.package(url: "https://github.com/NikSativa/SpryKit.git", .upToNextMajor(from: "2.3.9"))
],
targets: [
.target(name: "DIKit",
dependencies: [
],
path: "Source",
resources: [
.copy("../PrivacyInfo.xcprivacy")
]),
.target(name: "DIKitTestHelpers",
dependencies: [
"DIKit",
"SpryKit"
.process("PrivacyInfo.xcprivacy")
],
path: "TestHelpers",
resources: [
.copy("../PrivacyInfo.xcprivacy")
swiftSettings: [
.define("supportsVisionOS", .when(platforms: [.visionOS])),
]),
.testTarget(name: "DIKitTests",
dependencies: [
"DIKit",
"DIKitTestHelpers",
"SpryKit",
],
path: "Tests")
path: "Tests",
swiftSettings: [
.define("supportsVisionOS", .when(platforms: [.visionOS])),
])
]
)
46 changes: 0 additions & 46 deletions [email protected]

This file was deleted.

46 changes: 0 additions & 46 deletions [email protected]

This file was deleted.

19 changes: 4 additions & 15 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,28 @@ let package = Package(
name: "DIKit",
platforms: [
.iOS(.v14),
.macOS(.v11),
.macOS(.v13),
.macCatalyst(.v14),
.tvOS(.v14),
.watchOS(.v7)
],
products: [
.library(name: "DIKit", targets: ["DIKit"]),
.library(name: "DIKitTestHelpers", targets: ["DIKitTestHelpers"])
.library(name: "DIKit", targets: ["DIKit"])
],
dependencies: [
.package(url: "https://github.com/NikSativa/SpryKit.git", .upToNextMajor(from: "2.2.3"))
.package(url: "https://github.com/NikSativa/SpryKit.git", .upToNextMajor(from: "2.3.8"))
],
targets: [
.target(name: "DIKit",
dependencies: [
],
path: "Source",
resources: [
.copy("../PrivacyInfo.xcprivacy")
]),
.target(name: "DIKitTestHelpers",
dependencies: [
"DIKit",
"SpryKit"
],
path: "TestHelpers",
resources: [
.copy("../PrivacyInfo.xcprivacy")
.process("PrivacyInfo.xcprivacy")
]),
.testTarget(name: "DIKitTests",
dependencies: [
"DIKit",
"DIKitTestHelpers",
"SpryKit",
],
path: "Tests")
Expand Down
28 changes: 12 additions & 16 deletions [email protected][email protected]
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
// swift-tools-version:5.5
// swift-tools-version:5.9
// swiftformat:disable all
import PackageDescription

let package = Package(
name: "DIKit",
platforms: [
.iOS(.v14),
.macOS(.v11),
.macOS(.v13),
.macCatalyst(.v14),
.visionOS(.v1),
.tvOS(.v14),
.watchOS(.v7)
],
products: [
.library(name: "DIKit", targets: ["DIKit"]),
.library(name: "DIKitTestHelpers", targets: ["DIKitTestHelpers"])
.library(name: "DIKit", targets: ["DIKit"])
],
dependencies: [
.package(url: "https://github.com/NikSativa/SpryKit.git", .upToNextMajor(from: "2.2.3"))
.package(url: "https://github.com/NikSativa/SpryKit.git", .upToNextMajor(from: "2.3.8"))
],
targets: [
.target(name: "DIKit",
dependencies: [
],
path: "Source",
resources: [
.copy("../PrivacyInfo.xcprivacy")
]),
.target(name: "DIKitTestHelpers",
dependencies: [
"DIKit",
"SpryKit"
.process("PrivacyInfo.xcprivacy")
],
path: "TestHelpers",
resources: [
.copy("../PrivacyInfo.xcprivacy")
swiftSettings: [
.define("supportsVisionOS", .when(platforms: [.visionOS])),
]),
.testTarget(name: "DIKitTests",
dependencies: [
"DIKit",
"DIKitTestHelpers",
"SpryKit",
],
path: "Tests")
path: "Tests",
swiftSettings: [
.define("supportsVisionOS", .when(platforms: [.visionOS])),
])
]
)
8 changes: 8 additions & 0 deletions Source/InjectSettings.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import Foundation

public enum InjectSettings {
#if swift(>=6.0)
public internal(set) nonisolated(unsafe) static var container: Container? {
didSet {
assert(oldValue == nil, "Container is already registered")
}
}
#else
public internal(set) static var container: Container? {
didSet {
assert(oldValue == nil, "Container is already registered")
}
}
#endif

public static var resolver: Resolver? {
return container
Expand Down
6 changes: 6 additions & 0 deletions Source/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ public func +(lhs: Options, rhs: Options.AccessLevel) -> Options {
public func +(lhs: Options, rhs: String) -> Options {
return .init(accessLevel: lhs.accessLevel, entityKind: lhs.entityKind, name: rhs)
}

#if swift(>=6.0)
extension Options: Sendable {}
extension Options.AccessLevel: Sendable {}
extension Options.EntityKind: Sendable {}
#endif
File renamed without changes.
Loading

0 comments on commit 48cab07

Please sign in to comment.