Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0cdc1a6
Handle targets with same name but in different projects
bmxav Sep 17, 2024
dbe4b44
Merge pull request #78 from veracode/project-specific-targets
bmxav Sep 26, 2024
c088f08
Ignore test bundles when generating bitcode
bmxav Sep 26, 2024
874e98a
Update build.yml
davdres Apr 2, 2025
6e7a8a6
Update build.yml
davdres Apr 2, 2025
31602e8
Update build.yml
davdres Apr 2, 2025
a175ddc
Merge pull request #79 from veracode/ignore-test-bundles
bmxav Sep 26, 2024
09075b8
Update build.yml
davdres Apr 2, 2025
17aec35
Issue #81 log unrequired targets instead of failing.
davdres Mar 11, 2025
3341d77
Issue #81 log PIF location & missing commands.
davdres Mar 19, 2025
310c00d
Issue #81 PIF workspace sort
davdres Mar 27, 2025
e65d74c
Issue #81 resolve lint error.
davdres Mar 27, 2025
8ce1496
Issue #81 Update version; add some logging
davdres Apr 1, 2025
013c07f
Update PIF/Sources/PIFSupport/PIF.swift
davdres Apr 2, 2025
1508b5c
Update PIF/Sources/PIFSupport/PIFSupport.swift
davdres Apr 2, 2025
020fef6
Issue #81 Address linter & review issues.
davdres Apr 2, 2025
0b1812c
Issue #81 Test unwrap of optional pif cache location.
davdres Apr 2, 2025
dde9586
Issue 81 add running of tests to the build pipeline
davdres Apr 2, 2025
1bc6b8b
Merge pull request #83 from veracode/unknown-targets
davdres Apr 3, 2025
6f8f588
ENG-55520: On sourceTree decode error, log & continue (#88)
davdres Apr 17, 2025
c41046b
SENG-9588 remove development release (#90)
davdres Apr 23, 2025
fd8abb5
SSAST-10500 Warn if multiple builds in xcode log (#91)
davdres Apr 24, 2025
d7fb8ef
SSAST-10519 Add option to capture debug data (#92)
davdres Jun 2, 2025
51cb602
SSAST-10900 Update help for debug data capture. (#93)
davdres Jul 31, 2025
be30b57
Install instructions cannot be executed as is, improve install instru…
Nov 3, 2025
3edb28d
Merge pull request #97 from veracode/feature/improved-install-shell
NinjaLikesCheez Nov 3, 2025
a1dbe58
Feature/ssast 10888 (#96)
davdres Nov 17, 2025
b8ecdc0
SSAST-13151 Use info logging to give user a progress indication. (#99)
davdres Dec 22, 2025
52bef87
Release/1.0.1 (#101)
davdres Jan 5, 2026
78d94dd
SSAST-13151 Merge back main
davdres Jan 5, 2026
40717ad
Merge branch 'main' into develop
davdres Jan 8, 2026
61fabaa
SSAST-11722 Log error and continue on TargetDependency decode error (…
davdres Mar 26, 2026
11b2a37
SSAST-15959 Allow product type strings to start with 'com.apple' or '…
davdres Jul 29, 2026
c1a9e1b
SSAST-16090 Show debugging options in --help.
davdres Jul 29, 2026
10d81d1
SSAST-15959 Remove Xcode 16 requirement: no longer available on github
davdres Jul 29, 2026
9fe208a
SSAST-16090 Put precompilation note in help
davdres Jul 29, 2026
dd39d25
Merge pull request #106 from veracode/feature/SSAST-15969
davdres Jul 30, 2026
5857862
Release 1.0.3
davdres Aug 14, 2026
56bf2a1
Merge branch 'main' into release/1.0.3
davdres Aug 14, 2026
9dd64d6
github build failure fix: ENABLE_USER_SCRIPT_SANDBOXING=YES
davdres Aug 14, 2026
26c36d7
Remove manual removal of empty framework.
davdres Aug 14, 2026
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
3 changes: 2 additions & 1 deletion Sources/GenIR/Versions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Created by Thomas Hedderwick on 12/09/2022.
//
// History:
// 2026-nn-nn - 1.0.3 -- SSAST-15959, SSAST-16090 - product type org.swift...; help text update
// 2026-nn-nn - 1.0.2 -- SSAST-11722 don't fail on TargetDependency decode failure.
// 2026-01-08 - 1.0.1 -- Use info logging to allow user to monitor progress.
// 2025-12-01 - 1.0.0 -- Don't chase through Dynamic Dependencies
Expand All @@ -16,5 +17,5 @@
import Foundation

enum Versions {
static let version = "1.0.2"
static let version = "1.0.3"
}
18 changes: 0 additions & 18 deletions TestAssets/Umbrella/Umbrella.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
CEC11E5C29F6BF4900F16A2E /* Sources */,
CEC11E5D29F6BF4900F16A2E /* Frameworks */,
CEC11E5E29F6BF4900F16A2E /* Resources */,
CEC11E7329F6C29D00F16A2E /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -189,23 +188,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
CEC11E7329F6C29D00F16A2E /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "# All other frameworks are a by-product of building this framework, but this is just an empty framework, we don't need it so we can remove it.\nrm -rf \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.framework\"\nrm -rf \"$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
4 changes: 2 additions & 2 deletions Tests/GenIRTests/UmbrellaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class UmbrellaTests: XCTestCase {

func testSkipInstallNo() throws {
let context = TestContext()
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO"])
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO", "ENABLE_USER_SCRIPT_SANDBOXING=YES"])

let output = context.archive.appendingPathComponent("IR")

Expand Down Expand Up @@ -63,7 +63,7 @@ final class UmbrellaTests: XCTestCase {

func testCustomDerivedDataAndSkipInstallNo() throws {
let context = TestContext()
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO", "-derivedDataPath", "_build"])
try context.build(test: testPath, scheme: scheme, additionalArguments: ["SKIP_INSTALL=NO", "ENABLE_USER_SCRIPT_SANDBOXING=YES", "-derivedDataPath", "_build"])

let output = context.archive.appendingPathComponent("IR")

Expand Down
Loading