Skip to content

Commit

Permalink
Fix resource bundles failing to copy with xcodebuilt products.
Browse files Browse the repository at this point in the history
Signed-off-by: furby™ <[email protected]>
  • Loading branch information
furby-tm committed Nov 30, 2024
1 parent 73fe891 commit 71cd250
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Sources/swift-bundler/Commands/AsyncCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ protocol AsyncCommand: AsyncParsableCommand {
func wrappedValidate() throws

/// Implement this instead of `run()` to get custom Swift Bundler error handling.
func wrappedRun() async throws
mutating func wrappedRun() async throws
}

extension AsyncCommand {
func wrappedValidate() {}
}

extension AsyncCommand {
func run() async {
mutating func run() async {
do {
try await wrappedRun()
} catch {
Expand Down
7 changes: 5 additions & 2 deletions Sources/swift-bundler/Commands/BundleCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct BundleCommand: AsyncCommand {
return architectures
}

func wrappedRun() async throws {
mutating func wrappedRun() async throws {
_ = try await doBundling()
}

Expand All @@ -196,7 +196,7 @@ struct BundleCommand: AsyncCommand {
/// `RunCommand` to figure out where the output bundle will end up even
/// when the user instructs it to skip bundling.
/// - Returns: A description of the structure of the bundler's output.
func doBundling(dryRun: Bool = false) async throws -> BundlerOutputStructure {
mutating func doBundling(dryRun: Bool = false) async throws -> BundlerOutputStructure {
// Time execution so that we can report it to the user.
let (elapsed, bundlerOutputStructure) = try await Stopwatch.time {
// Load configuration
Expand Down Expand Up @@ -231,6 +231,9 @@ struct BundleCommand: AsyncCommand {
forceUsingXcodeBuild = arguments.noXcodebuild ? !arguments.noXcodebuild : forceUsingXcodeBuild

if forceUsingXcodeBuild {
// If building with xcodebuild, be sure to set that here.
self.builtWithXcode = true

// Terminate the program if the project is an Xcodeproj based project.
let xcodeprojs = try FileManager.default.contentsOfDirectory(
at: packageDirectory,
Expand Down
2 changes: 1 addition & 1 deletion Sources/swift-bundler/Commands/RunCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct RunCommand: AsyncCommand {
simulatorSearchTerm: simulatorSearchTerm
)

let bundleCommand = BundleCommand(
var bundleCommand = BundleCommand(
arguments: _arguments,
skipBuild: false,
builtWithXcode: false,
Expand Down

0 comments on commit 71cd250

Please sign in to comment.