From 341e0214ed49bd31bc357b330f2d4805eeb46335 Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Thu, 2 Aug 2018 07:56:28 -0500 Subject: [PATCH] Automatically copy XPC Services to correct location --- Sources/ProjectSpec/TargetSource.swift | 5 + Sources/XcodeGenKit/PBXProjGenerator.swift | 5 +- Sources/XcodeGenKit/SourceGenerator.swift | 1 + .../Project.xcodeproj/project.pbxproj | 391 ++++++++++++++++++ .../SomeXPCService.xpc/Contents/Info.plist | 49 +++ .../Contents/MacOS/XPC Service | Bin 0 -> 14800 bytes .../Contents/_CodeSignature/CodeResources | 115 ++++++ .../TestProject/XPC Service/Info.plist | 29 ++ .../TestProject/XPC Service/XPC_Service.h | 5 + .../TestProject/XPC Service/XPC_Service.m | 10 + .../XPC Service/XPC_ServiceProtocol.h | 9 + Tests/Fixtures/TestProject/XPC Service/main.m | 41 ++ Tests/Fixtures/TestProject/project.yml | 20 + 13 files changed, 679 insertions(+), 1 deletion(-) create mode 100644 Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/Info.plist create mode 100755 Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/MacOS/XPC Service create mode 100644 Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/_CodeSignature/CodeResources create mode 100644 Tests/Fixtures/TestProject/XPC Service/Info.plist create mode 100644 Tests/Fixtures/TestProject/XPC Service/XPC_Service.h create mode 100644 Tests/Fixtures/TestProject/XPC Service/XPC_Service.m create mode 100644 Tests/Fixtures/TestProject/XPC Service/XPC_ServiceProtocol.h create mode 100644 Tests/Fixtures/TestProject/XPC Service/main.m diff --git a/Sources/ProjectSpec/TargetSource.swift b/Sources/ProjectSpec/TargetSource.swift index 14a5099a..42b7ccbe 100644 --- a/Sources/ProjectSpec/TargetSource.swift +++ b/Sources/ProjectSpec/TargetSource.swift @@ -40,6 +40,11 @@ public struct TargetSource: Equatable { case carbonResources public struct CopyFilesSettings: Equatable, Hashable { + public static let xpcServices = CopyFilesSettings( + destination: .productsDirectory, + subpath: "$(CONTENTS_FOLDER_PATH)/XPCServices" + ) + public enum Destination: String { case absolutePath case productsDirectory diff --git a/Sources/XcodeGenKit/PBXProjGenerator.swift b/Sources/XcodeGenKit/PBXProjGenerator.swift index 37822df8..1ff0ca3a 100644 --- a/Sources/XcodeGenKit/PBXProjGenerator.swift +++ b/Sources/XcodeGenKit/PBXProjGenerator.swift @@ -429,6 +429,7 @@ public class PBXProjGenerator { var dependencies: [String] = [] var targetFrameworkBuildFiles: [String] = [] var frameworkBuildPaths = Set() + var copyFilesBuildPhasesFiles: [TargetSource.BuildPhase.CopyFilesSettings: [String]] = [:] var copyFrameworksReferences: [String] = [] var copyResourcesReferences: [String] = [] var copyWatchReferences: [String] = [] @@ -500,6 +501,8 @@ public class PBXProjGenerator { copyFrameworksReferences.append(embedFile.reference) } else if dependencyTarget.type.isApp && dependencyTarget.platform == .watchOS { copyWatchReferences.append(embedFile.reference) + } else if dependencyTarget.type == .xpcService { + copyFilesBuildPhasesFiles[.xpcServices, default: []].append(embedFile.reference) } else { copyResourcesReferences.append(embedFile.reference) } @@ -657,7 +660,7 @@ public class PBXProjGenerator { buildPhases.append(script.reference) } - let copyFilesBuildPhasesFiles = getBuildFilesForCopyFilesPhases() + copyFilesBuildPhasesFiles.merge(getBuildFilesForCopyFilesPhases()) { $0 + $1 } if !copyFilesBuildPhasesFiles.isEmpty { for (copyFiles, buildPhaseFiles) in copyFilesBuildPhasesFiles { let copyFilesBuildPhase = createObject( diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index 1f67cf6d..87e27df3 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -197,6 +197,7 @@ class SourceGenerator { subpath: "include/$(PRODUCT_NAME)" )) case "framework": return .frameworks + case "xpc": return .copyFiles(.xpcServices) case "xcconfig", "entitlements", "gpx", "lproj", "apns": return nil default: return .resources } diff --git a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 687bb9d8..ad00aecf 100644 --- a/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Tests/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ BF_182635022050 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FR_830053537293 /* Assets.xcassets */; }; BF_184447863946 = {isa = PBXBuildFile; fileRef = FR_935153865209 /* iMessageApp.app */; }; BF_186245454304 /* LocalizedStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = VG_118219888726 /* LocalizedStoryboard.storyboard */; }; + BF_190684453680 = {isa = PBXBuildFile; fileRef = FR_376569054786 /* XPC Service.xpc */; }; BF_206432481076 /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_340586388409 /* ExtensionDelegate.swift */; }; BF_211435872001 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = VG_473000061463 /* Localizable.strings */; }; BF_212221512596 /* StaticLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_470929579339 /* StaticLibrary.swift */; }; @@ -45,6 +46,8 @@ BF_284620660317 /* MyBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = FR_238161558082 /* MyBundle.bundle */; }; BF_292474606791 = {isa = PBXBuildFile; fileRef = FR_525119120469 /* Framework.framework */; }; BF_303822704662 = {isa = PBXBuildFile; fileRef = FR_472296042419 /* Framework.framework */; }; + BF_304637845091 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FR_151462316179 /* main.m */; }; + BF_308631758818 /* XPC Service.xpc in CopyFiles */ = {isa = PBXBuildFile; fileRef = FR_376569054786 /* XPC Service.xpc */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF_314868376788 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = VG_746876637628 /* Localizable.stringsdict */; }; BF_324363145049 /* Framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_472296042419 /* Framework.framework */; }; BF_331192862207 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_481575785861 /* ViewController.swift */; settings = {COMPILER_FLAGS = "-Werror"; }; }; @@ -62,35 +65,46 @@ BF_501771188469 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FR_410645050443 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF_503484983186 /* MoreUnder.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_196911129660 /* MoreUnder.swift */; }; BF_510053944904 /* Headers in Headers */ = {isa = PBXBuildFile; fileRef = FR_815403394914 /* Headers */; settings = {ATTRIBUTES = (Public, ); }; }; + BF_518775144316 /* SomeXPCService.xpc in CopyFiles */ = {isa = PBXBuildFile; fileRef = FR_229826849033 /* SomeXPCService.xpc */; }; BF_526105569599 = {isa = PBXBuildFile; fileRef = FR_437179166843 /* StaticLibrary_Swift.a */; }; + BF_535236390262 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_257516580010 /* Alamofire.framework */; }; BF_538515166673 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = VG_256263906698 /* LaunchScreen.storyboard */; }; + BF_552913093094 /* Framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FR_525119120469 /* Framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF_561304997165 /* Standalone.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_675266829517 /* Standalone.swift */; }; BF_563614389392 = {isa = PBXBuildFile; fileRef = FR_618687462494 /* iMessageExtension.appex */; }; + BF_597639300414 /* Framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_525119120469 /* Framework.framework */; }; BF_607543323797 /* StaticLibrary_ObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FR_698230898030 /* StaticLibrary_ObjC.h */; }; BF_612351978356 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = VG_264279911176 /* Interface.storyboard */; }; BF_624802436672 /* FrameworkFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_172952167809 /* FrameworkFile.swift */; }; BF_632297340262 /* StaticLibrary_ObjC.m in Sources */ = {isa = PBXBuildFile; fileRef = "FR_698230898030-1" /* StaticLibrary_ObjC.m */; }; BF_647038614509 /* iMessageApp.app in Resources */ = {isa = PBXBuildFile; fileRef = FR_935153865209 /* iMessageApp.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + BF_650026899468 = {isa = PBXBuildFile; fileRef = FR_602719163962 /* XPC_Service.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF_670499288392 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = VG_229021855709 /* Model.xcdatamodeld */; settings = {COMPILER_FLAGS = "-Werror"; }; }; BF_681504666330 = {isa = PBXBuildFile; fileRef = FR_825232110500 /* App_iOS.app */; }; BF_703054643820 /* MessagesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_310979699934 /* MessagesViewController.swift */; }; + BF_704149935229 /* Standalone.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_675266829517 /* Standalone.swift */; }; BF_721498080533 /* ResourceFolder in Resources */ = {isa = PBXBuildFile; fileRef = FR_257073931060 /* ResourceFolder */; }; + BF_725992639588 = {isa = PBXBuildFile; fileRef = FR_480982116789 /* App_macOS.app */; }; BF_732745079658 = {isa = PBXBuildFile; fileRef = FR_324671077936 /* App_watchOS.app */; }; BF_734036107922 /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = FR_183521624014 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF_742449020987 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_410645050443 /* Alamofire.framework */; }; BF_747443236192 /* App_watchOS.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = FR_324671077936 /* App_watchOS.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; BF_752022362638 /* module.modulemap in CopyFiles */ = {isa = PBXBuildFile; fileRef = FR_665156855283 /* module.modulemap */; }; BF_757906110813 = {isa = PBXBuildFile; fileRef = FR_662315837182 /* Framework.framework */; }; + BF_770495922915 /* StaticLibrary_ObjC.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_399755008402 /* StaticLibrary_ObjC.a */; }; + BF_803757127643 = {isa = PBXBuildFile; fileRef = FR_739513596122 /* XPC_ServiceProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF_807556340853 /* Empty.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FR_837374194182 /* Empty.h */; }; BF_813358525536 /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = FR_183521624014 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF_828878846239 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = VG_201160695646 /* MainInterface.storyboard */; }; BF_830383951771 /* NotificationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_304712043717 /* NotificationController.swift */; }; BF_854463933379 = {isa = PBXBuildFile; fileRef = FR_438704538506 /* Framework.framework */; }; BF_854691035877 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_257516580010 /* Alamofire.framework */; }; + BF_855988705556 /* XPC_Service.m in Sources */ = {isa = PBXBuildFile; fileRef = FR_602719163945 /* XPC_Service.m */; }; BF_860391087135 /* StandaloneAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FR_408537768279 /* StandaloneAssets.xcassets */; }; BF_863842036151 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FR_410645050443 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF_870702193513 /* iMessageExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = FR_618687462494 /* iMessageExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; BF_892119987440 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_854336462818 /* AppDelegate.swift */; settings = {COMPILER_FLAGS = "-Werror"; }; }; + BF_897881229855 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FR_257516580010 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF_898051828670 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_752394658615 /* Alamofire.framework */; }; BF_901390118565 /* FrameworkFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_172952167809 /* FrameworkFile.swift */; }; BF_905038616071 /* Framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FR_472296042419 /* Framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -121,6 +135,13 @@ remoteGlobalIDString = NT_825232110500; remoteInfo = App_iOS; }; + CIP_23558050412 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = P_8448771205358 /* Project object */; + proxyType = 1; + remoteGlobalIDString = NT_525119120469; + remoteInfo = Framework_macOS; + }; CIP_28856087625 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = P_8448771205358 /* Project object */; @@ -142,6 +163,13 @@ remoteGlobalIDString = NT_399755008402; remoteInfo = StaticLibrary_ObjC; }; + CIP_62903878492 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = P_8448771205358 /* Project object */; + proxyType = 1; + remoteGlobalIDString = NT_399755008402; + remoteInfo = StaticLibrary_ObjC; + }; CIP_66745555235 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = P_8448771205358 /* Project object */; @@ -163,6 +191,13 @@ remoteGlobalIDString = NT_399755008402; remoteInfo = StaticLibrary_ObjC; }; + CIP_74378499241 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = P_8448771205358 /* Project object */; + proxyType = 1; + remoteGlobalIDString = NT_376569054786; + remoteInfo = "XPC Service"; + }; CIP_74741847386 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = P_8448771205358 /* Project object */; @@ -256,6 +291,18 @@ name = "Embed App Extensions"; runOnlyForDeploymentPostprocessing = 0; }; + CFBP_4930089528 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + BF_552913093094 /* Framework.framework in Embed Frameworks */, + BF_897881229855 /* Alamofire.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; CFBP_5460766702 /* Embed App Extensions */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -289,16 +336,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + CFBP_8368933518 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; + dstSubfolderSpec = 16; + files = ( + BF_308631758818 /* XPC Service.xpc in CopyFiles */, + BF_518775144316 /* SomeXPCService.xpc in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ FR_118219888726 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LocalizedStoryboard.storyboard; sourceTree = ""; }; FR_123503999387 /* App_iOS_UITests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = App_iOS_UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; FR_145531354566 /* TestProjectUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProjectUITests.swift; sourceTree = ""; }; + FR_151462316179 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; FR_172952167809 /* FrameworkFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrameworkFile.swift; sourceTree = ""; }; FR_183521624014 /* MyFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFramework.h; sourceTree = ""; }; FR_196911129660 /* MoreUnder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreUnder.swift; sourceTree = ""; }; FR_201160695646 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + FR_229826849033 /* SomeXPCService.xpc */ = {isa = PBXFileReference; path = SomeXPCService.xpc; sourceTree = ""; }; FR_232605427418 /* Mintfile */ = {isa = PBXFileReference; path = Mintfile; sourceTree = ""; }; FR_238161558082 /* MyBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MyBundle.bundle; sourceTree = ""; }; FR_247808626608 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -313,6 +373,7 @@ FR_324671077936 /* App_watchOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App_watchOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; FR_340586388409 /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; }; FR_363921640403 /* InterfaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceController.swift; sourceTree = ""; }; + FR_376569054786 /* XPC Service.xpc */ = {isa = PBXFileReference; includeInIndex = 0; path = "XPC Service.xpc"; sourceTree = BUILT_PRODUCTS_DIR; }; FR_377082606829 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; FR_399755008402 /* StaticLibrary_ObjC.a */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = archive.ar; path = StaticLibrary_ObjC.a; sourceTree = BUILT_PRODUCTS_DIR; }; FR_408537768279 /* StandaloneAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = StandaloneAssets.xcassets; sourceTree = ""; }; @@ -325,6 +386,7 @@ FR_472296042419 /* Framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FR_473000061463 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; FR_479281060337 /* Folder */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Folder; sourceTree = SOURCE_ROOT; }; + FR_480982116789 /* App_macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App_macOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; FR_481575785861 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; FR_500792082643 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/LocalizedStoryboard.strings; sourceTree = ""; }; FR_505327409380 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -334,6 +396,8 @@ FR_570918052822 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; FR_587738154368 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; FR_602633703434 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; + FR_602719163945 /* XPC_Service.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPC_Service.m; sourceTree = ""; }; + FR_602719163962 /* XPC_Service.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPC_Service.h; sourceTree = ""; }; FR_609193904586 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; FR_618687462494 /* iMessageExtension.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = iMessageExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; FR_635802719871 /* base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = base.xcconfig; sourceTree = ""; }; @@ -348,6 +412,7 @@ "FR_698230898030-1" /* StaticLibrary_ObjC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StaticLibrary_ObjC.m; sourceTree = ""; }; FR_722239415598 /* TestProjectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProjectTests.swift; sourceTree = ""; }; FR_725187762757 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FR_739513596122 /* XPC_ServiceProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPC_ServiceProtocol.h; sourceTree = ""; }; FR_746876637628 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.stringsdict; sourceTree = ""; }; FR_748548478992 /* PushNotificationPayload.apns */ = {isa = PBXFileReference; lastKnownFileType = text; path = PushNotificationPayload.apns; sourceTree = ""; }; FR_752394658615 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; @@ -355,6 +420,7 @@ FR_775316160345 /* SomeFile */ = {isa = PBXFileReference; path = SomeFile; sourceTree = ""; }; FR_783122899910 /* App_iOS_Tests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = App_iOS_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; FR_796781152159 /* Model 2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 2.xcdatamodel"; sourceTree = ""; }; + FR_803921963291 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FR_815403394914 /* Headers */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Headers; sourceTree = SOURCE_ROOT; }; FR_825232110500 /* App_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = App_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; FR_830053537293 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -391,6 +457,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + FBP_48098211678 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BF_535236390262 /* Alamofire.framework in Frameworks */, + BF_597639300414 /* Framework.framework in Frameworks */, + BF_770495922915 /* StaticLibrary_ObjC.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FBP_50702349225 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -512,6 +588,18 @@ path = App_watchOS; sourceTree = ""; }; + G_3765690547864 /* XPC Service */ = { + isa = PBXGroup; + children = ( + FR_803921963291 /* Info.plist */, + FR_151462316179 /* main.m */, + FR_602719163962 /* XPC_Service.h */, + FR_602719163945 /* XPC_Service.m */, + FR_739513596122 /* XPC_ServiceProtocol.h */, + ); + path = "XPC Service"; + sourceTree = ""; + }; G_3997550084026 /* StaticLibrary_ObjC */ = { isa = PBXGroup; children = ( @@ -540,6 +628,14 @@ path = Framework; sourceTree = ""; }; + G_4793969390202 /* Vendor */ = { + isa = PBXGroup; + children = ( + FR_229826849033 /* SomeXPCService.xpc */, + ); + path = Vendor; + sourceTree = ""; + }; G_5070234922517 /* App_watchOS Extension */ = { isa = PBXGroup; children = ( @@ -658,6 +754,8 @@ G_6651250437419 /* StandaloneFiles */, G_3997550084026 /* StaticLibrary_ObjC */, G_4371791668439 /* StaticLibrary_Swift */, + G_4793969390202 /* Vendor */, + G_3765690547864 /* XPC Service */, FR_479281060337 /* Folder */, FR_815403394914 /* Headers */, FR_232605427418 /* Mintfile */, @@ -677,6 +775,7 @@ FR_783122899910 /* App_iOS_Tests.xctest */, FR_123503999387 /* App_iOS_UITests.xctest */, FR_825232110500 /* App_iOS.app */, + FR_480982116789 /* App_macOS.app */, FR_507023492251 /* App_watchOS Extension.appex */, FR_324671077936 /* App_watchOS.app */, FR_525119120469 /* Framework.framework */, @@ -687,6 +786,7 @@ FR_618687462494 /* iMessageExtension.appex */, FR_399755008402 /* StaticLibrary_ObjC.a */, FR_437179166843 /* StaticLibrary_Swift.a */, + FR_376569054786 /* XPC Service.xpc */, ); name = Products; sourceTree = ""; @@ -794,6 +894,21 @@ productReference = FR_324671077936 /* App_watchOS.app */; productType = "com.apple.product-type.application.watchapp2"; }; + NT_376569054786 /* XPC Service */ = { + isa = PBXNativeTarget; + buildConfigurationList = CL_376569054786 /* Build configuration list for PBXNativeTarget "XPC Service" */; + buildPhases = ( + SBP_37656905478 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "XPC Service"; + productName = "XPC Service"; + productReference = FR_376569054786 /* XPC Service.xpc */; + productType = "com.apple.product-type.xpc-service"; + }; NT_399755008402 /* StaticLibrary_ObjC */ = { isa = PBXNativeTarget; buildConfigurationList = CL_399755008402 /* Build configuration list for PBXNativeTarget "StaticLibrary_ObjC" */; @@ -864,6 +979,27 @@ productReference = FR_472296042419 /* Framework.framework */; productType = "com.apple.product-type.framework"; }; + NT_480982116789 /* App_macOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = CL_480982116789 /* Build configuration list for PBXNativeTarget "App_macOS" */; + buildPhases = ( + SBP_48098211678 /* Sources */, + CFBP_8368933518 /* CopyFiles */, + FBP_48098211678 /* Frameworks */, + CFBP_4930089528 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + TD_235580504123 /* PBXTargetDependency */, + TD_629038784927 /* PBXTargetDependency */, + TD_743784992411 /* PBXTargetDependency */, + ); + name = App_macOS; + productName = App_macOS; + productReference = FR_480982116789 /* App_macOS.app */; + productType = "com.apple.product-type.application"; + }; NT_507023492251 /* App_watchOS Extension */ = { isa = PBXNativeTarget; buildConfigurationList = CL_507023492251 /* Build configuration list for PBXNativeTarget "App_watchOS Extension" */; @@ -1011,6 +1147,9 @@ NT_123503999387 = { TestTargetID = NT_825232110500; }; + NT_480982116789 = { + ProvisioningStyle = Automatic; + }; NT_825232110500 = { ProvisioningStyle = Automatic; }; @@ -1031,6 +1170,7 @@ NT_825232110500 /* App_iOS */, NT_783122899910 /* App_iOS_Tests */, NT_123503999387 /* App_iOS_UITests */, + NT_480982116789 /* App_macOS */, NT_324671077936 /* App_watchOS */, NT_507023492251 /* App_watchOS Extension */, NT_472296042419 /* Framework_iOS */, @@ -1041,6 +1181,7 @@ NT_399755008402 /* StaticLibrary_ObjC */, NT_437179166843 /* StaticLibrary_Swift */, AT_445731917037 /* SuperTarget */, + NT_376569054786 /* XPC Service */, NT_935153865209 /* iMessageApp */, NT_618687462494 /* iMessageExtension */, ); @@ -1266,6 +1407,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + SBP_37656905478 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BF_855988705556 /* XPC_Service.m in Sources */, + BF_304637845091 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; SBP_39975500840 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1305,6 +1455,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + SBP_48098211678 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BF_704149935229 /* Standalone.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; SBP_50702349225 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1384,6 +1542,11 @@ target = NT_825232110500 /* App_iOS */; targetProxy = CIP_20801090045 /* PBXContainerItemProxy */; }; + TD_235580504123 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = NT_525119120469 /* Framework_macOS */; + targetProxy = CIP_23558050412 /* PBXContainerItemProxy */; + }; TD_288560876254 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = NT_935153865209 /* iMessageApp */; @@ -1399,6 +1562,11 @@ target = NT_399755008402 /* StaticLibrary_ObjC */; targetProxy = CIP_33710394010 /* PBXContainerItemProxy */; }; + TD_629038784927 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = NT_399755008402 /* StaticLibrary_ObjC */; + targetProxy = CIP_62903878492 /* PBXContainerItemProxy */; + }; TD_667455552356 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = NT_399755008402 /* StaticLibrary_ObjC */; @@ -1414,6 +1582,11 @@ target = NT_399755008402 /* StaticLibrary_ObjC */; targetProxy = CIP_72152212817 /* PBXContainerItemProxy */; }; + TD_743784992411 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = NT_376569054786 /* XPC Service */; + targetProxy = CIP_74378499241 /* PBXContainerItemProxy */; + }; TD_747418473860 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = NT_472296042419 /* Framework_iOS */; @@ -1639,6 +1812,17 @@ }; name = "Test Release"; }; + BC_213267780961 /* Production Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "XPC Service/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.XPCService; + SDKROOT = macosx; + }; + name = "Production Debug"; + }; BC_240587562436 /* Test Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1821,6 +2005,27 @@ }; name = "Staging Release"; }; + BC_280651168996 /* Production Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = Vendor/SomeXPCService.xpc/Contents/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS"; + SDKROOT = macosx; + }; + name = "Production Debug"; + }; BC_282993554784 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2457,6 +2662,27 @@ }; name = "Staging Debug"; }; + BC_563702409464 /* Staging Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = Vendor/SomeXPCService.xpc/Contents/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS"; + SDKROOT = macosx; + }; + name = "Staging Debug"; + }; BC_568886047790 /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2601,6 +2827,17 @@ }; name = "Test Release"; }; + BC_609604761299 /* Staging Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "XPC Service/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.XPCService; + SDKROOT = macosx; + }; + name = "Staging Release"; + }; BC_609753632568 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2644,6 +2881,27 @@ }; name = "Production Debug"; }; + BC_627109222781 /* Production Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = Vendor/SomeXPCService.xpc/Contents/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS"; + SDKROOT = macosx; + }; + name = "Production Release"; + }; BC_629891546665 /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2723,6 +2981,17 @@ }; name = "Test Debug"; }; + BC_667304541586 /* Test Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "XPC Service/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.XPCService; + SDKROOT = macosx; + }; + name = "Test Debug"; + }; BC_669628489596 /* Staging Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2828,6 +3097,27 @@ }; name = "Production Debug"; }; + BC_707904794064 /* Test Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = Vendor/SomeXPCService.xpc/Contents/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS"; + SDKROOT = macosx; + }; + name = "Test Release"; + }; BC_709947688544 /* Production Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3171,6 +3461,17 @@ }; name = "Production Debug"; }; + BC_823301630526 /* Test Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "XPC Service/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.XPCService; + SDKROOT = macosx; + }; + name = "Test Release"; + }; BC_823840129404 /* Test Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3188,6 +3489,17 @@ }; name = "Test Debug"; }; + BC_825545455794 /* Staging Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "XPC Service/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.XPCService; + SDKROOT = macosx; + }; + name = "Staging Debug"; + }; BC_831819337335 /* Production Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3320,6 +3632,27 @@ }; name = "Test Debug"; }; + BC_866352849045 /* Test Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = Vendor/SomeXPCService.xpc/Contents/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS"; + SDKROOT = macosx; + }; + name = "Test Debug"; + }; BC_879000441352 /* Staging Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3345,6 +3678,38 @@ }; name = "Staging Debug"; }; + BC_906683798476 /* Production Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "XPC Service/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.project.XPCService; + SDKROOT = macosx; + }; + name = "Production Release"; + }; + BC_914036878229 /* Staging Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = Vendor/SomeXPCService.xpc/Contents/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.project.App-macOS"; + SDKROOT = macosx; + }; + name = "Staging Release"; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -3374,6 +3739,19 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = ""; }; + CL_376569054786 /* Build configuration list for PBXNativeTarget "XPC Service" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BC_213267780961 /* Production Debug */, + BC_906683798476 /* Production Release */, + BC_825545455794 /* Staging Debug */, + BC_609604761299 /* Staging Release */, + BC_667304541586 /* Test Debug */, + BC_823301630526 /* Test Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = ""; + }; CL_399755008402 /* Build configuration list for PBXNativeTarget "StaticLibrary_ObjC" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3452,6 +3830,19 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = ""; }; + CL_480982116789 /* Build configuration list for PBXNativeTarget "App_macOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BC_280651168996 /* Production Debug */, + BC_627109222781 /* Production Release */, + BC_563702409464 /* Staging Debug */, + BC_914036878229 /* Staging Release */, + BC_866352849045 /* Test Debug */, + BC_707904794064 /* Test Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = ""; + }; CL_507023492251 /* Build configuration list for PBXNativeTarget "App_watchOS Extension" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/Info.plist b/Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/Info.plist new file mode 100644 index 00000000..5aa0e9d3 --- /dev/null +++ b/Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/Info.plist @@ -0,0 +1,49 @@ + + + + + BuildMachineOSBuild + 17G65 + CFBundleDevelopmentRegion + en + CFBundleDisplayName + XPC Service + CFBundleExecutable + XPC Service + CFBundleIdentifier + com.project.XPCService + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XPC Service + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 9F2000 + DTPlatformVersion + GM + DTSDKBuild + 17E189 + DTSDKName + macosx10.13 + DTXcode + 0941 + DTXcodeBuild + 9F2000 + XPCService + + ServiceType + Application + + + diff --git a/Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/MacOS/XPC Service b/Tests/Fixtures/TestProject/Vendor/SomeXPCService.xpc/Contents/MacOS/XPC Service new file mode 100755 index 0000000000000000000000000000000000000000..05fd834eed757a2eb3e2246de56806ec51b01d5f GIT binary patch literal 14800 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 c`A^UwZ`!k_XU_mT&-!rT^Yk&pl + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Tests/Fixtures/TestProject/XPC Service/Info.plist b/Tests/Fixtures/TestProject/XPC Service/Info.plist new file mode 100644 index 00000000..78042791 --- /dev/null +++ b/Tests/Fixtures/TestProject/XPC Service/Info.plist @@ -0,0 +1,29 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + XPC Service + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + XPCService + + ServiceType + Application + + + diff --git a/Tests/Fixtures/TestProject/XPC Service/XPC_Service.h b/Tests/Fixtures/TestProject/XPC Service/XPC_Service.h new file mode 100644 index 00000000..6cd6ab51 --- /dev/null +++ b/Tests/Fixtures/TestProject/XPC Service/XPC_Service.h @@ -0,0 +1,5 @@ +#import +#import "XPC_ServiceProtocol.h" + +@interface XPC_Service : NSObject +@end diff --git a/Tests/Fixtures/TestProject/XPC Service/XPC_Service.m b/Tests/Fixtures/TestProject/XPC Service/XPC_Service.m new file mode 100644 index 00000000..1729f258 --- /dev/null +++ b/Tests/Fixtures/TestProject/XPC Service/XPC_Service.m @@ -0,0 +1,10 @@ +#import "XPC_Service.h" + +@implementation XPC_Service + +- (void)upperCaseString:(NSString *)aString withReply:(void (^)(NSString *))reply { + NSString *response = [aString uppercaseString]; + reply(response); +} + +@end diff --git a/Tests/Fixtures/TestProject/XPC Service/XPC_ServiceProtocol.h b/Tests/Fixtures/TestProject/XPC Service/XPC_ServiceProtocol.h new file mode 100644 index 00000000..f878b8d2 --- /dev/null +++ b/Tests/Fixtures/TestProject/XPC Service/XPC_ServiceProtocol.h @@ -0,0 +1,9 @@ +#import + +// The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service. +@protocol XPC_ServiceProtocol + +// Replace the API of this protocol with an API appropriate to the service you are vending. +- (void)upperCaseString:(NSString *)aString withReply:(void (^)(NSString *))reply; + +@end diff --git a/Tests/Fixtures/TestProject/XPC Service/main.m b/Tests/Fixtures/TestProject/XPC Service/main.m new file mode 100644 index 00000000..1df7c26e --- /dev/null +++ b/Tests/Fixtures/TestProject/XPC Service/main.m @@ -0,0 +1,41 @@ +#import +#import "XPC_Service.h" + +@interface ServiceDelegate : NSObject +@end + +@implementation ServiceDelegate + +- (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection { + // This method is where the NSXPCListener configures, accepts, and resumes a new incoming NSXPCConnection. + + // Configure the connection. + // First, set the interface that the exported object implements. + newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(XPC_ServiceProtocol)]; + + // Next, set the object that the connection exports. All messages sent on the connection to this service will be sent to the exported object to handle. The connection retains the exported object. + XPC_Service *exportedObject = [XPC_Service new]; + newConnection.exportedObject = exportedObject; + + // Resuming the connection allows the system to deliver more incoming messages. + [newConnection resume]; + + // Returning YES from this method tells the system that you have accepted this connection. If you want to reject the connection for some reason, call -invalidate on the connection and return NO. + return YES; +} + +@end + +int main(int argc, const char *argv[]) +{ + // Create the delegate for the service. + ServiceDelegate *delegate = [ServiceDelegate new]; + + // Set up the one NSXPCListener for this service. It will handle all incoming connections. + NSXPCListener *listener = [NSXPCListener serviceListener]; + listener.delegate = delegate; + + // Resuming the serviceListener starts this service. This method does not return. + [listener resume]; + return 0; +} diff --git a/Tests/Fixtures/TestProject/project.yml b/Tests/Fixtures/TestProject/project.yml index b920e1ce..c95cf784 100644 --- a/Tests/Fixtures/TestProject/project.yml +++ b/Tests/Fixtures/TestProject/project.yml @@ -22,6 +22,19 @@ targets: legacy: toolPath: /usr/bin/true passSettings: true + + App_macOS: + type: application + platform: macOS + attributes: + ProvisioningStyle: Automatic + sources: + - path: StandaloneFiles/Standalone.swift + - path: Vendor/SomeXPCService.xpc + dependencies: + - target: Framework_macOS + - target: XPC Service + App_iOS: type: application platform: iOS @@ -154,6 +167,13 @@ targets: sources: App_iOS_UITests dependencies: - target: App_iOS + + XPC Service: + type: xpc-service + platform: macOS + sources: + - path: XPC Service + schemes: Framework: build: