Skip to content

Commit

Permalink
Ensure Swift scripts are compiled before execution for Xcode 15 compa…
Browse files Browse the repository at this point in the history
…tibility

This commit updates the build scripts to compile PropertyListModifier.swift into executables before running them. This change addresses the issue(trilemma-dev#17) introduced in Xcode 15, where running Swift scripts directly can lead to errors due to the updated execution environment handling. By compiling Swift scripts first, we ensure compatibility with Xcode 15 and later versions, while also reducing potential environmental discrepancies.
  • Loading branch information
Hzao committed Mar 8, 2024
1 parent 85f4562 commit 216e9fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion BuildScripts/PropertyListModifier.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env xcrun --sdk macosx swift
//
// PropertyListModifier.swift
// SwiftAuthorizationSample
Expand Down
8 changes: 4 additions & 4 deletions SwiftAuthorizationSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}\"/BuildScripts/PropertyListModifier.swift satisfy-job-bless-requirements\n";
shellScript = "swiftc \"${SRCROOT}\"/BuildScripts/PropertyListModifier.swift -o \"${SRCROOT}\"/BuildScripts/PropertyListModifier\n\"${SRCROOT}\"/BuildScripts/PropertyListModifier satisfy-job-bless-requirements\n";
};
99F409F0272303D10010500C /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -327,7 +327,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}\"/BuildScripts/PropertyListModifier.swift cleanup-job-bless-requirements\n";
shellScript = "\"${SRCROOT}\"/BuildScripts/PropertyListModifier cleanup-job-bless-requirements\nrm \"${SRCROOT}\"/BuildScripts/PropertyListModifier\n";
};
99F409F1272303E00010500C /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -344,7 +344,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}\"/BuildScripts/PropertyListModifier.swift satisfy-job-bless-requirements specify-mach-services auto-increment-version\n\n";
shellScript = "swiftc \"${SRCROOT}\"/BuildScripts/PropertyListModifier.swift -o \"${SRCROOT}\"/BuildScripts/PropertyListModifier\n\"${SRCROOT}\"/BuildScripts/PropertyListModifier satisfy-job-bless-requirements specify-mach-services auto-increment-version\n";
};
99F409F2272303F20010500C /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -361,7 +361,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}\"/BuildScripts/PropertyListModifier.swift cleanup-job-bless-requirements cleanup-mach-services\n";
shellScript = "\"${SRCROOT}\"/BuildScripts/PropertyListModifier cleanup-job-bless-requirements cleanup-mach-services\nrm \"${SRCROOT}\"/BuildScripts/PropertyListModifier\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down

0 comments on commit 216e9fb

Please sign in to comment.