Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
85308974
Commit
85308974
authored
May 09, 2012
by
Gwendal Roué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#221] Pod::Spec#public_header_files accepted and validated by `pod spec lint`
parent
81d3550d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
spec.rb
lib/cocoapods/command/spec.rb
+16
-1
file_list.rb
lib/cocoapods/file_list.rb
+1
-1
specification.rb
lib/cocoapods/specification.rb
+9
-2
No files found.
lib/cocoapods/command/spec.rb
View file @
85308974
...
@@ -298,7 +298,7 @@ module Pod
...
@@ -298,7 +298,7 @@ module Pod
def
paths_starting_with_a_slash_errors
def
paths_starting_with_a_slash_errors
messages
=
[]
messages
=
[]
%w[source_files resources clean_paths]
.
each
do
|
accessor
|
%w[source_files
public_header_files
resources clean_paths]
.
each
do
|
accessor
|
patterns
=
spec
.
send
(
accessor
.
to_sym
)
patterns
=
spec
.
send
(
accessor
.
to_sym
)
# Some values are multiplaform
# Some values are multiplaform
patterns
=
patterns
.
is_a?
(
Hash
)
?
patterns
.
values
.
flatten
(
1
)
:
patterns
patterns
=
patterns
.
is_a?
(
Hash
)
?
patterns
.
values
.
flatten
(
1
)
:
patterns
...
@@ -400,6 +400,10 @@ module Pod
...
@@ -400,6 +400,10 @@ module Pod
# at least one file. It requires the pods to be alredy present
# at least one file. It requires the pods to be alredy present
# in the current working directory under Pods/spec.name
# in the current working directory under Pods/spec.name
#
#
# The exceptions are public_header_files and clean_paths,
# since a Spec may declare an explicit empty list of public
# header files, and an explicit empty of paths to be cleaned up.
#
# It returns a array of messages
# It returns a array of messages
#
#
def
file_patterns_errors_for_platfrom
(
platform_name
)
def
file_patterns_errors_for_platfrom
(
platform_name
)
...
@@ -535,6 +539,17 @@ Pod::Spec.new do |s|
...
@@ -535,6 +539,17 @@ Pod::Spec.new do |s|
s.description = 'An optional longer description of
#{
data
[
:name
]
}
.'
s.description = 'An optional longer description of
#{
data
[
:name
]
}
.'
# A list of file patterns which select the header files that should be
# made available to the application. If the pattern is a directory then the
# path will automatically have '*.h' appended.
#
# Also allows the use of the FileList class like `source_files does.
#
# If you do not explicitely set the list of public header files,
# all headers of source_files will be made public.
#
# s.public_header_files = 'Classes/**/*.h'
# If this Pod runs only on iOS or OS X, then specify the platform and
# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target.
# the deployment target.
#
#
...
...
lib/cocoapods/file_list.rb
View file @
85308974
...
@@ -5,7 +5,7 @@ else
...
@@ -5,7 +5,7 @@ else
end
end
# This makes Rake::FileList usable with the Specification attributes
# This makes Rake::FileList usable with the Specification attributes
# source_files, clean_paths, and resources.
# source_files,
public_header_files,
clean_paths, and resources.
module
Rake
module
Rake
class
FileList
class
FileList
...
...
lib/cocoapods/specification.rb
View file @
85308974
...
@@ -33,7 +33,7 @@ module Pod
...
@@ -33,7 +33,7 @@ module Pod
def
post_initialize
def
post_initialize
@define_for_platforms
=
[
:osx
,
:ios
]
@define_for_platforms
=
[
:osx
,
:ios
]
@clean_paths
,
@subspecs
=
[],
[]
@clean_paths
,
@subspecs
=
[],
[]
@dependencies
,
@source_files
,
@
resources
=
{
:ios
=>
[],
:osx
=>
[]
},
{
:ios
=>
[],
:osx
=>
[]
},
{
:ios
=>
[],
:osx
=>
[]
}
@dependencies
,
@source_files
,
@
public_header_files
,
@resources
=
{
:ios
=>
[],
:osx
=>
[]
},
{
:ios
=>
[],
:osx
=>
[]
},
{
:ios
=>
nil
,
:osx
=>
nil
},
{
:ios
=>
[],
:osx
=>
[]
}
@deployment_target
=
{}
@deployment_target
=
{}
@platform
=
Platform
.
new
(
nil
)
@platform
=
Platform
.
new
(
nil
)
@xcconfig
=
{
:ios
=>
Xcodeproj
::
Config
.
new
,
:osx
=>
Xcodeproj
::
Config
.
new
}
@xcconfig
=
{
:ios
=>
Xcodeproj
::
Config
.
new
,
:osx
=>
Xcodeproj
::
Config
.
new
}
...
@@ -155,7 +155,7 @@ module Pod
...
@@ -155,7 +155,7 @@ module Pod
@specification
,
@platform
=
specification
,
platform
@specification
,
@platform
=
specification
,
platform
end
end
%w{ source_files= resource= resources= xcconfig= framework= frameworks= library= libraries= compiler_flags= deployment_target= dependency }
.
each
do
|
method
|
%w{ source_files=
public_header_files=
resource= resources= xcconfig= framework= frameworks= library= libraries= compiler_flags= deployment_target= dependency }
.
each
do
|
method
|
define_method
(
method
)
do
|
args
|
define_method
(
method
)
do
|
args
|
@specification
.
_on_platform
(
@platform
)
do
@specification
.
_on_platform
(
@platform
)
do
@specification
.
send
(
method
,
args
)
@specification
.
send
(
method
,
args
)
...
@@ -179,6 +179,13 @@ module Pod
...
@@ -179,6 +179,13 @@ module Pod
end
end
attr_reader
:source_files
attr_reader
:source_files
def
public_header_files
=
(
patterns
)
@define_for_platforms
.
each
do
|
platform
|
@public_header_files
[
platform
]
=
pattern_list
(
patterns
)
end
end
attr_reader
:public_header_files
def
deployment_target
=
(
version
)
def
deployment_target
=
(
version
)
raise
Informative
,
"The deployment target must be defined per platform like s.ios.deployment_target = '5.0'"
unless
@define_for_platforms
.
count
==
1
raise
Informative
,
"The deployment target must be defined per platform like s.ios.deployment_target = '5.0'"
unless
@define_for_platforms
.
count
==
1
@deployment_target
[
@define_for_platforms
.
first
]
=
version
@deployment_target
[
@define_for_platforms
.
first
]
=
version
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment