Skip to content

Commit

Permalink
Support for Xcode 5 GM seed
Browse files Browse the repository at this point in the history
Run a script in a build pre-action phase to write the appropriate garbage collection setting into the xcproj.xcconfig file
  • Loading branch information
0xced committed Sep 11, 2013
1 parent fbf8c68 commit ebec5f4
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ brew install xcproj
To install the `xcproj` tool in `/usr/local/bin` run the following command, with `sudo` if required:

```
xcodebuild install DSTROOT=/
xcodebuild -scheme xcproj install DSTROOT=/
```

If you want to install `xcproj` in a custom location, e.g. `~/bin`, run the following command:

```
xcodebuild install DSTROOT=/ INSTALL_PATH=~/bin
xcodebuild -scheme xcproj install DSTROOT=/ INSTALL_PATH=~/bin
```

## Usage
Expand Down
1 change: 1 addition & 0 deletions xcproj.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GCC_ENABLE_OBJC_GC = unsupported
8 changes: 4 additions & 4 deletions xcproj.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32A70AAB03705E1F00C91783 /* xcproj_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xcproj_Prefix.pch; path = Sources/xcproj_Prefix.pch; sourceTree = "<group>"; };
8DD76FA10486AA7600D96B5E /* xcproj */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xcproj; sourceTree = BUILT_PRODUCTS_DIR; };
C24A73F617DFE2EE00DB4344 /* xcproj.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = xcproj.xcconfig; sourceTree = "<group>"; };
C269E98317B3DCCC0099A0C5 /* dd_getopt_long-fbsd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "dd_getopt_long-fbsd.m"; sourceTree = "<group>"; };
C269E98417B3DCCC0099A0C5 /* DDCliApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDCliApplication.h; sourceTree = "<group>"; };
C269E98517B3DCCC0099A0C5 /* DDCliApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDCliApplication.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -66,6 +67,7 @@
08FB7794FE84155DC02AAC07 /* xcproj */ = {
isa = PBXGroup;
children = (
C24A73F617DFE2EE00DB4344 /* xcproj.xcconfig */,
DAFF2AD913055EF500584E0E /* Info.plist */,
DA8C9FFB1302AF93008B3560 /* DevToolsCore */,
C269E98117B3DCCC0099A0C5 /* Externals */,
Expand Down Expand Up @@ -217,6 +219,7 @@
/* Begin XCBuildConfiguration section */
1DEB927508733DD40010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C24A73F617DFE2EE00DB4344 /* xcproj.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
Expand All @@ -231,6 +234,7 @@
};
1DEB927608733DD40010E9CD /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C24A73F617DFE2EE00DB4344 /* xcproj.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
Expand All @@ -248,8 +252,6 @@
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CURRENT_PROJECT_VERSION = 0.1;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_GC = required;
"GCC_ENABLE_OBJC_GC[sdk=macosx10.9]" = unsupported;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
Expand All @@ -273,8 +275,6 @@
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CURRENT_PROJECT_VERSION = 0.1;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_GC = required;
"GCC_ENABLE_OBJC_GC[sdk=macosx10.9]" = unsupported;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)\"";
Expand Down
149 changes: 149 additions & 0 deletions xcproj.xcodeproj/xcshareddata/xcschemes/xcproj.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Setup garbage collection support"
scriptText = "if [ ${XCODE_VERSION_MAJOR} -ge 500 ]; then&#10; GCC_ENABLE_OBJC_GC=unsupported&#10;else&#10; GCC_ENABLE_OBJC_GC=required&#10;fi&#10;&#10;echo &quot;GCC_ENABLE_OBJC_GC = ${GCC_ENABLE_OBJC_GC}&quot; &gt; &quot;${SRCROOT}/xcproj.xcconfig&quot;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
BuildableName = "xcproj"
BlueprintName = "xcproj"
ReferencedContainer = "container:xcproj.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "git checkout &quot;${SRCROOT}/xcproj.xcconfig&quot;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
BuildableName = "xcproj"
BlueprintName = "xcproj"
ReferencedContainer = "container:xcproj.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
BuildableName = "xcproj"
BlueprintName = "xcproj"
ReferencedContainer = "container:xcproj.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
BuildableName = "xcproj"
BlueprintName = "xcproj"
ReferencedContainer = "container:xcproj.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "YES"
customWorkingDirectory = "$(SRCROOT)/Sandbox/"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
BuildableName = "xcproj"
BlueprintName = "xcproj"
ReferencedContainer = "container:xcproj.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "touch"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--project Sandbox.xcodeproj"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--vers"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--help"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "add-resources-bundle Resources/v2.0/test.bundle"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "list-headers"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD76F960486AA7600D96B5E"
BuildableName = "xcproj"
BlueprintName = "xcproj"
ReferencedContainer = "container:xcproj.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

0 comments on commit ebec5f4

Please sign in to comment.