Skip to content
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
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
build:
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4.0' # Specify the desired Xcode version

- uses: actions/checkout@v4

- name: 🔨 Build
Expand Down
82 changes: 53 additions & 29 deletions PIF/Sources/PIFSupport/PIF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file contains derivative work from the Swift Open Source Project
//
// Copyright (c) 2014-2020 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -483,35 +483,59 @@ public enum PIF {
/// An Xcode target, representing a single entity to build.
public final class Target: BaseTarget {
public enum ProductType: String, Decodable {
case appExtension = "com.apple.product-type.app-extension"
case appExtensionMessages = "com.apple.product-type.app-extension.messages"
case stickerPackExtension = "com.apple.product-type.app-extension.messages-sticker-pack"
case application = "com.apple.product-type.application"
case applicationMessages = "com.apple.product-type.application.messages"
case appClip = "com.apple.product-type.application.on-demand-install-capable"
case bundle = "com.apple.product-type.bundle"
case externalTest = "com.apple.product-type.bundle.external-test"
case ocUnitTest = "com.apple.product-type.bundle.ocunit-test"
case uiTesting = "com.apple.product-type.bundle.ui-testing"
case unitTest = "com.apple.product-type.bundle.unit-test"
case extensionKitExtension = "com.apple.product-type.extensionkit-extension"
case framework = "com.apple.product-type.framework"
case staticFramework = "com.apple.product-type.framework.static"
case instrumentsPackage = "com.apple.product-type.instruments-package"
case kernelExtension = "com.apple.product-type.kernel-extension"
case ioKitKernelExtension = "com.apple.product-type.kernel-extension.iokit"
case dynamicLibrary = "com.apple.product-type.library.dynamic"
case staticLibrary = "com.apple.product-type.library.static"
case objectFile = "com.apple.product-type.objfile"
case pluginKitPlugin = "com.apple.product-type.pluginkit-plugin"
case appExtension = "product-type.app-extension"
case appExtensionMessages = "product-type.app-extension.messages"
case stickerPackExtension = "product-type.app-extension.messages-sticker-pack"
case application = "product-type.application"
case applicationMessages = "product-type.application.messages"
case appClip = "product-type.application.on-demand-install-capable"
case bundle = "product-type.bundle"
case externalTest = "product-type.bundle.external-test"
case ocUnitTest = "product-type.bundle.ocunit-test"
case uiTesting = "product-type.bundle.ui-testing"
case unitTest = "product-type.bundle.unit-test"
case extensionKitExtension = "product-type.extensionkit-extension"
case framework = "product-type.framework"
case staticFramework = "product-type.framework.static"
case instrumentsPackage = "product-type.instruments-package"
case kernelExtension = "product-type.kernel-extension"
case ioKitKernelExtension = "product-type.kernel-extension.iokit"
case dynamicLibrary = "product-type.library.dynamic"
case staticLibrary = "product-type.library.static"
case objectFile = "product-type.objfile"
case pluginKitPlugin = "product-type.pluginkit-plugin"
case packageProduct = "packageProduct"
case systemExtension = "com.apple.product-type.system-extension"
case tool = "com.apple.product-type.tool"
case hostBuild = "com.apple.product-type.tool.host-build"
case xpcService = "com.apple.product-type.xpc-service"
case watchApp2 = "com.apple.product-type.application.watchapp2"
case watchApp2Container = "com.apple.product-type.application.watchapp2-container"
case watchKit2Extension = "com.apple.product-type.watchkit2-extension"
case systemExtension = "product-type.system-extension"
case tool = "product-type.tool"
case hostBuild = "product-type.tool.host-build"
case xpcService = "product-type.xpc-service"
case watchApp2 = "product-type.application.watchapp2"
case watchApp2Container = "product-type.application.watchapp2-container"
case watchKit2Extension = "product-type.watchkit2-extension"

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
let fullValue = try container.decode(String.self)

let normalizedValue: String
if fullValue.hasPrefix("com.apple.") {
normalizedValue = String(fullValue.dropFirst("com.apple.".count))
} else if fullValue.hasPrefix("org.swift.") {
normalizedValue = String(fullValue.dropFirst("org.swift.".count))
} else {
normalizedValue = fullValue
}

guard let decodedCase = ProductType(rawValue: normalizedValue) else {
throw DecodingError.dataCorrupted(
DecodingError.Context(
codingPath: decoder.codingPath,
debugDescription: "Cannot initialize ProductType from invalid String value \(fullValue)"
)
)
}
self = decodedCase
}
}

public let productName: String
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved

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

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.7.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(path: "PIF")
Expand Down
12 changes: 8 additions & 4 deletions Sources/GenIR/GenIR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ struct DeprecatedOptions: ParsableArguments {

struct DebuggingOptions: ParsableArguments {

@Option(help: ArgumentHelp("Path to PIF cache. Use this in place of what is in the Xcode build log", visibility: .hidden))
@Option(help: ArgumentHelp("Path to PIF cache. Use this in place of what is in the Xcode build log", visibility: .default))
var pifCachePath: URL?

@Option(help: ArgumentHelp("Specifiy a logging level. The --debug flag will override this", visibility: .hidden))
@Option(help: ArgumentHelp("Specifiy a logging level. The --debug flag will override this", visibility: .default))
var logLevel: LogLevelArgument?

@Flag(help: ArgumentHelp("If true, add captured debug data to the xcarchive.", visibility: .hidden))
@Flag(help: ArgumentHelp("If true, add captured debug data to the xcarchive.", visibility: .default))
var capture: Bool = false
}

Expand Down Expand Up @@ -53,6 +53,11 @@ struct DebuggingOptions: ParsableArguments {
$ xcodebuild clean && xcodebuild build -project MyProject.xcodeproj \\\n\t\t-configuration Debug \\\n\t\t-scheme MyScheme \
\\\n\t\tDEBUG_INFOMATION_FORMAT=dwarf-with-dsym \\\n\t\tENABLE_BITCODE=NO \\\n\t\t2>&1 | \(programName) - x.xcarchive

Optionally:
If using precompilation on your Xcode build, it maybe necessary to turn that off to avoid module cache path errors.
GCC_PRECOMPILE_PREFIX_HEADER=NO
ENABLE_MODULE_PRECOMPILATION=NO

""",
version: "v\(Versions.version)"
)
Expand Down Expand Up @@ -85,7 +90,6 @@ struct DebuggingOptions: ParsableArguments {
// Drop this in release 0.6 or greater
@OptionGroup var deprecatedOptions: DeprecatedOptions

// These options are hidden and will not be shown in the help text
@OptionGroup var debuggingOptions: DebuggingOptions

mutating func validate() throws {
Expand Down
Loading