diff --git a/TestApp/TestApp-Info.plist b/TestApp/TestApp-Info.plist index 1c60d6c..fc5dcde 100644 --- a/TestApp/TestApp-Info.plist +++ b/TestApp/TestApp-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.mustacheware.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/TestService/TestService-Info.plist b/TestService/TestService-Info.plist index eb99bb4..8a907a5 100644 --- a/TestService/TestService-Info.plist +++ b/TestService/TestService-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - ${EXECUTABLE_NAME} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/XPCKit.xcodeproj/project.pbxproj b/XPCKit.xcodeproj/project.pbxproj index 7bae0f7..1619975 100644 --- a/XPCKit.xcodeproj/project.pbxproj +++ b/XPCKit.xcodeproj/project.pbxproj @@ -13,15 +13,11 @@ 1E5F84AB13E10DB700234F31 /* XPCService.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E5F84A713E10DB700234F31 /* XPCService.m */; }; 1E835CB113DF748000338391 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0B613DE79D200D5AEC3 /* Foundation.framework */; }; 1E835CB313DF74BF00338391 /* XPCKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */; }; - 1E835CB513DF74C900338391 /* XPCKit.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */; }; + 1E835CB513DF74C900338391 /* XPCKit.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1EB022A5141D9F3700BCC1FB /* NSDate+XPCParse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EB022A3141D9F3700BCC1FB /* NSDate+XPCParse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1EB022A6141D9F3700BCC1FB /* NSDate+XPCParse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EB022A3141D9F3700BCC1FB /* NSDate+XPCParse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1EB022A7141D9F3700BCC1FB /* NSDate+XPCParse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EB022A4141D9F3700BCC1FB /* NSDate+XPCParse.m */; }; 1EB022A8141D9F3700BCC1FB /* NSDate+XPCParse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EB022A4141D9F3700BCC1FB /* NSDate+XPCParse.m */; }; - 1EEDD03E13DD485400D5AEC3 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD03D13DD485400D5AEC3 /* SenTestingKit.framework */; }; - 1EEDD04813DD485400D5AEC3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1EEDD04613DD485400D5AEC3 /* InfoPlist.strings */; }; - 1EEDD04A13DD485400D5AEC3 /* XPCKitTests.h in Resources */ = {isa = PBXBuildFile; fileRef = 1EEDD04913DD485400D5AEC3 /* XPCKitTests.h */; }; - 1EEDD04C13DD485400D5AEC3 /* XPCKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EEDD04B13DD485400D5AEC3 /* XPCKitTests.m */; }; 1EEDD06113DD48BB00D5AEC3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1EEDD05F13DD48BB00D5AEC3 /* InfoPlist.strings */; }; 1EEDD06313DD48BB00D5AEC3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EEDD06213DD48BB00D5AEC3 /* main.m */; }; 1EEDD06713DD48BB00D5AEC3 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 1EEDD06513DD48BB00D5AEC3 /* Credits.rtf */; }; @@ -29,7 +25,7 @@ 1EEDD06D13DD48BC00D5AEC3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1EEDD06B13DD48BC00D5AEC3 /* MainMenu.xib */; }; 1EEDD07B13DD48D800D5AEC3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1EEDD07913DD48D800D5AEC3 /* InfoPlist.strings */; }; 1EEDD07E13DD48D800D5AEC3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EEDD07D13DD48D800D5AEC3 /* main.m */; }; - 1EEDD08513DD498900D5AEC3 /* com.mustacheware.TestService.xpc in Copy Services */ = {isa = PBXBuildFile; fileRef = 1EEDD07513DD48D800D5AEC3 /* com.mustacheware.TestService.xpc */; }; + 1EEDD08513DD498900D5AEC3 /* com.mustacheware.TestService.xpc in Copy Services */ = {isa = PBXBuildFile; fileRef = 1EEDD07513DD48D800D5AEC3 /* com.mustacheware.TestService.xpc */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1EEDD08813DD508C00D5AEC3 /* XPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEDD08613DD508C00D5AEC3 /* XPCConnection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1EEDD08913DD508C00D5AEC3 /* XPCConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EEDD08713DD508C00D5AEC3 /* XPCConnection.m */; }; 1EEDD08C13DDC34800D5AEC3 /* NSDictionary+XPCParse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEDD08A13DDC34800D5AEC3 /* NSDictionary+XPCParse.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -59,7 +55,6 @@ 1EEDD0E913DEA07700D5AEC3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0B613DE79D200D5AEC3 /* Foundation.framework */; }; 1EEDD0EA13DEA08E00D5AEC3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0B613DE79D200D5AEC3 /* Foundation.framework */; }; 1EEDD0EC13DEA0A400D5AEC3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0EB13DEA0A400D5AEC3 /* Cocoa.framework */; }; - 1EEDD0EE13DEB02000D5AEC3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0ED13DEB01F00D5AEC3 /* Foundation.framework */; }; 1EEDD0F113DEB97000D5AEC3 /* XPCUUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEDD0EF13DEB96F00D5AEC3 /* XPCUUID.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1EEDD0F213DEB97000D5AEC3 /* XPCUUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEDD0EF13DEB96F00D5AEC3 /* XPCUUID.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1EEDD0F313DEB97000D5AEC3 /* XPCUUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EEDD0F013DEB97000D5AEC3 /* XPCUUID.m */; }; @@ -94,17 +89,11 @@ 30DF8D5814EBC03900E5E876 /* XPCMessage+XPCKitInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 30DF8D5414EBC03900E5E876 /* XPCMessage+XPCKitInternal.m */; }; 30E9DAFF14ED12480070A6A4 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30E9DAFE14ED12480070A6A4 /* Security.framework */; }; 30E9DB0114ED139F0070A6A4 /* XPCKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */; }; - 30E9DB0214ED13DA0070A6A4 /* XPCKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */; }; + 9FFC64E91CE0FDE8008D977A /* XPCKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FFC64E81CE0FDE8008D977A /* XPCKitTests.m */; }; + 9FFC64EB1CE0FDE8008D977A /* XPCKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1EEDD04013DD485400D5AEC3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1EEDD01F13DD485400D5AEC3 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 1EEDD02713DD485400D5AEC3; - remoteInfo = XPCKit; - }; 1EEDD08213DD497400D5AEC3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1EEDD01F13DD485400D5AEC3 /* Project object */; @@ -126,6 +115,13 @@ remoteGlobalIDString = 1EEDD02713DD485400D5AEC3; remoteInfo = XPCKit; }; + 9FFC64EC1CE0FDE8008D977A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1EEDD01F13DD485400D5AEC3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1EEDD0CE13DE9FAB00D5AEC3; + remoteInfo = XPCKit; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -161,12 +157,7 @@ 1EEDD02813DD485400D5AEC3 /* libXPCKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libXPCKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; 1EEDD03313DD485400D5AEC3 /* XPCKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XPCKit-Prefix.pch"; sourceTree = ""; }; 1EEDD03413DD485400D5AEC3 /* XPCKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCKit.h; sourceTree = ""; }; - 1EEDD03C13DD485400D5AEC3 /* XPCKitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XPCKitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 1EEDD03D13DD485400D5AEC3 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; - 1EEDD04513DD485400D5AEC3 /* XPCKitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "XPCKitTests-Info.plist"; sourceTree = ""; }; - 1EEDD04713DD485400D5AEC3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 1EEDD04913DD485400D5AEC3 /* XPCKitTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCKitTests.h; sourceTree = ""; }; - 1EEDD04B13DD485400D5AEC3 /* XPCKitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCKitTests.m; sourceTree = ""; }; 1EEDD05913DD48BB00D5AEC3 /* TestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1EEDD05E13DD48BB00D5AEC3 /* TestApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestApp-Info.plist"; sourceTree = ""; }; 1EEDD06013DD48BB00D5AEC3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -219,6 +210,9 @@ 30DF8D5314EBC03900E5E876 /* XPCMessage+XPCKitInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "XPCMessage+XPCKitInternal.h"; sourceTree = ""; }; 30DF8D5414EBC03900E5E876 /* XPCMessage+XPCKitInternal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "XPCMessage+XPCKitInternal.m"; sourceTree = ""; }; 30E9DAFE14ED12480070A6A4 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 9FFC64E61CE0FDE8008D977A /* XPCKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XPCKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 9FFC64E81CE0FDE8008D977A /* XPCKitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCKitTests.m; sourceTree = ""; }; + 9FFC64EA1CE0FDE8008D977A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -230,16 +224,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 1EEDD03813DD485400D5AEC3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 30E9DB0214ED13DA0070A6A4 /* XPCKit.framework in Frameworks */, - 1EEDD0EE13DEB02000D5AEC3 /* Foundation.framework in Frameworks */, - 1EEDD03E13DD485400D5AEC3 /* SenTestingKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 1EEDD05613DD48BB00D5AEC3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -268,6 +252,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9FFC64E31CE0FDE8008D977A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9FFC64EB1CE0FDE8008D977A /* XPCKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -275,9 +267,9 @@ isa = PBXGroup; children = ( 1EEDD03113DD485400D5AEC3 /* XPCKit */, - 1EEDD04313DD485400D5AEC3 /* XPCKitTests */, 1EEDD05C13DD48BB00D5AEC3 /* TestApp */, 1EEDD07613DD48D800D5AEC3 /* TestService */, + 9FFC64E71CE0FDE8008D977A /* XPCKitTests */, 1EEDD02A13DD485400D5AEC3 /* Frameworks */, 1EEDD02913DD485400D5AEC3 /* Products */, ); @@ -287,10 +279,10 @@ isa = PBXGroup; children = ( 1EEDD02813DD485400D5AEC3 /* libXPCKit.a */, - 1EEDD03C13DD485400D5AEC3 /* XPCKitTests.octest */, 1EEDD05913DD48BB00D5AEC3 /* TestApp.app */, 1EEDD07513DD48D800D5AEC3 /* com.mustacheware.TestService.xpc */, 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */, + 9FFC64E61CE0FDE8008D977A /* XPCKitTests.xctest */, ); name = Products; sourceTree = ""; @@ -342,25 +334,6 @@ name = "Supporting Files"; sourceTree = ""; }; - 1EEDD04313DD485400D5AEC3 /* XPCKitTests */ = { - isa = PBXGroup; - children = ( - 1EEDD04913DD485400D5AEC3 /* XPCKitTests.h */, - 1EEDD04B13DD485400D5AEC3 /* XPCKitTests.m */, - 1EEDD04413DD485400D5AEC3 /* Supporting Files */, - ); - path = XPCKitTests; - sourceTree = ""; - }; - 1EEDD04413DD485400D5AEC3 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 1EEDD04513DD485400D5AEC3 /* XPCKitTests-Info.plist */, - 1EEDD04613DD485400D5AEC3 /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; 1EEDD05C13DD48BB00D5AEC3 /* TestApp */ = { isa = PBXGroup; children = ( @@ -438,6 +411,15 @@ path = ThirdParty; sourceTree = ""; }; + 9FFC64E71CE0FDE8008D977A /* XPCKitTests */ = { + isa = PBXGroup; + children = ( + 9FFC64E81CE0FDE8008D977A /* XPCKitTests.m */, + 9FFC64EA1CE0FDE8008D977A /* Info.plist */, + ); + path = XPCKitTests; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -507,25 +489,6 @@ productReference = 1EEDD02813DD485400D5AEC3 /* libXPCKit.a */; productType = "com.apple.product-type.library.static"; }; - 1EEDD03B13DD485400D5AEC3 /* XPCKitTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1EEDD05213DD485400D5AEC3 /* Build configuration list for PBXNativeTarget "XPCKitTests" */; - buildPhases = ( - 1EEDD03713DD485400D5AEC3 /* Sources */, - 1EEDD03813DD485400D5AEC3 /* Frameworks */, - 1EEDD03913DD485400D5AEC3 /* Resources */, - 1EEDD03A13DD485400D5AEC3 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 1EEDD04113DD485400D5AEC3 /* PBXTargetDependency */, - ); - name = XPCKitTests; - productName = XPCKitTests; - productReference = 1EEDD03C13DD485400D5AEC3 /* XPCKitTests.octest */; - productType = "com.apple.product-type.bundle"; - }; 1EEDD05813DD48BB00D5AEC3 /* TestApp */ = { isa = PBXNativeTarget; buildConfigurationList = 1EEDD06E13DD48BC00D5AEC3 /* Build configuration list for PBXNativeTarget "TestApp" */; @@ -583,14 +546,38 @@ productReference = 1EEDD0CF13DE9FAB00D5AEC3 /* XPCKit.framework */; productType = "com.apple.product-type.framework"; }; + 9FFC64E51CE0FDE8008D977A /* XPCKitTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9FFC64EE1CE0FDE8008D977A /* Build configuration list for PBXNativeTarget "XPCKitTests" */; + buildPhases = ( + 9FFC64E21CE0FDE8008D977A /* Sources */, + 9FFC64E31CE0FDE8008D977A /* Frameworks */, + 9FFC64E41CE0FDE8008D977A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 9FFC64ED1CE0FDE8008D977A /* PBXTargetDependency */, + ); + name = XPCKitTests; + productName = XPCKitTests; + productReference = 9FFC64E61CE0FDE8008D977A /* XPCKitTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 1EEDD01F13DD485400D5AEC3 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastTestingUpgradeCheck = 0730; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = Mustacheware; + TargetAttributes = { + 9FFC64E51CE0FDE8008D977A = { + CreatedOnToolsVersion = 7.3; + }; + }; }; buildConfigurationList = 1EEDD02213DD485400D5AEC3 /* Build configuration list for PBXProject "XPCKit" */; compatibilityVersion = "Xcode 3.2"; @@ -608,21 +595,12 @@ 1EEDD02713DD485400D5AEC3 /* libXPCKit */, 1EEDD05813DD48BB00D5AEC3 /* TestApp */, 1EEDD07413DD48D800D5AEC3 /* TestService */, - 1EEDD03B13DD485400D5AEC3 /* XPCKitTests */, + 9FFC64E51CE0FDE8008D977A /* XPCKitTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 1EEDD03913DD485400D5AEC3 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1EEDD04813DD485400D5AEC3 /* InfoPlist.strings in Resources */, - 1EEDD04A13DD485400D5AEC3 /* XPCKitTests.h in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 1EEDD05713DD48BB00D5AEC3 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -651,23 +629,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1EEDD03A13DD485400D5AEC3 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; + 9FFC64E41CE0FDE8008D977A /* Resources */ = { + isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( - ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; -/* End PBXShellScriptBuildPhase section */ +/* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 1EEDD02413DD485400D5AEC3 /* Sources */ = { @@ -691,14 +660,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 1EEDD03713DD485400D5AEC3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1EEDD04C13DD485400D5AEC3 /* XPCKitTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 1EEDD05513DD48BB00D5AEC3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -739,14 +700,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9FFC64E21CE0FDE8008D977A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9FFC64E91CE0FDE8008D977A /* XPCKitTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 1EEDD04113DD485400D5AEC3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 1EEDD02713DD485400D5AEC3 /* libXPCKit */; - targetProxy = 1EEDD04013DD485400D5AEC3 /* PBXContainerItemProxy */; - }; 1EEDD08313DD497400D5AEC3 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 1EEDD07413DD48D800D5AEC3 /* TestService */; @@ -762,17 +726,14 @@ target = 1EEDD02713DD485400D5AEC3 /* libXPCKit */; targetProxy = 1EEDD0B813DE7A0D00D5AEC3 /* PBXContainerItemProxy */; }; + 9FFC64ED1CE0FDE8008D977A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1EEDD0CE13DE9FAB00D5AEC3 /* XPCKit */; + targetProxy = 9FFC64EC1CE0FDE8008D977A /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 1EEDD04613DD485400D5AEC3 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 1EEDD04713DD485400D5AEC3 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; 1EEDD05F13DD48BB00D5AEC3 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( @@ -820,17 +781,20 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -846,6 +810,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; @@ -854,17 +819,19 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; @@ -881,6 +848,7 @@ 1EEDD05013DD485400D5AEC3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "XPCKit/XPCKit-Prefix.pch"; PRODUCT_NAME = XPCKit; @@ -888,45 +856,12 @@ name = Debug; }; 1EEDD05113DD485400D5AEC3 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "XPCKit/XPCKit-Prefix.pch"; - PRODUCT_NAME = XPCKit; - }; - name = Release; - }; - 1EEDD05313DD485400D5AEC3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "XPCKit/XPCKit-Prefix.pch"; - INFOPLIST_FILE = "XPCKitTests/XPCKitTests-Info.plist"; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = octest; - }; - name = Debug; - }; - 1EEDD05413DD485400D5AEC3 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "XPCKit/XPCKit-Prefix.pch"; - INFOPLIST_FILE = "XPCKitTests/XPCKitTests-Info.plist"; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = octest; + PRODUCT_NAME = XPCKit; }; name = Release; }; @@ -941,6 +876,7 @@ INFOPLIST_FILE = "TestApp/TestApp-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks /Library/Frameworks"; OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mustacheware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -957,6 +893,7 @@ INFOPLIST_FILE = "TestApp/TestApp-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks /Library/Frameworks"; OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mustacheware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -977,6 +914,7 @@ "-ObjC", "-all_load", ); + PRODUCT_BUNDLE_IDENTIFIER = "${EXECUTABLE_NAME}"; PRODUCT_NAME = "com.mustacheware.$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = xpc; @@ -998,6 +936,7 @@ "-ObjC", "-all_load", ); + PRODUCT_BUNDLE_IDENTIFIER = "${EXECUTABLE_NAME}"; PRODUCT_NAME = "com.mustacheware.$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = xpc; @@ -1007,6 +946,7 @@ 1EEDD0DC13DE9FAB00D5AEC3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1016,6 +956,7 @@ INFOPLIST_FILE = "XPCKit/XPCKit-Info.plist"; INSTALL_PATH = "@rpath"; MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_BUNDLE_IDENTIFIER = "com.mustacheware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; @@ -1024,6 +965,7 @@ 1EEDD0DD13DE9FAB00D5AEC3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1033,11 +975,61 @@ INFOPLIST_FILE = "XPCKit/XPCKit-Info.plist"; INSTALL_PATH = "@rpath"; MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_BUNDLE_IDENTIFIER = "com.mustacheware.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; name = Release; }; + 9FFC64EF1CE0FDE8008D977A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = XPCKitTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.t1visions.XPCKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 9FFC64F01CE0FDE8008D977A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + ENABLE_NS_ASSERTIONS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = XPCKitTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.t1visions.XPCKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1059,15 +1051,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1EEDD05213DD485400D5AEC3 /* Build configuration list for PBXNativeTarget "XPCKitTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1EEDD05313DD485400D5AEC3 /* Debug */, - 1EEDD05413DD485400D5AEC3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 1EEDD06E13DD48BC00D5AEC3 /* Build configuration list for PBXNativeTarget "TestApp" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1095,6 +1078,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 9FFC64EE1CE0FDE8008D977A /* Build configuration list for PBXNativeTarget "XPCKitTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9FFC64EF1CE0FDE8008D977A /* Debug */, + 9FFC64F01CE0FDE8008D977A /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; /* End XCConfigurationList section */ }; rootObject = 1EEDD01F13DD485400D5AEC3 /* Project object */; diff --git a/XPCKit/NSArray+XPCParse.m b/XPCKit/NSArray+XPCParse.m index 71a16df..0e5f6b5 100644 --- a/XPCKit/NSArray+XPCParse.m +++ b/XPCKit/NSArray+XPCParse.m @@ -31,7 +31,7 @@ +(NSArray *)arrayWithContentsOfXPCObject:(xpc_object_t)object{ } return true; }); - return [[array copy] autorelease]; + return [array copy]; } -(xpc_object_t)newXPCObject{ diff --git a/XPCKit/NSData+XPCParse.m b/XPCKit/NSData+XPCParse.m index 938a2a8..ad2a557 100644 --- a/XPCKit/NSData+XPCParse.m +++ b/XPCKit/NSData+XPCParse.m @@ -28,7 +28,7 @@ +(NSData *)dataWithXPCObject:(xpc_object_t)xpcObject{ // NOTE: mmap'd files do not work right now, this returns inconsistently-sized files for some reason. // Only remove the "NO &&" if you know what you're doing. - if(NO && type == XPC_TYPE_SHMEM){ + if(/* DISABLES CODE */ (NO) && type == XPC_TYPE_SHMEM){ void *buffer = NULL; size_t length = xpc_shmem_map(xpcObject, &buffer); if(length > 0){ @@ -50,7 +50,6 @@ + (id)objectWithXPCObject:(xpc_object_t)xpcObject @try { object = [NSKeyedUnarchiver unarchiveObjectWithData:[NSData dataWithXPCObject:xpcObject]]; - [object retain]; } @catch (NSException *exception) { XPCLogWarning(@"NSData object is not an object archive (this is not necessarily an error). Reason: %@", exception); @@ -58,7 +57,7 @@ + (id)objectWithXPCObject:(xpc_object_t)xpcObject @finally { } - return [object autorelease]; + return object; } diff --git a/XPCKit/NSDictionary+XPCParse.m b/XPCKit/NSDictionary+XPCParse.m index 5c82e4d..f60dcac 100644 --- a/XPCKit/NSDictionary+XPCParse.m +++ b/XPCKit/NSDictionary+XPCParse.m @@ -32,7 +32,7 @@ +(NSDictionary *)dictionaryWithContentsOfXPCObject:(xpc_object_t)object{ } return true; }); - return [[dict copy] autorelease]; + return [dict copy]; } -(xpc_object_t)newXPCObject{ diff --git a/XPCKit/NSFileHandle+XPCParse.m b/XPCKit/NSFileHandle+XPCParse.m index aacc053..7ba9ea6 100644 --- a/XPCKit/NSFileHandle+XPCParse.m +++ b/XPCKit/NSFileHandle+XPCParse.m @@ -23,7 +23,7 @@ @implementation NSFileHandle (XPCParse) +(NSFileHandle *)fileHandleWithXPCObject:(xpc_object_t)xpc{ int fd = xpc_fd_dup(xpc); - NSFileHandle *handle = [[[NSFileHandle alloc] initWithFileDescriptor:fd closeOnDealloc:YES] autorelease]; + NSFileHandle *handle = [[NSFileHandle alloc] initWithFileDescriptor:fd closeOnDealloc:YES]; return handle; } diff --git a/XPCKit/XPCConnection.m b/XPCKit/XPCConnection.m index 5b45f42..abfea95 100644 --- a/XPCKit/XPCConnection.m +++ b/XPCKit/XPCConnection.m @@ -33,29 +33,20 @@ @implementation XPCConnection - (id)initWithServiceName:(NSString *)serviceName{ xpc_connection_t connection = xpc_connection_create([serviceName cStringUsingEncoding:NSUTF8StringEncoding], NULL); - self = [self initWithConnection:connection]; - if (connection) { - xpc_release(connection); - } - return self; + return [self initWithConnection:connection]; } -(id)initWithConnection:(xpc_connection_t)connection{ if(!connection){ - [self release]; return nil; } if(self = [super init]){ - _connection = xpc_retain(connection); + _connection = connection; [self receiveConnection:_connection]; dispatch_queue_t queue = dispatch_queue_create(xpc_connection_get_name(_connection), 0); self.dispatchQueue = queue; - if (queue) { - dispatch_release(queue); - } - [self resume]; } return self; @@ -64,38 +55,20 @@ -(id)initWithConnection:(xpc_connection_t)connection{ -(void)dealloc{ if(_connection){ xpc_connection_cancel(_connection); - xpc_release(_connection); _connection = NULL; } if(_eventHandler){ - [_eventHandler release]; _eventHandler = nil; } - [super dealloc]; } -(void)setDispatchQueue:(dispatch_queue_t)dispatchQueue{ - if(dispatchQueue){ - dispatch_retain(dispatchQueue); - } - - if(_dispatchQueue){ - dispatch_release(_dispatchQueue); - } _dispatchQueue = dispatchQueue; - xpc_connection_set_target_queue(self.connection, self.dispatchQueue); } -(void)setReplyDispatchQueue:(dispatch_queue_t)dispatchQueue{ - if(dispatchQueue){ - dispatch_retain(dispatchQueue); - } - - if(_replyDispatchQueue){ - dispatch_release(_replyDispatchQueue); - } _replyDispatchQueue = dispatchQueue; } @@ -114,7 +87,6 @@ -(void)receiveConnection:(xpc_connection_t)connection xpc_object_t errorDict = xpc_dictionary_create(NULL, NULL, 0); xpc_dictionary_set_value(errorDict, "__XPCError", object); message = [XPCMessage messageWithXPCDictionary:errorDict]; - xpc_release(errorDict); }else{ message = [XPCMessage messageWithXPCDictionary:object]; @@ -184,8 +156,7 @@ -(void)sendMessage:(XPCMessage *)inMessage [inMessage setNeedsDirectReply:YES]; dispatch_queue_t replyQueue = self.replyDispatchQueue ? self.replyDispatchQueue : dispatch_get_current_queue(); - dispatch_retain(replyQueue); - + XPCReplyHandler replyHandler = [inReplyHandler copy]; XPCErrorHandler errorHandler = [inErrorHandler copy]; @@ -215,10 +186,6 @@ -(void)sendMessage:(XPCMessage *)inMessage XPCMessage *replyMessage = [XPCMessage messageWithXPCDictionary:event]; replyHandler(replyMessage); } - - [replyHandler release]; - [errorHandler release]; - dispatch_release(replyQueue); }); }); } @@ -243,12 +210,10 @@ -(void)sendSelector:(SEL)inSelector withTarget:(id)inTarget object:(id)inObject NSError *error = nil; id returnValue = [inReply invocationReturnValue:&error]; returnHandler(returnValue, error); // Handle method-level errors here - [returnHandler release]; } errorHandler:^(NSError* inError) // Handle connection-level errors here { returnHandler(nil, inError); - [returnHandler release]; }]; } diff --git a/XPCKit/XPCKit-Info.plist b/XPCKit/XPCKit-Info.plist index 6e0c09c..60a5280 100644 --- a/XPCKit/XPCKit-Info.plist +++ b/XPCKit/XPCKit-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.mustacheware.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/XPCKit/XPCMessage.m b/XPCKit/XPCMessage.m index 3e3d6ac..db2ebd6 100644 --- a/XPCKit/XPCMessage.m +++ b/XPCKit/XPCMessage.m @@ -42,13 +42,13 @@ - (void) setXPCDictionary:(xpc_object_t)inXPCDictionary + (id)message { - return [[[XPCMessage alloc] init] autorelease]; + return [[XPCMessage alloc] init]; } + (id)messageWithXPCDictionary:(xpc_object_t)inXPCDictionary { - return [[[XPCMessage alloc] initWithXPCDictionary:inXPCDictionary] autorelease]; + return [[XPCMessage alloc] initWithXPCDictionary:inXPCDictionary]; } @@ -62,19 +62,19 @@ + (id)messageWithXPCDictionary:(xpc_object_t)inXPCDictionary + (id)messageReplyForMessage:(XPCMessage *)inOriginalMessage { - return [[[XPCMessage alloc] initReplyForMessage:inOriginalMessage] autorelease]; + return [[XPCMessage alloc] initReplyForMessage:inOriginalMessage]; } + (id)messageWithObjects:(NSArray *)inObjects forKeys:(NSArray *)inKeys { - return [[[XPCMessage alloc] initWithObjects:inObjects forKeys:inKeys] autorelease]; + return [[XPCMessage alloc] initWithObjects:inObjects forKeys:inKeys]; } + (id)messageWithObject:(id)inObject forKey:(NSString *)inKey { - return [[[XPCMessage alloc] initWithObject:inObject forKey:inKey] autorelease]; + return [[XPCMessage alloc] initWithObject:inObject forKey:inKey]; } @@ -87,7 +87,7 @@ + (id)messageWithObjectsAndKeys:(id)firstObject, ... this = [this _initWithFirstObject:firstObject arguments:argumentList]; va_end(argumentList); - return [this autorelease]; + return this; } @@ -95,7 +95,7 @@ + (id)messageWithObjectsAndKeys:(id)firstObject, ... + (id)messageWithSelector:(SEL)inSelector target:(id)inTarget object:(id)inObject { - return [[[XPCMessage alloc] initWithSelector:inSelector target:inTarget object:inObject] autorelease]; + return [[XPCMessage alloc] initWithSelector:inSelector target:inTarget object:inObject]; } @@ -240,7 +240,6 @@ - (void)dealloc if (_XPCDictionary) { xpc_release(_XPCDictionary); } - [super dealloc]; } @@ -389,14 +388,7 @@ - (XPCMessage *) invoke XPCMessage *reply = [XPCMessage messageReplyForMessage:self]; NSError* error = nil; - id result = nil; - - if (object) { - result = [target performSelector:selector withObject:object withObject:(id)&error]; - } else { - result = [target performSelector:selector withObject:(id)&error]; - } - + id result = XPCKitInvokeSelector(target, selector, object, &error); if (result) [reply setObject:result forKey:@"result"]; if (error) [reply setObject:error forKey:@"error"]; diff --git a/XPCKit/XPCService.m b/XPCKit/XPCService.m index 853c457..592f1f5 100644 --- a/XPCKit/XPCService.m +++ b/XPCKit/XPCService.m @@ -23,7 +23,6 @@ static void XPCServiceConnectionHandler(xpc_connection_t handler){ XPCConnection *connection = [[XPCConnection alloc] initWithConnection:handler]; [[NSNotificationCenter defaultCenter] postNotificationName:XPCConnectionReceivedNotification object:connection]; - [connection release]; } @implementation XPCService @@ -67,11 +66,9 @@ -(void)handleConnection:(XPCConnection *)connection{ } +(void)runServiceWithConnectionHandler:(XPCConnectionHandler)connectionHandler{ - XPCService *service = [[XPCService alloc] initWithConnectionHandler:connectionHandler]; + (void)[[XPCService alloc] initWithConnectionHandler:connectionHandler]; [XPCService runService]; - - [service release]; } @end diff --git a/XPCKit/XPCUUID.m b/XPCKit/XPCUUID.m index febc6e0..5093cde 100644 --- a/XPCKit/XPCUUID.m +++ b/XPCKit/XPCUUID.m @@ -31,7 +31,7 @@ @implementation XPCUUID +(XPCUUID *)uuid{ CFUUIDRef uuidRef = CFUUIDCreate(NULL); - XPCUUID *uuid = [[[self alloc] initWithUUIDRef:uuidRef] autorelease]; + XPCUUID *uuid = [[self alloc] initWithUUIDRef:uuidRef]; CFRelease(uuidRef); return uuid; } @@ -60,7 +60,7 @@ +(XPCUUID *)uuidWithXPCObject:(xpc_object_t)xpc{ #undef CopyByte CFUUIDRef uuidRef = CFUUIDCreateFromUUIDBytes(NULL, uuidBytes); - XPCUUID *uuid = [[[self alloc] initWithUUIDRef:uuidRef] autorelease]; + XPCUUID *uuid = [[self alloc] initWithUUIDRef:uuidRef]; CFRelease(uuidRef); @@ -97,7 +97,7 @@ -(xpc_object_t)newXPCObject{ } -(NSString *)string{ - return [((NSString *)CFMakeCollectable(CFUUIDCreateString(NULL, self.uuidRef))) autorelease]; + return CFBridgingRelease(CFUUIDCreateString(NULL, self.uuidRef)); } -(NSString *)description{ @@ -128,7 +128,6 @@ -(void)dealloc{ _uuidRef = nil; } - [super dealloc]; } @end diff --git a/XPCKit/XPCUtilities.h b/XPCKit/XPCUtilities.h index 0ff477f..63487f1 100644 --- a/XPCKit/XPCUtilities.h +++ b/XPCKit/XPCUtilities.h @@ -55,6 +55,8 @@ void XPCSetLogLevel(XPCLogLevel inLogLevel); // (i.e. target and object must conform to NSCoding when connection is not nil). // When XPCConnection is nil (e.g. running on Snow Leopard) message will be dispatched asynchronously via GCD. -void XPCPerformSelectorAsync(XPCConnection *inConnection, +extern void XPCPerformSelectorAsync(XPCConnection *inConnection, id inTarget, SEL inSelector, id inObject, XPCReturnValueHandler inCompletionHandler); + +extern id XPCKitInvokeSelector(id inTarget, SEL inSelector, id inObject, NSError **perror); diff --git a/XPCKit/XPCUtilities.m b/XPCKit/XPCUtilities.m index f5c7f65..6f9bc7f 100644 --- a/XPCKit/XPCUtilities.m +++ b/XPCKit/XPCUtilities.m @@ -52,28 +52,41 @@ void XPCPerformSelectorAsync(XPCConnection *inConnection, id objectCopy = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:inObject]]; dispatch_queue_t currentQueue = dispatch_get_current_queue(); - dispatch_retain(currentQueue); - + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^() { NSError* error = nil; - id result = nil; - - if (objectCopy) { - result = [targetCopy performSelector:inSelector withObject:objectCopy withObject:(id)&error]; - } else { - result = [targetCopy performSelector:inSelector withObject:(id)&error]; - } - + id result = XPCKitInvokeSelector(targetCopy, inSelector, objectCopy, &error); dispatch_async(currentQueue,^() { inReturnHandler(result, error); - dispatch_release(currentQueue); }); }); } } +id XPCKitInvokeSelector(id inTarget, SEL inSelector, id inObject, NSError **perror) +{ + __unsafe_unretained id ierror = nil; + __unsafe_unretained id *errorPtr = &ierror; + void *tempResult; + int index = 2; + __unsafe_unretained id unsafeObject = inObject; + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature: [inTarget methodSignatureForSelector: inSelector]]; + [invocation setTarget: inTarget]; + [invocation setSelector: inSelector]; + // Note: Indexes 0 and 1 correspond to the implicit arguments self and _cmd, + // which are set using setTarget and setSelector. + if (inObject) + [invocation setArgument: &unsafeObject atIndex: index++]; + [invocation setArgument: &errorPtr atIndex: index++]; + [invocation retainArguments]; + [invocation invoke]; + [invocation getReturnValue: &tempResult]; + if (perror) + *perror = ierror; + return (__bridge id)tempResult; +} #pragma mark - Log Levels diff --git a/XPCKitTests/XPCKitTests-Info.plist b/XPCKitTests/Info.plist similarity index 80% rename from XPCKitTests/XPCKitTests-Info.plist rename to XPCKitTests/Info.plist index f74d065..ba72822 100644 --- a/XPCKitTests/XPCKitTests-Info.plist +++ b/XPCKitTests/Info.plist @@ -5,11 +5,13 @@ CFBundleDevelopmentRegion en CFBundleExecutable - ${EXECUTABLE_NAME} + $(EXECUTABLE_NAME) CFBundleIdentifier - ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString diff --git a/XPCKitTests/XPCKitTests.h b/XPCKitTests/XPCKitTests.h deleted file mode 100644 index 406cd2a..0000000 --- a/XPCKitTests/XPCKitTests.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// XPCKitTests.h -// XPCKitTests -// -// Created by Steve Streza on 7/24/11. Copyright 2011 XPCKit. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -@interface XPCKitTests : SenTestCase - --(void)testEqualityOfXPCRoundtripForObject:(id)object; - -@end diff --git a/XPCKitTests/XPCKitTests.m b/XPCKitTests/XPCKitTests.m index 69af49e..e5199b7 100644 --- a/XPCKitTests/XPCKitTests.m +++ b/XPCKitTests/XPCKitTests.m @@ -2,136 +2,129 @@ // XPCKitTests.m // XPCKitTests // -// Created by Steve Streza on 7/24/11. Copyright 2011 XPCKit. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Created by Adam Fedor on 5/9/16. +// Copyright © 2016 Mustacheware. All rights reserved. // -#import "XPCKitTests.h" +#import #import "XPCKit.h" +@interface XPCKitTests : XCTestCase + +@end + @implementation XPCKitTests -- (void)setUp -{ +- (void)setUp { [super setUp]; - - // Set-up code here. } -- (void)tearDown -{ - // Tear-down code here. - +- (void)tearDown { [super tearDown]; } --(void)testString{ - [self testEqualityOfXPCRoundtripForObject:@""]; - [self testEqualityOfXPCRoundtripForObject:@"Hello world!"]; +- (void) runEqualityOfXPCRoundtripForObject:(id)object +{ + XCTAssertNotNil(object, @"Source object is nil"); + + xpc_object_t xpcObject = [object newXPCObject]; + XCTAssertNotNil(xpcObject, @"XPC Object is nil"); + + id outObject = [NSObject objectWithXPCObject:xpcObject]; + XCTAssertNotNil(outObject, @"XPC-converted object is nil"); + + if([object isKindOfClass:[NSDate class]]){ + NSTimeInterval delta = fabs([object timeIntervalSinceDate:outObject]); + BOOL smallEnough = (delta < 0.000001); + XCTAssertTrue(smallEnough, @"Date %@ was not equal to result %@", object, outObject); + }else{ + XCTAssertEqualObjects(object, outObject, @"Object %@ was not equal to result %@", object, outObject); + } } -- (void)testNumbers{ - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithInt:0]]; - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithInt:1]]; - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithInt:-1]]; - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithDouble:42.1]]; - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithLong:42]]; - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithUnsignedLong:42]]; - [self testEqualityOfXPCRoundtripForObject:(id)kCFBooleanTrue]; - [self testEqualityOfXPCRoundtripForObject:(id)kCFBooleanFalse]; - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithBool:YES]]; - [self testEqualityOfXPCRoundtripForObject:[NSNumber numberWithBool:NO]]; +#pragma mark Objects +- (void)testString +{ + [self runEqualityOfXPCRoundtripForObject:@""]; + [self runEqualityOfXPCRoundtripForObject:@"Hello world!"]; } --(void)testArrays{ - [self testEqualityOfXPCRoundtripForObject:[NSArray array]]; - [self testEqualityOfXPCRoundtripForObject:[NSArray arrayWithObject:@"foo"]]; - [self testEqualityOfXPCRoundtripForObject:[NSArray arrayWithObjects:@"foo", @"bar", @"baz", nil]]; +- (void)testNumbers +{ + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithInt:0]]; + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithInt:1]]; + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithInt:-1]]; + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithDouble:42.1]]; + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithLong:42]]; + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithUnsignedLong:42]]; + [self runEqualityOfXPCRoundtripForObject:(id)kCFBooleanTrue]; + [self runEqualityOfXPCRoundtripForObject:(id)kCFBooleanFalse]; + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithBool:YES]]; + [self runEqualityOfXPCRoundtripForObject:[NSNumber numberWithBool:NO]]; } --(void)testDictionaries{ - [self testEqualityOfXPCRoundtripForObject:[NSDictionary dictionary]]; - [self testEqualityOfXPCRoundtripForObject:[NSDictionary dictionaryWithObject:@"bar" forKey:@"foo"]]; - [self testEqualityOfXPCRoundtripForObject:[NSDictionary dictionaryWithObjectsAndKeys: - @"bar", @"foo", - @"42", @"baz", - [NSNumber numberWithInt:42], @"theAnswerToEverything", - nil]]; +- (void)testArrays +{ + [self runEqualityOfXPCRoundtripForObject:[NSArray array]]; + [self runEqualityOfXPCRoundtripForObject:[NSArray arrayWithObject:@"foo"]]; + [self runEqualityOfXPCRoundtripForObject:[NSArray arrayWithObjects:@"foo", @"bar", @"baz", nil]]; } --(void)testDates{ - [self testEqualityOfXPCRoundtripForObject:[NSDate date]]; - [self testEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSince1970:20.]]; - [self testEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSince1970:2000000.]]; - [self testEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSince1970:2000000000.]]; - [self testEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:10.]]; - [self testEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:-10.]]; - [self testEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:10000.]]; - [self testEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:-10000.]]; +- (void)testDictionaries +{ + [self runEqualityOfXPCRoundtripForObject:[NSDictionary dictionary]]; + [self runEqualityOfXPCRoundtripForObject:[NSDictionary dictionaryWithObject:@"bar" forKey:@"foo"]]; + [self runEqualityOfXPCRoundtripForObject:[NSDictionary dictionaryWithObjectsAndKeys: + @"bar", @"foo", + @"42", @"baz", + [NSNumber numberWithInt:42], @"theAnswerToEverything", + nil]]; } --(void)testUUID{ - // UUIDs are unique, so test a few at random - STAssertFalse([[XPCUUID uuid] isEqual:[XPCUUID uuid]], @"Two identical UUIDs"); - STAssertFalse([[XPCUUID uuid] isEqual:[XPCUUID uuid]], @"Two identical UUIDs"); - STAssertFalse([[XPCUUID uuid] isEqual:[XPCUUID uuid]], @"Two identical UUIDs"); - - [self testEqualityOfXPCRoundtripForObject:[XPCUUID uuid]]; - [self testEqualityOfXPCRoundtripForObject:[XPCUUID uuid]]; - [self testEqualityOfXPCRoundtripForObject:[XPCUUID uuid]]; +-(void)testDates +{ + [self runEqualityOfXPCRoundtripForObject:[NSDate date]]; + [self runEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSince1970:20.]]; + [self runEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSince1970:2000000.]]; + [self runEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSince1970:2000000000.]]; + [self runEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:10.]]; + [self runEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:-10.]]; + [self runEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:10000.]]; + [self runEqualityOfXPCRoundtripForObject:[NSDate dateWithTimeIntervalSinceNow:-10000.]]; } --(void)testData +- (void)testUUID { - const char *pointer = "Bytes on a string"; - NSData *inData = [NSData dataWithBytes:(const void *)pointer length:sizeof(char)*strlen(pointer)]; - - NSLog(@"NSData is %@", inData); - [self testEqualityOfXPCRoundtripForObject:inData]; + // UUIDs are unique, so test a few at random + XCTAssertFalse([[XPCUUID uuid] isEqual:[XPCUUID uuid]], @"Two identical UUIDs"); + XCTAssertFalse([[XPCUUID uuid] isEqual:[XPCUUID uuid]], @"Two identical UUIDs"); + XCTAssertFalse([[XPCUUID uuid] isEqual:[XPCUUID uuid]], @"Two identical UUIDs"); + + [self runEqualityOfXPCRoundtripForObject:[XPCUUID uuid]]; + [self runEqualityOfXPCRoundtripForObject:[XPCUUID uuid]]; + [self runEqualityOfXPCRoundtripForObject:[XPCUUID uuid]]; } --(void)testXPCMessage +- (void)testData { - // Create archivable test object - NSSet *inTestSet = [NSSet setWithObjects:@"Hallo", @"Ballo", @"Drallo", nil]; - - // Store/retrieve archivable test object in/from message: - XPCMessage *message = [XPCMessage message]; - [message setObject:inTestSet forKey:@"greetings"]; - NSSet *outTestSet = (NSSet *) [message objectForKey:@"greetings"]; - - STAssertEqualObjects(inTestSet, outTestSet,@"Input object %@ is not equal to output object %@", inTestSet, outTestSet); + const char *pointer = "Bytes on a string"; + NSData *inData = [NSData dataWithBytes:(const void *)pointer length:sizeof(char)*strlen(pointer)]; + + NSLog(@"NSData is %@", inData); + [self runEqualityOfXPCRoundtripForObject:inData]; } --(void)testEqualityOfXPCRoundtripForObject:(id)object{ - STAssertNotNil(object, @"Source object is nil"); - - xpc_object_t xpcObject = [object newXPCObject]; - STAssertNotNil(xpcObject, @"XPC Object is nil"); - - id outObject = [NSObject objectWithXPCObject:xpcObject]; - STAssertNotNil(outObject, @"XPC-converted object is nil"); - - if([object isKindOfClass:[NSDate class]]){ - NSTimeInterval delta = fabsf([object timeIntervalSinceDate:outObject]); - BOOL smallEnough = (delta < 0.000001); - STAssertTrue(smallEnough, @"Date %@ was not equal to result %@", object, outObject); - }else{ - STAssertEqualObjects(object, outObject, @"Object %@ was not equal to result %@", object, outObject); - } - - xpc_release(xpcObject); +- (void)testXPCMessage +{ + // Create archivable test object + NSSet *inTestSet = [NSSet setWithObjects:@"Hallo", @"Ballo", @"Drallo", nil]; + + // Store/retrieve archivable test object in/from message: + XPCMessage *message = [XPCMessage message]; + [message setObject:inTestSet forKey:@"greetings"]; + NSSet *outTestSet = (NSSet *) [message objectForKey:@"greetings"]; + + XCTAssertEqualObjects(inTestSet, outTestSet,@"Input object %@ is not equal to output object %@", inTestSet, outTestSet); } @end diff --git a/XPCKitTests/en.lproj/InfoPlist.strings b/XPCKitTests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/XPCKitTests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ -