Commit f5d7b5bc authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #6558 from dnkoutso/fix_regression

Only share pod target xcscheme if present during validation.
parents 9d078b8b 2222aaaf
......@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
* Only share pod target xcscheme if present during validation.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6558](https://github.com/CocoaPods/CocoaPods/pull/6558)
* Properly compile storyboard for watch device family.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6516](https://github.com/CocoaPods/CocoaPods/issues/6516)
......
......@@ -428,7 +428,8 @@ module Pod
add_xctest(app_target) if @installer.pod_targets.any? { |pt| pt.spec_consumers.any? { |c| c.frameworks.include?('XCTest') } }
app_project.save
Xcodeproj::XCScheme.share_scheme(app_project.path, 'App')
Xcodeproj::XCScheme.share_scheme(@installer.pods_project.path, pod_target.label)
# Share the pods xcscheme only if it exists. For pre-built vendored pods there is no xcscheme generated.
Xcodeproj::XCScheme.share_scheme(@installer.pods_project.path, pod_target.label) if shares_pod_target_xcscheme?(pod_target)
end
def add_swift_version(app_target)
......@@ -669,6 +670,10 @@ module Pod
add_result(:note, *args)
end
def shares_pod_target_xcscheme?(pod_target)
Pathname.new(@installer.pods_project.path + pod_target.label).exist?
end
def add_result(type, attribute_name, message, public_only = false)
result = results.find do |r|
r.type == type && r.attribute_name && r.message == message && r.public_only? == public_only
......
......@@ -614,6 +614,7 @@ module Pod
installer.stubs(:pods_project).returns(pods_project)
Xcodeproj::XCScheme.expects(:share_scheme).with(app_project_path, 'App').once
Xcodeproj::XCScheme.expects(:share_scheme).with(pods_project.path, 'BananaLib').once
@validator.stubs(:shares_pod_target_xcscheme?).returns(true)
@validator.instance_variable_set(:@installer, installer)
@validator.send(:add_app_project_import)
......@@ -636,6 +637,7 @@ module Pod
installer.stubs(:pods_project).returns(pods_project)
Xcodeproj::XCScheme.expects(:share_scheme).with(app_project_path, 'App').once
Xcodeproj::XCScheme.expects(:share_scheme).with(pods_project.path, 'BananaLib').once
@validator.stubs(:shares_pod_target_xcscheme?).returns(true)
@validator.instance_variable_set(:@installer, installer)
@validator.send(:add_app_project_import)
......@@ -644,6 +646,22 @@ module Pod
bc.build_settings['FRAMEWORK_SEARCH_PATHS']
end.uniq.should == [%w($(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks")]
end
it 'does not share xcscheme for pod target if there isnt one' do
@validator.send(:create_app_project)
pods_project = Xcodeproj::Project.new(@validator.validation_dir + 'Pods/Pods.xcodeproj')
app_project_path = @validator.validation_dir + 'App.xcodeproj'
pod_target = fixture_pod_target('banana-lib/BananaLib.podspec')
pod_target.stubs(:uses_swift? => true, :pod_name => 'JSONKit')
pod_target.spec_consumers.first.stubs(:frameworks).returns(%w(XCTest))
installer = stub(:pod_targets => [pod_target])
installer.stubs(:pods_project).returns(pods_project)
Xcodeproj::XCScheme.expects(:share_scheme).with(app_project_path, 'App').once
Xcodeproj::XCScheme.expects(:share_scheme).with(pods_project.path, 'BananaLib').never
@validator.stubs(:shares_pod_target_xcscheme?).returns(false)
@validator.instance_variable_set(:@installer, installer)
@validator.send(:add_app_project_import)
end
end
describe 'file pattern validation' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment