Skip to content
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

Update comments/docs to indicate :skip will skip pch generation #412

Merged
merged 4 commits into from
Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

##### Enhancements

* None.
* Update commments/docs to indicate prefix_header=false will skip pch generation
[Paul Beusterien](https://github.com/paulb777)
[#412](https://github.com/CocoaPods/Core/pull/412)

##### Bug Fixes

Expand Down
6 changes: 6 additions & 0 deletions lib/cocoapods-core/specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ def consumer(platform)
@consumers[platform] ||= Consumer.new(self, platform)
end

# @return [Bool, String] The prefix_header_file value.
#
def prefix_header_file
attributes_hash['prefix_header_file']
end

#-------------------------------------------------------------------------#

public
Expand Down
19 changes: 15 additions & 4 deletions lib/cocoapods-core/specification/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -855,20 +855,31 @@ def dependency(*args)
#
# A path to a prefix header file to inject in the prefix header of the
# pod project.
# `false` indicates that the default CocoaPods prefix header should not
# be generated.
# `true` is the default and indicates that the default CocoaPods prefix
# header should be generated.
#
# ---
#
# This attribute is __not recommended__ as Pods should not pollute the
# prefix header of other libraries or of the user project.
# The file path options is __not recommended__ as Pods should not
# pollute the prefix header of other libraries or of the user project.
#
#
# @example
#
# spec.prefix_header_file = 'iphone/include/prefix.pch'
#
# @param [String] path
# The path to the prefix header file.
# @example
#
# spec.prefix_header_file = false
#
# @param [Bool, String] path
# The path to the prefix header file or whether to disable
# prefix_header generation.
#
attribute :prefix_header_file,
:types => [TrueClass, FalseClass, String],
Copy link
Member

Choose a reason for hiding this comment

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

What will setting it to true do?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added true for symmetry with false. If it is set, it will behave the same as if the option is not set at all and the default CocoaPods pch file will be generated.

See this test: https://github.com/paulb777/CocoaPods/blob/68abbb06a4a2d5adf9c5ce6361fab78af60be8f5/spec/unit/installer/xcode/pods_project_generator/pod_target_installer_spec.rb#L412

Copy link
Member

Choose a reason for hiding this comment

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

👍 but we should doc it

:inherited => true

#------------------#
Expand Down
5 changes: 5 additions & 0 deletions spec/specification/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ module Pod
@spec.attributes_hash['prefix_header_file'].should == 'iphone/include/prefix.pch'
end

it 'allows to skip prefix header file generation' do
@spec.prefix_header_file = false
@spec.attributes_hash['prefix_header_file'].should == false
end

it 'allows to specify a directory to use for the headers' do
@spec.header_dir = 'Three20Core'
@spec.attributes_hash['header_dir'].should == 'Three20Core'
Expand Down