8000 Add support for preventing pch file generation by paulb777 · Pull Request #7044 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for preventing pch file generation #7044

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 2 commits into from
Sep 28, 2017
Merged

Add support for preventing pch file generation #7044

merged 2 commits into from
Sep 28, 2017

Conversation

paulb777
Copy link
Member
@paulb777 paulb777 commented Sep 17, 2017

Issue: #6815
See also CocoaPods/Core#406.

Prevent pch file generation with the skip_pch podspec attribute.

Address #1691 and #1746. More context at https://stackoverflow.com/questions/44401464/is-there-a-way-to-disable-the-default-pch-file-in-cocoapods

@paulb777
Copy link
Member Author

The corresponding Core PR (docs only) is CocoaPods/Core#412

# @return [Boolean] Whether the target should build a pch file.
#
def skip_pch?
target.file_accessors.any? { |file_accessor| file_accessor.prefix_header == ':skip' }
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason to query each file accessor? I believe that method asks the spec itself which i think you have this information here.

I am only saying this because file accessors tend to be slow generally...

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right. Changed. Thanks!

@paulb777
Copy link
Member Author

Now requires CocoaPods/Core#412 to go green

@@ -476,6 +503,19 @@ class PodsProjectGenerator
]
end

it 'verifies disabling prefix header generation' do
Copy link
Contributor
@dnkoutso dnkoutso Sep 25, 2017

Choose a reason for hiding this comment

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

nit: same test name as the one above, unless this is a pattern across this file?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, there's the same test name for within and without a scoped target

CHANGELOG.md Outdated
@@ -45,6 +45,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[paulb777](https://github.com/paulb777)
[#6988](https://github.com/CocoaPods/CocoaPods/pull/6988)

* Add support for preventing pch file generation with the skip_pch podspec attribute
Copy link
Contributor

Choose a reason for hiding this comment

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

probably want to move up to the master section since 1.4.0.beta.1 shipped!

'BananaLib 8000 -Pods-SampleProject-prefix.pch',
'BananaLib-Pods-SampleProject.xcconfig',
]
group.children.map(&:display_name).sort.should.not == [
Copy link
Contributor
@dnkoutso dnkoutso Sep 27, 2017

Choose a reason for hiding this comment

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

what does assertion actually check for in this specific test? I would imagine that there should be a .pch file if the value is set to true which is verified right above.

Copy link
Member Author

Choose a reason for hiding this comment

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

The should test should be sufficient since it is testing for an exact match of the list. Deleting the not's

'BananaLib-Pods-SampleProject-dummy.m',
'BananaLib-Pods-SampleProject.xcconfig',
]
group.children.map(&:display_name).sort.should.not == [
< 8000 span data-view-component="true"> Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use should.not.include?

'BananaLib-dummy.m',
'BananaLib.xcconfig',
]
group.children.map(&:display_name).sort.should.not == [
Copy link
Contributor

Choose a reason for hiding this comment

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

same should.not.include?

@dnkoutso dnkoutso merged commit 12c8d1d into CocoaPods:master Sep 28, 2017
@dnkoutso
Copy link
Contributor

:shipit:

@dnkoutso dnkoutso added this to the 1.4.0 milestone Sep 28, 2017
@paulb777 paulb777 deleted the skip-pch branch September 28, 2017 03:55
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.

2 participants
0