Skip to content

Commit 61c30bb

Browse files
committed
Add project_header_files DSL to specifications.
1 parent 397fa25 commit 61c30bb

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
##### Enhancements
66

7+
* Add `project_header_files` DSL to specifications.
8+
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
9+
[#692](https://github.com/CocoaPods/Core/pull/692)
10+
711
* Add support for `on_demand_resources` DSL.
812
[JunyiXie](https://github.com/JunyiXie)
913
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)

lib/cocoapods-core/specification/consumer.rb

+4
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ def user_target_xcconfig
168168
#
169169
spec_attr_accessor :public_header_files
170170

171+
# @return [Array<String>] the project headers of the Pod.
172+
#
173+
spec_attr_accessor :project_header_files
174+
171175
# @return [Array<String>] the private headers of the Pod.
172176
#
173177
spec_attr_accessor :private_header_files

lib/cocoapods-core/specification/dsl.rb

+26
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,32 @@ def dependency=(args)
12591259

12601260
#------------------#
12611261

1262+
# @!method project_header_files=(project_header_files)
1263+
#
1264+
# A list of file patterns that should be used to mark project headers.
1265+
#
1266+
# ---
1267+
#
1268+
# These patterns are matched against the public headers (or all the
1269+
# headers if no public headers have been specified) to exclude those
1270+
# headers which should not be exposed to the user project and which
1271+
# should not be used to generate the documentation. When the library
1272+
# is built, these headers will _not_ appear in the build directory.
1273+
#
1274+
#
1275+
# @example
1276+
#
1277+
# spec.project_header_files = 'Headers/Project/*.h'
1278+
#
1279+
# @param [String, Array<String>] project_header_files
1280+
# the project headers of the Pod.
1281+
#
1282+
attribute :project_header_files,
1283+
:container => Array,
1284+
:file_patterns => true
1285+
1286+
#------------------#
1287+
12621288
# @!method private_header_files=(private_header_files)
12631289
#
12641290
# A list of file patterns that should be used to mark private headers.

spec/specification/consumer_spec.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,12 @@ module Pod
435435
@consumer.public_header_files.should == ['include/**/*']
436436
end
437437

438-
it 'returns the public headers files' do
438+
it 'returns the project headers files' do
439+
@spec.project_header_files = ['project/**/*']
440+
@consumer.project_header_files.should == ['project/**/*']
441+
end
442+
443+
it 'returns the private headers files' do
439444
@spec.private_header_files = ['private/**/*']
440445
@consumer.private_header_files.should == ['private/**/*']
441446
end

spec/specification/dsl_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ module Pod
415415
@spec.attributes_hash['public_header_files'].should == ['include/**/*']
416416
end
417417

418+
it 'allows to specify the project headers files' do
419+
@spec.project_header_files = ['project/**/*']
420+
@spec.attributes_hash['project_header_files'].should == ['project/**/*']
421+
end
422+
418423
it 'allows to specify the private headers files' do
419424
@spec.private_header_files = ['private/**/*']
420425
@spec.attributes_hash['private_header_files'].should == ['private/**/*']

0 commit comments

Comments
 (0)