Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.
Closed
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
28 changes: 14 additions & 14 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 25 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -7,7 +7,23 @@ let dependencies: [Package.Dependency]
let versionedTargets: [Target]
let versionedDependencies: [Target.Dependency]

#if swift(>=5.9)
#if swift(>=5.10)
dependencies = [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.3"),
.package(url: "https://github.com/apple/swift-package-manager.git", branch: "release/5.10"),
// .package(url: "https://github.com/apple/swift-tools-support-core.git", branch: "release/5.10"),
]
versionedTargets = [
.target(
name: "Xcodeproj",
dependencies: [
.product(name: "SwiftPM-auto", package: "swift-package-manager"),
// .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
]
)
]
versionedDependencies = ["Xcodeproj"]
#elseif swift(>=5.9)
dependencies = [
.package(url: "https://github.com/apple/swift-argument-parser.git", .exact("1.2.3")),
.package(name: "SwiftPM", url: "https://github.com/apple/swift-package-manager.git", .branch("release/5.9")),
Expand Down Expand Up @@ -58,7 +74,11 @@ versionedDependencies = []
#endif

let platforms: [SupportedPlatform]
#if swift(>=5.6)
#if swift(>=5.10)
platforms = [
.macOS(.v12),
]
#elseif swift(>=5.6)
platforms = [
.macOS(.v11),
]
Expand All @@ -83,8 +103,8 @@ let package = Package(
targets: versionedTargets + [
.target(name: "CreateXCFramework", dependencies: versionedDependencies + [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "SwiftPM-auto", package: "SwiftPM"),
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
.product(name: "SwiftPM-auto", package: "swift-package-manager"),
// .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
]),
.testTarget(name: "CreateXCFrameworkTests", dependencies: [ "CreateXCFramework" ]),
],
Expand Down
8 changes: 4 additions & 4 deletions Sources/CreateXCFramework/PackageInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ struct PackageInfo {
self.rootDirectory = Foundation.URL(fileURLWithPath: options.packagePath, isDirectory: true).absoluteURL
self.buildDirectory = self.rootDirectory.appendingPathComponent(options.buildPath, isDirectory: true).absoluteURL

let root = try AbsolutePath(validating: self.rootDirectory.path)
let root = try TSCBasic.AbsolutePath(validating: self.rootDirectory.path)

self.toolchain = try UserToolchain(destination: try .hostDestination())

#if swift(>=5.7)
let loader = ManifestLoader(toolchain: self.toolchain)
self.workspace = try Workspace(forRootPackage: root, customManifestLoader: loader)
self.workspace = try Workspace(forRootPackage: root.absPath, customManifestLoader: loader)
#elseif swift(>=5.6)
let resources = ToolchainConfiguration(swiftCompilerPath: self.toolchain.swiftCompilerPath)
let loader = ManifestLoader(toolchain: resources)
Expand All @@ -106,12 +106,12 @@ struct PackageInfo {
#endif

#if swift(>=5.6)
self.graph = try workspace.loadPackageGraph(rootPath: root, observabilityScope: self.observabilitySystem.topScope)
self.graph = try workspace.loadPackageGraph(rootPath: root.absPath, observabilityScope: self.observabilitySystem.topScope)
let workspace = self.workspace
let scope = observabilitySystem.topScope
self.manifest = try tsc_await {
workspace.loadRootManifest(
at: root,
at: root.absPath,
observabilityScope: scope,
completion: $0
)
Expand Down
2 changes: 1 addition & 1 deletion Sources/CreateXCFramework/ProjectGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct ProjectGenerator {
xcconfigOverrides: (self.package.overridesXcconfig?.path).flatMap { try AbsolutePath(validating: $0) },
useLegacySchemeGenerator: true
),
fileSystem: localFileSystem,
fileSystem: reallyLocalFileSystem,
observabilityScope: self.package.observabilitySystem.topScope
)
#else
Expand Down
4 changes: 2 additions & 2 deletions Sources/CreateXCFramework/Zipper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ struct Zipper {
}

#if swift(>=5.7)
private func checksum(forBinaryArtifactAt path: AbsolutePath) throws -> String {
let fileSystem = localFileSystem
private func checksum(forBinaryArtifactAt path: TSCBasic.AbsolutePath) throws -> String {
let fileSystem = TSCBasic.localFileSystem
let checksumAlgorithm = SHA256()
let archiver = ZipArchiver(fileSystem: fileSystem)

Expand Down
14 changes: 14 additions & 0 deletions Sources/Xcodeproj/Converters.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Foundation
import TSCBasic
import Basics

//public typealias AbsolutePath = TSCBasic.AbsolutePath
public var reallyLocalFileSystem = TSCBasic.localFileSystem

extension TSCBasic.AbsolutePath {
public var absPath: Basics.AbsolutePath { try! Basics.AbsolutePath(validating: self.pathString) }
}

extension Basics.AbsolutePath {
public var absPath: TSCBasic.AbsolutePath { try! TSCBasic.AbsolutePath(validating: self.pathString) }
}
10 changes: 5 additions & 5 deletions Sources/Xcodeproj/SchemesGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class SchemesGenerator {

private let graph: PackageGraph
private let container: String
private let schemesDir: AbsolutePath
private let schemesDir: AbsolutePath
private let isCodeCoverageEnabled: Bool
private let fs: FileSystem

Expand Down Expand Up @@ -208,12 +208,12 @@ public final class SchemesGenerator {

"""

let file = try AbsolutePath(validating: scheme.filename, relativeTo: schemesDir)
let file = try AbsolutePath(validating: scheme.filename, relativeTo: schemesDir)
try fs.writeFileContents(file, bytes: stream.bytes)
}

private func disableSchemeAutoCreation() throws {
let workspacePath = try AbsolutePath(validating: "../../project.xcworkspace", relativeTo: schemesDir)
let workspacePath = try AbsolutePath(validating: "../../project.xcworkspace", relativeTo: schemesDir)

// Write the settings file to disable automatic scheme creation.
var stream = BufferedOutputByteStream()
Expand All @@ -227,12 +227,12 @@ public final class SchemesGenerator {
</dict>
</plist>
"""
let settingsPlist = try AbsolutePath(validating: "xcshareddata/WorkspaceSettings.xcsettings", relativeTo: workspacePath)
let settingsPlist = try AbsolutePath(validating: "xcshareddata/WorkspaceSettings.xcsettings", relativeTo: workspacePath)
try fs.createDirectory(settingsPlist.parentDirectory, recursive: true)
try fs.writeFileContents(settingsPlist, bytes: stream.bytes)

// Write workspace contents file.
let contentsFile = try AbsolutePath(validating: "contents.xcworkspacedata", relativeTo: workspacePath)
let contentsFile = try AbsolutePath(validating: "contents.xcworkspacedata", relativeTo: workspacePath)
stream = BufferedOutputByteStream()
stream <<< """
<?xml version="1.0" encoding="UTF-8"?>
Expand Down
Loading