From 6fe1437ca614eb0281183405228cb8b40540d25a Mon Sep 17 00:00:00 2001 From: Marius Rackwitz Date: Thu, 11 Jun 2015 16:10:31 -0700 Subject: [PATCH 1/6] [Constants] Add LastSwiftUpdateCheck and bump --- lib/xcodeproj/constants.rb | 4 ++++ lib/xcodeproj/project/object/root_object.rb | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/xcodeproj/constants.rb b/lib/xcodeproj/constants.rb index 780fc6356..9ea557a83 100644 --- a/lib/xcodeproj/constants.rb +++ b/lib/xcodeproj/constants.rb @@ -28,6 +28,10 @@ module Constants # LAST_UPGRADE_CHECK = '0700' + # @return [String] The last known object version to Xcodeproj. + # + LAST_SWIFT_UPGRADE_CHECK = '0700' + # @return [Hash] The all the known ISAs grouped by superclass. # KNOWN_ISAS = { diff --git a/lib/xcodeproj/project/object/root_object.rb b/lib/xcodeproj/project/object/root_object.rb index 0f134ccb0..14eaf038a 100644 --- a/lib/xcodeproj/project/object/root_object.rb +++ b/lib/xcodeproj/project/object/root_object.rb @@ -20,7 +20,10 @@ class PBXProject < AbstractObject # - `LastUpgradeCheck` # - `ORGANIZATIONNAME` # - attribute :attributes, Hash, 'LastUpgradeCheck' => Constants::LAST_UPGRADE_CHECK + attribute :attributes, Hash, { + 'LastSwiftUpdateCheck' => Constants::LAST_SWIFT_UPGRADE_CHECK, + 'LastUpgradeCheck' => Constants::LAST_UPGRADE_CHECK + } # @return [XCConfigurationList] the configuration list of the project. # From e90915ff11dcd2eec142fa1de06f48168ec154ff Mon Sep 17 00:00:00 2001 From: Marius Rackwitz Date: Thu, 11 Jun 2015 16:10:59 -0700 Subject: [PATCH 2/6] [Constants BuildSettings] Add ENABLE_TESTABILITY --- lib/xcodeproj/constants.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/xcodeproj/constants.rb b/lib/xcodeproj/constants.rb index 9ea557a83..154ff0ba4 100644 --- a/lib/xcodeproj/constants.rb +++ b/lib/xcodeproj/constants.rb @@ -157,6 +157,16 @@ module Constants }.freeze, [:debug, :application, :swift] => { 'SWIFT_OPTIMIZATION_LEVEL' => '-Onone', + 'ENABLE_TESTABILITY' => 'YES', + }.freeze, + [:debug, :dynamic_library, :swift] => { + 'ENABLE_TESTABILITY' => 'YES', + }.freeze, + [:debug, :framework, :swift] => { + 'ENABLE_TESTABILITY' => 'YES', + }.freeze, + [:debug, :static_library, :swift] => { + 'ENABLE_TESTABILITY' => 'YES', }.freeze, [:framework] => { 'VERSION_INFO_PREFIX' => '', From 35818e01ef549ae9907f5e6adc22a87eaaff53e1 Mon Sep 17 00:00:00 2001 From: Marius Rackwitz Date: Thu, 11 Jun 2015 16:12:05 -0700 Subject: [PATCH 3/6] [Scheme] Add new elements and attributes --- lib/xcodeproj/scheme.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/xcodeproj/scheme.rb b/lib/xcodeproj/scheme.rb index 67d996cb6..c04b24f01 100644 --- a/lib/xcodeproj/scheme.rb +++ b/lib/xcodeproj/scheme.rb @@ -33,6 +33,8 @@ def initialize @test_action.attributes['shouldUseLaunchSchemeArgsEnv'] = 'YES' @test_action.attributes['buildConfiguration'] = 'Debug' + @test_action_additional_options = @test_action.add_element 'AdditionalOptions' + @testables = @test_action.add_element 'Testables' @launch_action = @scheme.add_element 'LaunchAction' @@ -43,6 +45,7 @@ def initialize @launch_action.attributes['buildConfiguration'] = 'Debug' @launch_action.attributes['ignoresPersistentStateOnLaunch'] = 'NO' @launch_action.attributes['debugDocumentVersioning'] = 'YES' + @launch_action.attributes['debugServiceExtension'] = 'internal' @launch_action.attributes['allowLocationSimulation'] = 'YES' @launch_action.add_element('AdditionalOptions') @@ -117,6 +120,7 @@ def add_test_target(test_target) # def set_launch_target(build_target) launch_product_runnable = @launch_action.add_element 'BuildableProductRunnable' + launch_product_runnable.attributes['runnableDebuggingMode'] = '0' launch_buildable_reference = launch_product_runnable.add_element 'BuildableReference' launch_buildable_reference.attributes['BuildableIdentifier'] = 'primary' From a09a5e13233f5ff2820982c05ac1d31919d05aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Bu=CC=88gling?= Date: Fri, 26 Jun 2015 00:58:51 +0200 Subject: [PATCH 4/6] Fix specs. --- .../Swift_OSX_Native/Swift_OSX_Native_debug.xcconfig | 1 + .../Swift_iOS_Native/Swift_iOS_Native_debug.xcconfig | 1 + .../xcschemes/iOS application and static library.xcscheme | 3 +++ .../xcshareddata/xcschemes/iOS application.xcscheme | 6 +++++- ...S applicationTests Set Build Target For Running.xcscheme | 3 +++ .../xcshareddata/xcschemes/iOS applicationTests.xcscheme | 3 +++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/spec/fixtures/CommonBuildSettings/configs/Swift_OSX_Native/Swift_OSX_Native_debug.xcconfig b/spec/fixtures/CommonBuildSettings/configs/Swift_OSX_Native/Swift_OSX_Native_debug.xcconfig index ded353da5..dd7857fb1 100644 --- a/spec/fixtures/CommonBuildSettings/configs/Swift_OSX_Native/Swift_OSX_Native_debug.xcconfig +++ b/spec/fixtures/CommonBuildSettings/configs/Swift_OSX_Native/Swift_OSX_Native_debug.xcconfig @@ -1,5 +1,6 @@ #include "Swift_OSX_Native/Swift_OSX_Native_base.xcconfig" COPY_PHASE_STRIP = NO GCC_PREPROCESSOR_DEFINITIONS = ["DEBUG=1", "$(inherited)"] +ENABLE_TESTABILITY = YES MTL_ENABLE_DEBUG_INFO = YES SWIFT_OPTIMIZATION_LEVEL = -Onone \ No newline at end of file diff --git a/spec/fixtures/CommonBuildSettings/configs/Swift_iOS_Native/Swift_iOS_Native_debug.xcconfig b/spec/fixtures/CommonBuildSettings/configs/Swift_iOS_Native/Swift_iOS_Native_debug.xcconfig index c54524c5b..bf8a2e14f 100644 --- a/spec/fixtures/CommonBuildSettings/configs/Swift_iOS_Native/Swift_iOS_Native_debug.xcconfig +++ b/spec/fixtures/CommonBuildSettings/configs/Swift_iOS_Native/Swift_iOS_Native_debug.xcconfig @@ -1,5 +1,6 @@ #include "Swift_iOS_Native/Swift_iOS_Native_base.xcconfig" COPY_PHASE_STRIP = NO +ENABLE_TESTABILITY = YES GCC_PREPROCESSOR_DEFINITIONS = ["DEBUG=1", "$(inherited)"] MTL_ENABLE_DEBUG_INFO = YES SWIFT_OPTIMIZATION_LEVEL = -Onone \ No newline at end of file diff --git a/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS application and static library.xcscheme b/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS application and static library.xcscheme index 999c96be0..ed36c96a9 100644 --- a/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS application and static library.xcscheme +++ b/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS application and static library.xcscheme @@ -86,6 +86,8 @@ ReferencedContainer = "container:Cocoa Application.xcodeproj"> + + + + - + + + diff --git a/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS applicationTests.xcscheme b/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS applicationTests.xcscheme index 61a4ed690..3b25c8882 100644 --- a/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS applicationTests.xcscheme +++ b/spec/fixtures/Sample Project/Cocoa Application.xcodeproj/xcshareddata/xcschemes/iOS applicationTests.xcscheme @@ -23,6 +23,8 @@ + + From c2a4840302c29d9e4affe6750e43515365f154cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Bu=CC=88gling?= Date: Fri, 26 Jun 2015 00:59:00 +0200 Subject: [PATCH 5/6] Rubocop --- lib/xcodeproj/project/object/root_object.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/xcodeproj/project/object/root_object.rb b/lib/xcodeproj/project/object/root_object.rb index 14eaf038a..6f458c67c 100644 --- a/lib/xcodeproj/project/object/root_object.rb +++ b/lib/xcodeproj/project/object/root_object.rb @@ -20,10 +20,9 @@ class PBXProject < AbstractObject # - `LastUpgradeCheck` # - `ORGANIZATIONNAME` # - attribute :attributes, Hash, { - 'LastSwiftUpdateCheck' => Constants::LAST_SWIFT_UPGRADE_CHECK, - 'LastUpgradeCheck' => Constants::LAST_UPGRADE_CHECK - } + attribute :attributes, Hash, + 'LastSwiftUpdateCheck' => Constants::LAST_SWIFT_UPGRADE_CHECK, + 'LastUpgradeCheck' => Constants::LAST_UPGRADE_CHECK # @return [XCConfigurationList] the configuration list of the project. # From e8cb468fcae3dd32e915c74da6b6dcb6b19a8218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Bu=CC=88gling?= Date: Fri, 26 Jun 2015 01:01:23 +0200 Subject: [PATCH 6/6] Changelog for #271 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 166c03433..c6c6707be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ [Boris Bügling](https://github.com/neonichu) [Xcodeproj#272](https://github.com/CocoaPods/Xcodeproj/pull/272) +* Update default build and scheme settings for Xcode 7.0. + [Marius Rackwitz](https://github.com/mrackwitz) + [Boris Bügling](https://github.com/neonichu) + [Xcodeproj#271](https://github.com/CocoaPods/Xcodeproj/pull/271) + ##### Bug Fixes * Fix the help output for `xcodeproj config-dump`.