8000 Add a Target::BuildType to represent how a target is built by segiddins · Pull Request #8232 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a Target::BuildType to represent how a target is built #8232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 12, 2018

Conversation

segiddins
Copy link
Member
@segiddins segiddins commented Oct 29, 2018

This centralizes logic for static/dynamic library/framework in a single place, and will make future per-target configuration much easier.

  • Docs
  • Tests for the new class
  • Update integration specs
  • Rebase

8000
@CocoaPodsBarista
Copy link
CocoaPodsBarista commented Oct 29, 2018
1 Warning
⚠️ Please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.

Here's an example of your CHANGELOG entry:

* Add a Target::BuildType to represent how a target is built  
  [segiddins](https://github.com/segiddins)
  [#issue_number](https://github.com/CocoaPods/CocoaPods/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

@dnkoutso dnkoutso added this to the 1.7.0 milestone Oct 29, 2018
Copy link
Member
@amorde amorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great 👍 👍

'Pods-Sample Extensions Project/Release/matryoshka-Bar-Foo',
'Pods-Sample Extensions Project/Release/monkey',
'Pods-Today Extension/Release/matryoshka-Bar',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how was this passing before? 🤔

Copy link
Member
@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great step forward! Thanks @segiddins!

@@ -713,7 +726,7 @@ def specs
@target.pod_targets.each { |pt| pt.spec_consumers.each { |sc| sc.stubs(:frameworks => %w(UIKit), :libraries => %w(z c++)) } }

@xcconfig = @generator.generate
@xcconfig.to_hash['OTHER_LDFLAGS'].should == '$(inherited) -ObjC -l"c++" -l"z" -framework "UIKit"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is -ObjC gone?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there are actually no pod targets, and thus no static binaries being linked!

@@ -117,6 +117,9 @@ def search_for_exceptions(exception)
inspector = GhInspector::Inspector.new 'cocoapods', 'cocoapods'
message_delegate = UserInterface::InspectorReporter.new
inspector.search_exception exception, message_delegate
rescue => e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we merge this in a different pr?

@segiddins segiddins changed the title Add a Target::Type to represent how a target is built Add a Target::BuildType to represent how a target is built Nov 9, 2018
@segiddins segiddins force-pushed the segiddins/target-type branch from 4f47830 to 183d6b4 Compare November 9, 2018 23:36
@segiddins segiddins merged commit 40ddd99 into master Nov 12, 2018
@segiddins segiddins deleted the segiddins/target-type branch November 12, 2018 19:20
@dnkoutso
Copy link
Contributor

whoohooooo

@@ -211,7 +211,7 @@ def wire_target_dependencies(project, target_installation_results)
# First, wire up all resource bundles.
pod_target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
native_target.add_dependency(resource_bundle_target)
if pod_target.requires_frameworks? && pod_target.should_build?
if pod_target.build_as_dynamic_framework? && pod_target.should_build?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not the same as it used to be before

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that the static_framework pod with resources still works.

@@ -205,7 +205,7 @@ def save_as(path)

# @return [String]
define_build_settings_method :code_sign_identity, :build_setting => true do
return unless target.requires_frameworks?
return unless target.build_as_dynamic?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, I think this is not the same as it used to be before

@@ -1022,7 +1024,7 @@ def other_swift_flags_without_swift?

# @return [Array<String>]
define_build_settings_method :ld_runpath_search_paths, :build_setting => true, :memoized => true, :uniqued => true do
return unless target.requires_frameworks? || any_vendored_dynamic_artifacts?
return unless pod_targets.any?(&:build_as_dynamic?) || any_vendored_dynamic_artifacts?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@dnkoutso
Copy link
Contributor

@paulb777 I think there are some entries here that are not the semantically the same as before.

@@ -86,7 +86,7 @@ def install!
end
end

if target.requires_frameworks?
if target.build_as_dynamic_framework?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for this one

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the old logic, but may need to change to eliminate warnings with the new build system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0