From 8d9ce6e95e4783b2d22184155825b21d3cbcb9ef Mon Sep 17 00:00:00 2001 From: Leonid Melnyk Date: Thu, 21 Jul 2022 09:52:42 +0200 Subject: [PATCH] Support for custom Xcode app path --- InjectionIII.xcodeproj/project.pbxproj | 4 ++-- InjectionIII/Base.lproj/MainMenu.xib | 19 +++++++++++++------ InjectionIII/build_bundles.sh | 9 ++------- README.md | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/InjectionIII.xcodeproj/project.pbxproj b/InjectionIII.xcodeproj/project.pbxproj index cf2f61aa..18afc21c 100644 --- a/InjectionIII.xcodeproj/project.pbxproj +++ b/InjectionIII.xcodeproj/project.pbxproj @@ -1511,7 +1511,7 @@ ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = InjectionBundle/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - LD_RUNPATH_SEARCH_PATHS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(PLATFORM_NAME) /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks @loader_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $PLATFORM_DIR/Developer/Library/Frameworks @loader_path/../Frameworks"; MACH_O_TYPE = mh_dylib; MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionBundle; @@ -1535,7 +1535,7 @@ ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = InjectionBundle/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - LD_RUNPATH_SEARCH_PATHS = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(PLATFORM_NAME) /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks @loader_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $PLATFORM_DIR/Developer/Library/Frameworks @loader_path/../Frameworks"; MACH_O_TYPE = mh_dylib; MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionBundle; diff --git a/InjectionIII/Base.lproj/MainMenu.xib b/InjectionIII/Base.lproj/MainMenu.xib index 748499f0..c70d8f50 100644 --- a/InjectionIII/Base.lproj/MainMenu.xib +++ b/InjectionIII/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -664,7 +664,7 @@ - + @@ -679,11 +679,11 @@ - + - + @@ -706,6 +706,13 @@ + + + + + + + @@ -977,7 +984,7 @@ - + diff --git a/InjectionIII/build_bundles.sh b/InjectionIII/build_bundles.sh index 7dfacaea..1e453f84 100755 --- a/InjectionIII/build_bundles.sh +++ b/InjectionIII/build_bundles.sh @@ -9,17 +9,12 @@ # $Id: //depot/ResidentEval/InjectionIII/build_bundles.sh#67 $ # -# Injection has to assume a fixed path for Xcode.app as it uses -# Swift and the user's project may contain only Objective-C. -# The second "rpath" is to be able to find XCTest.framework. -FIXED_XCODE_DEVELOPER_PATH=/Applications/Xcode.app/Contents/Developer - function build_bundle () { FAMILY=$1 PLATFORM=$2 SDK=$3 - SWIFT_DYLIBS_PATH="$FIXED_XCODE_DEVELOPER_PATH/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$SDK" - XCTEST_FRAMEWORK_PATH="$FIXED_XCODE_DEVELOPER_PATH/Platforms/$PLATFORM.platform/Developer/Library/Frameworks" + SWIFT_DYLIBS_PATH="$TOOLCHAIN_DIR/usr/lib/swift/$SDK" + XCTEST_FRAMEWORK_PATH="$PLATFORM_DIR/Developer/Library/Frameworks" BUNDLE_CONFIG=Release if [ ! -d "$SWIFT_DYLIBS_PATH" -o ! -d "${XCTEST_FRAMEWORK_PATH}/XCTest.framework" ]; then diff --git a/README.md b/README.md index e2fcfcd4..d1c2f06f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You should use one of these releases for Apple Silicon or if you have upgraded t ![Icon](http://johnholdsworth.com/InjectionUI.gif) -`InjectionIII.app` needs an Xcode 10.2 or greater at the path `/Applications/Xcode.app` , +`InjectionIII.app` needs an Xcode 10.2 or greater, works for `Swift`, `Objective-C` and since 3.2.2 `C++` and can be used alongside [AppCode](https://www.jetbrains.com/help/objc/create-a-swiftui-application.html) or by using the [AppCode Plugin](https://github.com/johnno1962/InjectionIII/blob/master/AppCodePlugin/INSTALL.md) instead.