diff --git a/Tools/XcodeCapp/TNXCodeCapp.m b/Tools/XcodeCapp/TNXCodeCapp.m index 672db20c8..445a47910 100644 --- a/Tools/XcodeCapp/TNXCodeCapp.m +++ b/Tools/XcodeCapp/TNXCodeCapp.m @@ -403,7 +403,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification - (BOOL)prepareXCodeSupportProject { XCodeSupportProjectName = [NSString stringWithFormat:@"%@.xcodeproj/", currentProjectName]; - XCodeTemplatePBXPath = [[NSBundle mainBundle] pathForResource:@"project" ofType:@"pbxproj"]; + XCodeTemplatePBXPath = [[NSBundle mainBundle] pathForResource:@"project.pbxproj" ofType:@"sample"]; XCodeSupportFolder = [NSURL URLWithString:@".xCodeSupport/" relativeToURL:currentProjectURL]; XCodeSupportProject = [NSURL URLWithString:XCodeSupportProjectName relativeToURL:XCodeSupportFolder]; XCodeSupportProjectSources = [NSURL URLWithString:@"Sources/" relativeToURL:XCodeSupportFolder]; @@ -478,16 +478,22 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification [NSException raise:NSInvalidArgumentException format:@"shadowURLForSourceURL: aSource URL must not be null"]; NSMutableString *flattenedPath = [NSMutableString stringWithString:[aSourceURL path]]; - [flattenedPath replaceOccurrencesOfString:@"_" + NSMutableString *fileName = [NSMutableString stringWithString:[flattenedPath lastPathComponent]]; + [fileName replaceOccurrencesOfString:@"_" withString:@"-OLDUNDERSCORE-" options:NSCaseInsensitiveSearch - range:NSMakeRange(0, [[aSourceURL path] length])]; + range:NSMakeRange(0, [fileName length])]; + + [flattenedPath replaceOccurrencesOfString:[flattenedPath lastPathComponent] + withString:fileName + options:NSCaseInsensitiveSearch + range:NSMakeRange(0, [flattenedPath length])]; [flattenedPath replaceOccurrencesOfString:@"/" withString:@"_" options:NSCaseInsensitiveSearch - range:NSMakeRange(0, [[aSourceURL path] length])]; - + range:NSMakeRange(0, [flattenedPath length])]; + DLog(@"Flattened path: %@", flattenedPath); NSString *basename = [NSString stringWithFormat:@"%@.h", [[flattenedPath stringByDeletingPathExtension] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; diff --git a/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj b/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj index d5b48b676..b33b98e2d 100644 --- a/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj +++ b/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 022BCEA71468632000B72910 /* project.pbxproj.sample in Resources */ = {isa = PBXBuildFile; fileRef = 022BCEA61468632000B72910 /* project.pbxproj.sample */; }; 024A041413699DD400DCBE4D /* parser.j in Resources */ = {isa = PBXBuildFile; fileRef = 024A041113699D6800DCBE4D /* parser.j */; }; 026F3B6213866B0B00EE5B83 /* xcodecapp-icon-inactive.png in Resources */ = {isa = PBXBuildFile; fileRef = 026F3B6113866B0B00EE5B83 /* xcodecapp-icon-inactive.png */; }; 026F3B6513866E7D00EE5B83 /* xcodecapp-icon-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 026F3B6413866E7D00EE5B83 /* xcodecapp-icon-active.png */; }; @@ -41,6 +42,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 022BCEA61468632000B72910 /* project.pbxproj.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = project.pbxproj.sample; sourceTree = ""; }; 024A041113699D6800DCBE4D /* parser.j */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.objj; path = parser.j; sourceTree = ""; }; 026F3B6113866B0B00EE5B83 /* xcodecapp-icon-inactive.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "xcodecapp-icon-inactive.png"; sourceTree = ""; }; 026F3B6413866E7D00EE5B83 /* xcodecapp-icon-active.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "xcodecapp-icon-active.png"; sourceTree = ""; }; @@ -152,6 +154,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 022BCEA61468632000B72910 /* project.pbxproj.sample */, 027FE4B91462F64E00B1AB92 /* xcodecapp-icon-working.png */, 027FE4991462C6CF00B1AB92 /* help.rtfd */, 026F3B6413866E7D00EE5B83 /* xcodecapp-icon-active.png */, @@ -236,6 +239,7 @@ 027FE49A1462C6CF00B1AB92 /* help.rtfd in Resources */, 027FE4BA1462F64E00B1AB92 /* xcodecapp-icon-working.png in Resources */, 0289AC9414668CAF003CD975 /* XcodeCapp.icns in Resources */, + 022BCEA71468632000B72910 /* project.pbxproj.sample in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Tools/XcodeCapp/project.pbxproj.sample b/Tools/XcodeCapp/project.pbxproj.sample new file mode 100644 index 000000000..88efdb71f --- /dev/null +++ b/Tools/XcodeCapp/project.pbxproj.sample @@ -0,0 +1,354 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 9EEC4498135749D200615446 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EEC4497135749D200615446 /* Cocoa.framework */; }; + 9EEC44B5135749D300615446 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EEC4497135749D200615446 /* Cocoa.framework */; }; + 9EEC44CC13574A0B00615446 /* ${CappuccinoProjectName} in Resources */ = {isa = PBXBuildFile; fileRef = 9EEC44CB13574A0B00615446 /* ${CappuccinoProjectName} */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 9EEC44B6135749D300615446 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9EEC448A135749D200615446 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9EEC4492135749D200615446; + remoteInfo = Another; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 9EEC4493135749D200615446 /* Another.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Another.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9EEC4497135749D200615446 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 9EEC449A135749D300615446 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 9EEC449B135749D300615446 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 9EEC449C135749D300615446 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 9EEC44B4135749D300615446 /* AnotherTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AnotherTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; + 9EEC44CB13574A0B00615446 /* ${CappuccinoProjectName} */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ${CappuccinoProjectName}; path = ${CappuccinoProjectRelativePath}; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9EEC4490135749D200615446 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9EEC4498135749D200615446 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9EEC44B0135749D300615446 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9EEC44B5135749D300615446 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9EEC4488135749D200615446 = { + isa = PBXGroup; + children = ( + 9EEC44CB13574A0B00615446 /* ${CappuccinoProjectName} */, + 9EEC4496135749D200615446 /* Frameworks */, + 9EEC4494135749D200615446 /* Products */, + ); + sourceTree = ""; + }; + 9EEC4494135749D200615446 /* Products */ = { + isa = PBXGroup; + children = ( + 9EEC4493135749D200615446 /* Another.app */, + 9EEC44B4135749D300615446 /* AnotherTests.octest */, + ); + name = Products; + sourceTree = ""; + }; + 9EEC4496135749D200615446 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 9EEC4497135749D200615446 /* Cocoa.framework */, + 9EEC4499135749D300615446 /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9EEC4499135749D300615446 /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 9EEC449A135749D300615446 /* AppKit.framework */, + 9EEC449B135749D300615446 /* CoreData.framework */, + 9EEC449C135749D300615446 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 9EEC4492135749D200615446 /* Another */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9EEC44C5135749D300615446 /* Build configuration list for PBXNativeTarget "Another" */; + buildPhases = ( + 9EEC448F135749D200615446 /* Sources */, + 9EEC4490135749D200615446 /* Frameworks */, + 9EEC4491135749D200615446 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Another; + productName = Another; + productReference = 9EEC4493135749D200615446 /* Another.app */; + productType = "com.apple.product-type.application"; + }; + 9EEC44B3135749D300615446 /* AnotherTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9EEC44C8135749D300615446 /* Build configuration list for PBXNativeTarget "AnotherTests" */; + buildPhases = ( + 9EEC44AF135749D300615446 /* Sources */, + 9EEC44B0135749D300615446 /* Frameworks */, + 9EEC44B1135749D300615446 /* Resources */, + 9EEC44B2135749D300615446 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 9EEC44B7135749D300615446 /* PBXTargetDependency */, + ); + name = AnotherTests; + productName = AnotherTests; + productReference = 9EEC44B4135749D300615446 /* AnotherTests.octest */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9EEC448A135749D200615446 /* Project object */ = { + isa = PBXProject; + attributes = { + ORGANIZATIONNAME = "280 North, Inc."; + }; + buildConfigurationList = 9EEC448D135749D200615446 /* Build configuration list for PBXProject "Another" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 9EEC4488135749D200615446; + productRefGroup = 9EEC4494135749D200615446 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9EEC4492135749D200615446 /* Another */, + 9EEC44B3135749D300615446 /* AnotherTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9EEC4491135749D200615446 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9EEC44CC13574A0B00615446 /* ${CappuccinoProjectName} in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9EEC44B1135749D300615446 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 9EEC44B2135749D300615446 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + 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 */ + +/* Begin PBXSourcesBuildPhase section */ + 9EEC448F135749D200615446 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9EEC44AF135749D300615446 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 9EEC44B7135749D300615446 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9EEC4492135749D200615446 /* Another */; + targetProxy = 9EEC44B6135749D300615446 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 9EEC44C3135749D300615446 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = DEBUG; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 9EEC44C4135749D300615446 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.6; + SDKROOT = macosx; + }; + name = Release; + }; + 9EEC44C6135749D300615446 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Another/Another-Prefix.pch"; + INFOPLIST_FILE = "Another/Another-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 9EEC44C7135749D300615446 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Another/Another-Prefix.pch"; + INFOPLIST_FILE = "Another/Another-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 9EEC44C9135749D300615446 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Another.app/Contents/MacOS/Another"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "AnotherTests/AnotherTests-Prefix.pch"; + INFOPLIST_FILE = "AnotherTests/AnotherTests-Info.plist"; + OTHER_LDFLAGS = ( + "-framework", + SenTestingKit, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Debug; + }; + 9EEC44CA135749D300615446 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Another.app/Contents/MacOS/Another"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "AnotherTests/AnotherTests-Prefix.pch"; + INFOPLIST_FILE = "AnotherTests/AnotherTests-Info.plist"; + OTHER_LDFLAGS = ( + "-framework", + SenTestingKit, + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = octest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9EEC448D135749D200615446 /* Build configuration list for PBXProject "Another" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9EEC44C3135749D300615446 /* Debug */, + 9EEC44C4135749D300615446 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9EEC44C5135749D300615446 /* Build configuration list for PBXNativeTarget "Another" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9EEC44C6135749D300615446 /* Debug */, + 9EEC44C7135749D300615446 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 9EEC44C8135749D300615446 /* Build configuration list for PBXNativeTarget "AnotherTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9EEC44C9135749D300615446 /* Debug */, + 9EEC44CA135749D300615446 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9EEC448A135749D200615446 /* Project object */; +} \ No newline at end of file