diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8a71385 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "STPrivilegedTask"] + path = STPrivilegedTask + url = https://github.com/watr/STPrivilegedTask.git diff --git a/STPrivilegedTask b/STPrivilegedTask new file mode 160000 index 0000000..d415061 --- /dev/null +++ b/STPrivilegedTask @@ -0,0 +1 @@ +Subproject commit d415061ba68bcc8450ec9083c622146ca2438ac1 diff --git a/Xcode-Selector.xcodeproj/project.pbxproj b/Xcode-Selector.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b6a7795 --- /dev/null +++ b/Xcode-Selector.xcodeproj/project.pbxproj @@ -0,0 +1,593 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2F8CC7A519991CFA004398F3 /* XcodeItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F8CC7A419991CFA004398F3 /* XcodeItem.m */; }; + 2FCFBC2D1990D4870080A358 /* STPrivilegedTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FCFBC2B1990D4870080A358 /* STPrivilegedTask.m */; }; + 2FDA9D2B1950011D008F60D3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2FDA9D2A1950011D008F60D3 /* Cocoa.framework */; }; + 2FDA9D351950011D008F60D3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2FDA9D331950011D008F60D3 /* InfoPlist.strings */; }; + 2FDA9D371950011D008F60D3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FDA9D361950011D008F60D3 /* main.m */; }; + 2FDA9D3B1950011D008F60D3 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2FDA9D391950011D008F60D3 /* Credits.rtf */; }; + 2FDA9D3E1950011D008F60D3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FDA9D3D1950011D008F60D3 /* AppDelegate.m */; }; + 2FDA9D411950011D008F60D3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2FDA9D3F1950011D008F60D3 /* MainMenu.xib */; }; + 2FDA9D431950011D008F60D3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2FDA9D421950011D008F60D3 /* Images.xcassets */; }; + 2FDA9D4A1950011D008F60D3 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2FDA9D491950011D008F60D3 /* XCTest.framework */; }; + 2FDA9D4B1950011D008F60D3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2FDA9D2A1950011D008F60D3 /* Cocoa.framework */; }; + 2FDA9D531950011D008F60D3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2FDA9D511950011D008F60D3 /* InfoPlist.strings */; }; + 2FDA9D551950011D008F60D3 /* Xcode_SelectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FDA9D541950011D008F60D3 /* Xcode_SelectorTests.m */; }; + 2FDA9D6019500182008F60D3 /* XcodeHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FDA9D5F19500182008F60D3 /* XcodeHelper.m */; }; + 2FDA9D6119500182008F60D3 /* XcodeHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2FDA9D5F19500182008F60D3 /* XcodeHelper.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 2F414DCD19504D84005E3345 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2FDA9D1F1950011D008F60D3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2FDA9D261950011D008F60D3; + remoteInfo = "Xcode-Selector"; + }; + 2F414DCF19504D84005E3345 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2FDA9D1F1950011D008F60D3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2FDA9D261950011D008F60D3; + remoteInfo = "Xcode-Selector"; + }; + 2F414E04195118CB005E3345 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2FDA9D1F1950011D008F60D3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2FDA9D261950011D008F60D3; + remoteInfo = "Xcode-Selector"; + }; + 2F901A0A1973F22D009A6FDD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2FDA9D1F1950011D008F60D3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2FDA9D261950011D008F60D3; + remoteInfo = "Xcode-Selector"; + }; + 2F901A0C1973F22D009A6FDD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2FDA9D1F1950011D008F60D3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2FDA9D261950011D008F60D3; + remoteInfo = "Xcode-Selector"; + }; + 2FDA9D4C1950011D008F60D3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2FDA9D1F1950011D008F60D3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2FDA9D261950011D008F60D3; + remoteInfo = "Xcode-Selector"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 2FCFBC211990C0250080A358 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 2F8CC7A319991CFA004398F3 /* XcodeItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XcodeItem.h; sourceTree = ""; }; + 2F8CC7A419991CFA004398F3 /* XcodeItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XcodeItem.m; sourceTree = ""; }; + 2FCFBC131990BF910080A358 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 2FCFBC291990D4870080A358 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + 2FCFBC2A1990D4870080A358 /* STPrivilegedTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPrivilegedTask.h; sourceTree = ""; }; + 2FCFBC2B1990D4870080A358 /* STPrivilegedTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPrivilegedTask.m; sourceTree = ""; }; + 2FDA9D271950011D008F60D3 /* Xcode-Selector.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Xcode-Selector.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2FDA9D2A1950011D008F60D3 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 2FDA9D2D1950011D008F60D3 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 2FDA9D2E1950011D008F60D3 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 2FDA9D2F1950011D008F60D3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 2FDA9D321950011D008F60D3 /* Xcode-Selector-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Xcode-Selector-Info.plist"; sourceTree = ""; }; + 2FDA9D341950011D008F60D3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 2FDA9D361950011D008F60D3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 2FDA9D381950011D008F60D3 /* Xcode-Selector-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Xcode-Selector-Prefix.pch"; sourceTree = ""; }; + 2FDA9D3A1950011D008F60D3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + 2FDA9D3C1950011D008F60D3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 2FDA9D3D1950011D008F60D3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 2FDA9D401950011D008F60D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 2FDA9D421950011D008F60D3 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 2FDA9D481950011D008F60D3 /* Xcode-SelectorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Xcode-SelectorTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2FDA9D491950011D008F60D3 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 2FDA9D501950011D008F60D3 /* Xcode-SelectorTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Xcode-SelectorTests-Info.plist"; sourceTree = ""; }; + 2FDA9D521950011D008F60D3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 2FDA9D541950011D008F60D3 /* Xcode_SelectorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Xcode_SelectorTests.m; sourceTree = ""; }; + 2FDA9D5E19500182008F60D3 /* XcodeHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XcodeHelper.h; sourceTree = ""; }; + 2FDA9D5F19500182008F60D3 /* XcodeHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XcodeHelper.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2FDA9D241950011D008F60D3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FDA9D2B1950011D008F60D3 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2FDA9D451950011D008F60D3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FDA9D4B1950011D008F60D3 /* Cocoa.framework in Frameworks */, + 2FDA9D4A1950011D008F60D3 /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2FCFBC281990D4870080A358 /* STPrivilegedTask */ = { + isa = PBXGroup; + children = ( + 2FCFBC291990D4870080A358 /* README */, + 2FCFBC2A1990D4870080A358 /* STPrivilegedTask.h */, + 2FCFBC2B1990D4870080A358 /* STPrivilegedTask.m */, + ); + path = STPrivilegedTask; + sourceTree = ""; + }; + 2FDA9D1E1950011D008F60D3 = { + isa = PBXGroup; + children = ( + 2FCFBC281990D4870080A358 /* STPrivilegedTask */, + 2FDA9D301950011D008F60D3 /* Xcode-Selector */, + 2FDA9D4E1950011D008F60D3 /* Xcode-SelectorTests */, + 2FDA9D291950011D008F60D3 /* Frameworks */, + 2FDA9D281950011D008F60D3 /* Products */, + ); + sourceTree = ""; + }; + 2FDA9D281950011D008F60D3 /* Products */ = { + isa = PBXGroup; + children = ( + 2FDA9D271950011D008F60D3 /* Xcode-Selector.app */, + 2FDA9D481950011D008F60D3 /* Xcode-SelectorTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 2FDA9D291950011D008F60D3 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 2FDA9D2A1950011D008F60D3 /* Cocoa.framework */, + 2FDA9D491950011D008F60D3 /* XCTest.framework */, + 2FCFBC131990BF910080A358 /* Foundation.framework */, + 2FDA9D2C1950011D008F60D3 /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 2FDA9D2C1950011D008F60D3 /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 2FDA9D2D1950011D008F60D3 /* AppKit.framework */, + 2FDA9D2E1950011D008F60D3 /* CoreData.framework */, + 2FDA9D2F1950011D008F60D3 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 2FDA9D301950011D008F60D3 /* Xcode-Selector */ = { + isa = PBXGroup; + children = ( + 2FDA9D3C1950011D008F60D3 /* AppDelegate.h */, + 2FDA9D3D1950011D008F60D3 /* AppDelegate.m */, + 2F8CC7A319991CFA004398F3 /* XcodeItem.h */, + 2F8CC7A419991CFA004398F3 /* XcodeItem.m */, + 2FDA9D5E19500182008F60D3 /* XcodeHelper.h */, + 2FDA9D5F19500182008F60D3 /* XcodeHelper.m */, + 2FDA9D3F1950011D008F60D3 /* MainMenu.xib */, + 2FDA9D421950011D008F60D3 /* Images.xcassets */, + 2FDA9D311950011D008F60D3 /* Supporting Files */, + ); + path = "Xcode-Selector"; + sourceTree = ""; + }; + 2FDA9D311950011D008F60D3 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 2FDA9D321950011D008F60D3 /* Xcode-Selector-Info.plist */, + 2FDA9D331950011D008F60D3 /* InfoPlist.strings */, + 2FDA9D361950011D008F60D3 /* main.m */, + 2FDA9D381950011D008F60D3 /* Xcode-Selector-Prefix.pch */, + 2FDA9D391950011D008F60D3 /* Credits.rtf */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 2FDA9D4E1950011D008F60D3 /* Xcode-SelectorTests */ = { + isa = PBXGroup; + children = ( + 2FDA9D541950011D008F60D3 /* Xcode_SelectorTests.m */, + 2FDA9D4F1950011D008F60D3 /* Supporting Files */, + ); + path = "Xcode-SelectorTests"; + sourceTree = ""; + }; + 2FDA9D4F1950011D008F60D3 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 2FDA9D501950011D008F60D3 /* Xcode-SelectorTests-Info.plist */, + 2FDA9D511950011D008F60D3 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 2FDA9D261950011D008F60D3 /* Xcode-Selector */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FDA9D581950011D008F60D3 /* Build configuration list for PBXNativeTarget "Xcode-Selector" */; + buildPhases = ( + 2FDA9D231950011D008F60D3 /* Sources */, + 2FDA9D241950011D008F60D3 /* Frameworks */, + 2FDA9D251950011D008F60D3 /* Resources */, + 2FCFBC211990C0250080A358 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Xcode-Selector"; + productName = "Xcode-Selector"; + productReference = 2FDA9D271950011D008F60D3 /* Xcode-Selector.app */; + productType = "com.apple.product-type.application"; + }; + 2FDA9D471950011D008F60D3 /* Xcode-SelectorTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FDA9D5B1950011D008F60D3 /* Build configuration list for PBXNativeTarget "Xcode-SelectorTests" */; + buildPhases = ( + 2FDA9D441950011D008F60D3 /* Sources */, + 2FDA9D451950011D008F60D3 /* Frameworks */, + 2FDA9D461950011D008F60D3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 2FDA9D4D1950011D008F60D3 /* PBXTargetDependency */, + 2F414DCE19504D84005E3345 /* PBXTargetDependency */, + 2F414DD019504D84005E3345 /* PBXTargetDependency */, + 2F414E05195118CB005E3345 /* PBXTargetDependency */, + 2F901A0B1973F22D009A6FDD /* PBXTargetDependency */, + 2F901A0D1973F22D009A6FDD /* PBXTargetDependency */, + ); + name = "Xcode-SelectorTests"; + productName = "Xcode-SelectorTests"; + productReference = 2FDA9D481950011D008F60D3 /* Xcode-SelectorTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2FDA9D1F1950011D008F60D3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = prancee.com; + TargetAttributes = { + 2FDA9D471950011D008F60D3 = { + TestTargetID = 2FDA9D261950011D008F60D3; + }; + }; + }; + buildConfigurationList = 2FDA9D221950011D008F60D3 /* Build configuration list for PBXProject "Xcode-Selector" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 2FDA9D1E1950011D008F60D3; + productRefGroup = 2FDA9D281950011D008F60D3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2FDA9D261950011D008F60D3 /* Xcode-Selector */, + 2FDA9D471950011D008F60D3 /* Xcode-SelectorTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2FDA9D251950011D008F60D3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FDA9D351950011D008F60D3 /* InfoPlist.strings in Resources */, + 2FDA9D431950011D008F60D3 /* Images.xcassets in Resources */, + 2FDA9D3B1950011D008F60D3 /* Credits.rtf in Resources */, + 2FDA9D411950011D008F60D3 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2FDA9D461950011D008F60D3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FDA9D531950011D008F60D3 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2FDA9D231950011D008F60D3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2F8CC7A519991CFA004398F3 /* XcodeItem.m in Sources */, + 2FDA9D3E1950011D008F60D3 /* AppDelegate.m in Sources */, + 2FDA9D6019500182008F60D3 /* XcodeHelper.m in Sources */, + 2FCFBC2D1990D4870080A358 /* STPrivilegedTask.m in Sources */, + 2FDA9D371950011D008F60D3 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2FDA9D441950011D008F60D3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FDA9D551950011D008F60D3 /* Xcode_SelectorTests.m in Sources */, + 2FDA9D6119500182008F60D3 /* XcodeHelper.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 2F414DCE19504D84005E3345 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2FDA9D261950011D008F60D3 /* Xcode-Selector */; + targetProxy = 2F414DCD19504D84005E3345 /* PBXContainerItemProxy */; + }; + 2F414DD019504D84005E3345 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2FDA9D261950011D008F60D3 /* Xcode-Selector */; + targetProxy = 2F414DCF19504D84005E3345 /* PBXContainerItemProxy */; + }; + 2F414E05195118CB005E3345 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2FDA9D261950011D008F60D3 /* Xcode-Selector */; + targetProxy = 2F414E04195118CB005E3345 /* PBXContainerItemProxy */; + }; + 2F901A0B1973F22D009A6FDD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2FDA9D261950011D008F60D3 /* Xcode-Selector */; + targetProxy = 2F901A0A1973F22D009A6FDD /* PBXContainerItemProxy */; + }; + 2F901A0D1973F22D009A6FDD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2FDA9D261950011D008F60D3 /* Xcode-Selector */; + targetProxy = 2F901A0C1973F22D009A6FDD /* PBXContainerItemProxy */; + }; + 2FDA9D4D1950011D008F60D3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2FDA9D261950011D008F60D3 /* Xcode-Selector */; + targetProxy = 2FDA9D4C1950011D008F60D3 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 2FDA9D331950011D008F60D3 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 2FDA9D341950011D008F60D3 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 2FDA9D391950011D008F60D3 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 2FDA9D3A1950011D008F60D3 /* en */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + 2FDA9D3F1950011D008F60D3 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 2FDA9D401950011D008F60D3 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + 2FDA9D511950011D008F60D3 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 2FDA9D521950011D008F60D3 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 2FDA9D561950011D008F60D3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2FDA9D571950011D008F60D3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + SDKROOT = macosx; + }; + name = Release; + }; + 2FDA9D591950011D008F60D3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Xcode-Selector/Xcode-Selector-Prefix.pch"; + INFOPLIST_FILE = "Xcode-Selector/Xcode-Selector-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 2FDA9D5A1950011D008F60D3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Xcode-Selector/Xcode-Selector-Prefix.pch"; + INFOPLIST_FILE = "Xcode-Selector/Xcode-Selector-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 2FDA9D5C1950011D008F60D3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Xcode-Selector.app/Contents/MacOS/Xcode-Selector"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Xcode-Selector/Xcode-Selector-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Xcode-SelectorTests/Xcode-SelectorTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 2FDA9D5D1950011D008F60D3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Xcode-Selector.app/Contents/MacOS/Xcode-Selector"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Xcode-Selector/Xcode-Selector-Prefix.pch"; + INFOPLIST_FILE = "Xcode-SelectorTests/Xcode-SelectorTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2FDA9D221950011D008F60D3 /* Build configuration list for PBXProject "Xcode-Selector" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FDA9D561950011D008F60D3 /* Debug */, + 2FDA9D571950011D008F60D3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2FDA9D581950011D008F60D3 /* Build configuration list for PBXNativeTarget "Xcode-Selector" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FDA9D591950011D008F60D3 /* Debug */, + 2FDA9D5A1950011D008F60D3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2FDA9D5B1950011D008F60D3 /* Build configuration list for PBXNativeTarget "Xcode-SelectorTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FDA9D5C1950011D008F60D3 /* Debug */, + 2FDA9D5D1950011D008F60D3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2FDA9D1F1950011D008F60D3 /* Project object */; +} diff --git a/Xcode-Selector.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Xcode-Selector.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..f784634 --- /dev/null +++ b/Xcode-Selector.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Xcode-Selector/AppDelegate.h b/Xcode-Selector/AppDelegate.h new file mode 100644 index 0000000..d723f22 --- /dev/null +++ b/Xcode-Selector/AppDelegate.h @@ -0,0 +1,16 @@ + +#import + +@interface AppDelegate : NSObject + +@property (weak) IBOutlet NSWindow *window; + +@property (weak) IBOutlet NSButton *selectButton; + +@property (strong) IBOutlet NSArrayController *xcodeItemsController; + +- (IBAction)realoadAction:(id)sender; + +- (IBAction)selectAction:(id)sender; + +@end diff --git a/Xcode-Selector/AppDelegate.m b/Xcode-Selector/AppDelegate.m new file mode 100644 index 0000000..116f589 --- /dev/null +++ b/Xcode-Selector/AppDelegate.m @@ -0,0 +1,88 @@ + +#import "AppDelegate.h" +#import "XcodeItem.h" +#import "XcodeHelper.h" + +@interface AppDelegate () + +- (void)reload; + +@end + +@implementation AppDelegate + +#pragma mark NSApplicationDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + [self reload]; + + [self.window center]; + [self.window makeKeyAndOrderFront:self]; +} + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender +{ + return YES; +} + +#pragma mark NSTableViewDelegate + +- (void)tableViewSelectionDidChange:(NSNotification *)notification +{ + [self.selectButton setEnabled:((self.xcodeItemsController.selectedObjects.count == 1) && + (! ((XcodeItem *)self.xcodeItemsController.selectedObjects[0]).selected))]; +} + +#pragma mark - + +- (IBAction)realoadAction:(id)sender { + [self reload]; +} + +- (IBAction)selectAction:(id)sender { + XcodeItem *item = + self.xcodeItemsController.selectedObjects[0]; + + if (item) { + NSString *selectedXcodePath = [XcodeHelper selectedXcodePath]; + if (! [selectedXcodePath isEqualToString:item.xcodeDeveloperPath]) { + BOOL result = [XcodeHelper selectXcodeDeveloperDirectoryPath:item.xcodeDeveloperPath]; + (void)result; + [self reload]; + } + } +} + +#pragma mark class extension + +- (void)reload +{ + NSString *selectedXcodePath = [XcodeHelper selectedXcodePath]; + __block BOOL currentSelectedXcodeNotFound = YES; + + [self.xcodeItemsController removeObjectsAtArrangedObjectIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self.xcodeItemsController.arrangedObjects count])]]; + + [[XcodeHelper xcodeApplicationPathsExceptOtherVolumes:YES] enumerateObjectsUsingBlock: + ^(NSString *xcodeApplicationPath, NSUInteger idx, BOOL *stop) { + XcodeItem *item = [XcodeItem itemWithXcodeApplicationPath:xcodeApplicationPath]; + + BOOL isSelected = [selectedXcodePath hasPrefix:xcodeApplicationPath]; + item.selected = isSelected; + [self.xcodeItemsController addObject:item]; + + if (isSelected) { + currentSelectedXcodeNotFound = NO; + [self.xcodeItemsController setSelectedObjects:@[item]]; + } + }]; + + if (currentSelectedXcodeNotFound) { + XcodeItem *item = [XcodeItem itemWithXcodeApplicationPath:selectedXcodePath]; + item.selected = YES; + [self.xcodeItemsController addObject:item]; + [self.xcodeItemsController setSelectedObjects:@[item]]; + } +} + +@end diff --git a/Xcode-Selector/Base.lproj/MainMenu.xib b/Xcode-Selector/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..c56f575 --- /dev/null +++ b/Xcode-Selector/Base.lproj/MainMenu.xib @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NSNegateBoolean + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Xcode-Selector/Images.xcassets/AppIcon.appiconset/Contents.json b/Xcode-Selector/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..4840520 --- /dev/null +++ b/Xcode-Selector/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,60 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "appicon.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "appicon@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Xcode-Selector/Images.xcassets/AppIcon.appiconset/appicon.png b/Xcode-Selector/Images.xcassets/AppIcon.appiconset/appicon.png new file mode 100644 index 0000000..29819ab Binary files /dev/null and b/Xcode-Selector/Images.xcassets/AppIcon.appiconset/appicon.png differ diff --git a/Xcode-Selector/Images.xcassets/AppIcon.appiconset/appicon@2x.png b/Xcode-Selector/Images.xcassets/AppIcon.appiconset/appicon@2x.png new file mode 100644 index 0000000..2ef13db Binary files /dev/null and b/Xcode-Selector/Images.xcassets/AppIcon.appiconset/appicon@2x.png differ diff --git a/Xcode-Selector/Xcode-Selector-Info.plist b/Xcode-Selector/Xcode-Selector-Info.plist new file mode 100644 index 0000000..cf1c7ff --- /dev/null +++ b/Xcode-Selector/Xcode-Selector-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.prancee.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSApplicationCategoryType + + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + LSUIElement + + NSHumanReadableCopyright + Copyright © 2014 prancee.com. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Xcode-Selector/Xcode-Selector-Prefix.pch b/Xcode-Selector/Xcode-Selector-Prefix.pch new file mode 100644 index 0000000..35d7640 --- /dev/null +++ b/Xcode-Selector/Xcode-Selector-Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/Xcode-Selector/XcodeHelper.h b/Xcode-Selector/XcodeHelper.h new file mode 100644 index 0000000..ea766eb --- /dev/null +++ b/Xcode-Selector/XcodeHelper.h @@ -0,0 +1,16 @@ + +#import + +@interface XcodeHelper : NSObject + ++ (NSArray *)xcodeApplicationPathsExceptOtherVolumes:(BOOL)except; + ++ (NSString *)selectedXcodePath; + ++ (NSString *)xcodeTitleWithApplicationPath:(NSString *)xcodeApplicaionPath; + ++ (NSString *)xcodeDeveloperDirectoryPathCreateWithApplicationPath:(NSString *)xcodeApplicationPath; + ++ (BOOL)selectXcodeDeveloperDirectoryPath:(NSString *)developerDirectoryPath; + +@end diff --git a/Xcode-Selector/XcodeHelper.m b/Xcode-Selector/XcodeHelper.m new file mode 100644 index 0000000..00bded7 --- /dev/null +++ b/Xcode-Selector/XcodeHelper.m @@ -0,0 +1,93 @@ + +#import "XcodeHelper.h" +#import "STPrivilegedTask.h" + +@implementation XcodeHelper + ++ (NSString *)selectedXcodePath +{ + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath:@"/usr/bin/xcode-select"]; + [task setArguments:@[@"-p"]]; + NSPipe *outPipe = [NSPipe pipe]; + [task setStandardOutput:outPipe]; + + NSFileHandle *fileHandle = [outPipe fileHandleForReading]; + [task launch]; + [task waitUntilExit]; + + NSData *data = [fileHandle readDataToEndOfFile]; + NSString *outString = [[[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding] stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; + + return outString; +} + ++ (NSArray *)xcodeApplicationPathsExceptOtherVolumes:(BOOL)except; +{ + NSMutableArray *xcodePaths = [@[] mutableCopy]; + MDQueryRef query = MDQueryCreate(NULL, + (__bridge CFStringRef)(@"kMDItemKind == 'Application' &&" + "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode"), + NULL, + NULL); + if (MDQueryExecute(query, + kMDQuerySynchronous)) + { + NSInteger resultCount = MDQueryGetResultCount(query); + for (NSInteger i = 0; i < resultCount; i++) { + MDItemRef const item = (MDItemRef const)MDQueryGetResultAtIndex(query, + i); + NSString *path = (__bridge_transfer NSString *)MDItemCopyAttribute(item, kMDItemPath); + if (path && + ((! except) || + (! [path hasPrefix:@"/Volumes/"]))) + { + [xcodePaths addObject:path]; + } + } + } + return (xcodePaths.count > 0 ? [NSArray arrayWithArray:xcodePaths] : nil); +} + ++ (NSString *)xcodeTitleWithApplicationPath:(NSString *)xcodeApplicaionPath +{ + NSBundle *xcodeApplicationBundle = [NSBundle bundleWithPath:xcodeApplicaionPath]; + __block NSString *title = nil; + if (xcodeApplicationBundle) { + NSDictionary *info = [xcodeApplicationBundle infoDictionary]; + NSString *versionString = [info objectForKey:@"CFBundleShortVersionString"]; + + title = [NSString stringWithFormat:@"%@ (%@)", [[NSFileManager defaultManager] displayNameAtPath:xcodeApplicaionPath], versionString]; + } + else { + [[xcodeApplicaionPath pathComponents] enumerateObjectsWithOptions:NSEnumerationReverse + usingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + NSString *component = (NSString *)obj; + if ([[component pathExtension] isEqualToString:@"app"]) { + title = component; + *stop = YES; + } + }]; + } + return title; +} + ++ (NSString *)xcodeDeveloperDirectoryPathCreateWithApplicationPath:(NSString *)xcodeApplicationPath +{ + return [[xcodeApplicationPath stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Developer"]; +} + ++ (BOOL)selectXcodeDeveloperDirectoryPath:(NSString *)developerDirectoryPath +{ + [STPrivilegedTask launchedPrivilegedTaskWithLaunchPath:@"/usr/bin/xcode-select" + arguments:@[@"-s", developerDirectoryPath]]; + BOOL succeeded = ({ + NSString *selectedXcodePath = [XcodeHelper selectedXcodePath]; + ([developerDirectoryPath isEqualToString:[XcodeHelper xcodeDeveloperDirectoryPathCreateWithApplicationPath:selectedXcodePath]]); + }); + return succeeded; +} + + +@end diff --git a/Xcode-Selector/XcodeItem.h b/Xcode-Selector/XcodeItem.h new file mode 100644 index 0000000..1b3f25d --- /dev/null +++ b/Xcode-Selector/XcodeItem.h @@ -0,0 +1,18 @@ + +#import + +@interface XcodeItem : NSObject + +@property (nonatomic, copy) NSString *title; + +@property (nonatomic, strong) NSImage *image; + +@property (nonatomic, copy) NSString *xcodeDeveloperPath; + +@property (nonatomic, assign) BOOL selected; + ++ (XcodeItem *)itemWithXcodeApplicationPath:(NSString *)path; + +- (XcodeItem *)initWithXcodeApplicationPath:(NSString *)path; + +@end diff --git a/Xcode-Selector/XcodeItem.m b/Xcode-Selector/XcodeItem.m new file mode 100644 index 0000000..38dd1dd --- /dev/null +++ b/Xcode-Selector/XcodeItem.m @@ -0,0 +1,46 @@ + +#import "XcodeItem.h" +#import "XcodeHelper.h" + +@interface XcodeItem () + ++ (NSImage *)imageWithXcodePath:(NSString *)path; + +@end + +@implementation XcodeItem + ++ (XcodeItem *)itemWithXcodeApplicationPath:(NSString *)path +{ + return [[self alloc] initWithXcodeApplicationPath:path]; +} + +- (XcodeItem *)initWithXcodeApplicationPath:(NSString *)path +{ + self = [super init]; + if (self) { + self.title = [XcodeHelper xcodeTitleWithApplicationPath:path]; + self.image = [[self class] imageWithXcodePath:path]; + self.xcodeDeveloperPath = [XcodeHelper xcodeDeveloperDirectoryPathCreateWithApplicationPath:path]; + } + return self; +} + +#pragma mark class extension + ++ (NSImage *)imageWithXcodePath:(NSString *)path +{ + NSImage *image = nil; + + if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { + image = [[NSWorkspace sharedWorkspace] iconForFile:path]; + } + else { + NSImage *notFoundImage = [[NSImage alloc] initWithContentsOfFile:@"/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericQuestionMarkIcon.icns"]; + image = notFoundImage; + } + return image; +} + + +@end diff --git a/Xcode-Selector/appicon.png b/Xcode-Selector/appicon.png new file mode 100644 index 0000000..29819ab Binary files /dev/null and b/Xcode-Selector/appicon.png differ diff --git a/Xcode-Selector/appicon@2x.png b/Xcode-Selector/appicon@2x.png new file mode 100644 index 0000000..2ef13db Binary files /dev/null and b/Xcode-Selector/appicon@2x.png differ diff --git a/Xcode-Selector/en.lproj/Credits.rtf b/Xcode-Selector/en.lproj/Credits.rtf new file mode 100644 index 0000000..d9ae5f6 --- /dev/null +++ b/Xcode-Selector/en.lproj/Credits.rtf @@ -0,0 +1,16 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 Xcode-Selector\ +by +\b0 \ +Hashimoto Wataru\ +\ + +\b Open Source Libraries\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc +{\field{\*\fldinst{HYPERLINK "https://github.com/sveinbjornt/STPrivilegedTask"}}{\fldrslt +\b0 \cf0 STPrivilegedTask}}} \ No newline at end of file diff --git a/Xcode-Selector/en.lproj/InfoPlist.strings b/Xcode-Selector/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Xcode-Selector/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/Xcode-Selector/main.m b/Xcode-Selector/main.m new file mode 100644 index 0000000..b67212c --- /dev/null +++ b/Xcode-Selector/main.m @@ -0,0 +1,14 @@ +// +// main.m +// Xcode-Selector +// +// Created by HASHIMOTO Wataru on 6/17/14. +// Copyright (c) 2014 prancee.com. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) +{ + return NSApplicationMain(argc, argv); +} diff --git a/Xcode-SelectorTests/Xcode-SelectorTests-Info.plist b/Xcode-SelectorTests/Xcode-SelectorTests-Info.plist new file mode 100644 index 0000000..1413d23 --- /dev/null +++ b/Xcode-SelectorTests/Xcode-SelectorTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.prancee.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Xcode-SelectorTests/Xcode_SelectorTests.m b/Xcode-SelectorTests/Xcode_SelectorTests.m new file mode 100644 index 0000000..b029313 --- /dev/null +++ b/Xcode-SelectorTests/Xcode_SelectorTests.m @@ -0,0 +1,32 @@ + +#import +#import "XcodeHelper.h" + +@interface Xcode_SelectorTests : XCTestCase + +@end + +@implementation Xcode_SelectorTests + +- (void)setUp +{ + [super setUp]; +} + +- (void)tearDown +{ + [super tearDown]; +} + +- (void)testXcodeExists +{ + XCTAssert([XcodeHelper xcodeApplicationPathsExceptOtherVolumes:YES].count > 0, @"There is no Xcode path."); +} + +- (void)testSelectedXcodePathIsExists +{ + NSString *selectedXcodePath = [XcodeHelper selectedXcodePath]; + XCTAssert(selectedXcodePath.length > 0, @"Selected Xcode path NOT exists."); +} + +@end diff --git a/Xcode-SelectorTests/en.lproj/InfoPlist.strings b/Xcode-SelectorTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/Xcode-SelectorTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ +