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
c64bd68b
Commit
c64bd68b
authored
Feb 24, 2015
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3168 from CocoaPods/lint-as-framework
Lint as framework automatically
parents
16e5b431
2f76d351
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
6 deletions
+45
-6
CHANGELOG.md
CHANGELOG.md
+5
-0
lib.rb
lib/cocoapods/command/lib.rb
+2
-2
lint.rb
lib/cocoapods/command/spec/lint.rb
+2
-2
validator.rb
lib/cocoapods/validator.rb
+2
-2
validator_spec.rb
spec/unit/validator_spec.rb
+34
-0
No files found.
CHANGELOG.md
View file @
c64bd68b
...
@@ -60,6 +60,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -60,6 +60,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Boris Bügling
](
https://github.com/neonichu
)
[
Boris Bügling
](
https://github.com/neonichu
)
[
#3029
](
https://github.com/CocoaPods/CocoaPods/issues/3029
)
[
#3029
](
https://github.com/CocoaPods/CocoaPods/issues/3029
)
*
Lint as framework automatically. If needed,
`--use-libraries`
option
allows linting as a static library.
[
Boris Bügling
](
https://github.com/neonichu
)
[
#2912
](
https://github.com/CocoaPods/CocoaPods/issues/2912
)
##### Bug Fixes
##### Bug Fixes
*
Added support for .tpp C++ header files in specs (previously were getting
*
Added support for .tpp C++ header files in specs (previously were getting
...
...
lib/cocoapods/command/lib.rb
View file @
c64bd68b
...
@@ -113,7 +113,7 @@ module Pod
...
@@ -113,7 +113,7 @@ module Pod
[
'--subspec=NAME'
,
'Lint validates only the given subspec'
],
[
'--subspec=NAME'
,
'Lint validates only the given subspec'
],
[
'--no-subspecs'
,
'Lint skips validation of subspecs'
],
[
'--no-subspecs'
,
'Lint skips validation of subspecs'
],
[
'--no-clean'
,
'Lint leaves the build directory intact for inspection'
],
[
'--no-clean'
,
'Lint leaves the build directory intact for inspection'
],
[
'--use-
frameworks'
,
'Lint uses framework
s to install the spec'
],
[
'--use-
libraries'
,
'Lint uses static librarie
s to install the spec'
],
[
'--sources=https://github.com/artsy/Specs,master'
,
'The sources from which to pull dependant pods '
\
[
'--sources=https://github.com/artsy/Specs,master'
,
'The sources from which to pull dependant pods '
\
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'Multiple sources must be comma-delimited.'
]].
concat
(
super
)
'Multiple sources must be comma-delimited.'
]].
concat
(
super
)
...
@@ -125,7 +125,7 @@ module Pod
...
@@ -125,7 +125,7 @@ module Pod
@clean
=
argv
.
flag?
(
'clean'
,
true
)
@clean
=
argv
.
flag?
(
'clean'
,
true
)
@subspecs
=
argv
.
flag?
(
'subspecs'
,
true
)
@subspecs
=
argv
.
flag?
(
'subspecs'
,
true
)
@only_subspec
=
argv
.
option
(
'subspec'
)
@only_subspec
=
argv
.
option
(
'subspec'
)
@use_frameworks
=
argv
.
flag?
(
'use-framework
s'
)
@use_frameworks
=
!
argv
.
flag?
(
'use-librarie
s'
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@podspecs_paths
=
argv
.
arguments!
@podspecs_paths
=
argv
.
arguments!
super
super
...
...
lib/cocoapods/command/spec/lint.rb
View file @
c64bd68b
...
@@ -20,7 +20,7 @@ module Pod
...
@@ -20,7 +20,7 @@ module Pod
[
'--subspec=NAME'
,
'Lint validates only the given subspec'
],
[
'--subspec=NAME'
,
'Lint validates only the given subspec'
],
[
'--no-subspecs'
,
'Lint skips validation of subspecs'
],
[
'--no-subspecs'
,
'Lint skips validation of subspecs'
],
[
'--no-clean'
,
'Lint leaves the build directory intact for inspection'
],
[
'--no-clean'
,
'Lint leaves the build directory intact for inspection'
],
[
'--use-
frameworks'
,
'Lint uses framework
s to install the spec'
],
[
'--use-
libraries'
,
'Lint uses static librarie
s to install the spec'
],
[
'--sources=https://github.com/artsy/Specs,master'
,
'The sources from which to pull dependant pods '
\
[
'--sources=https://github.com/artsy/Specs,master'
,
'The sources from which to pull dependant pods '
\
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'Multiple sources must be comma-delimited.'
]].
concat
(
super
)
'Multiple sources must be comma-delimited.'
]].
concat
(
super
)
...
@@ -32,7 +32,7 @@ module Pod
...
@@ -32,7 +32,7 @@ module Pod
@clean
=
argv
.
flag?
(
'clean'
,
true
)
@clean
=
argv
.
flag?
(
'clean'
,
true
)
@subspecs
=
argv
.
flag?
(
'subspecs'
,
true
)
@subspecs
=
argv
.
flag?
(
'subspecs'
,
true
)
@only_subspec
=
argv
.
option
(
'subspec'
)
@only_subspec
=
argv
.
option
(
'subspec'
)
@use_frameworks
=
argv
.
flag?
(
'use-framework
s'
)
@use_frameworks
=
!
argv
.
flag?
(
'use-librarie
s'
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@podspecs_paths
=
argv
.
arguments!
@podspecs_paths
=
argv
.
arguments!
super
super
...
...
lib/cocoapods/validator.rb
View file @
c64bd68b
...
@@ -478,14 +478,14 @@ module Pod
...
@@ -478,14 +478,14 @@ module Pod
# @note The generated podfile takes into account whether the linter is
# @note The generated podfile takes into account whether the linter is
# in local mode.
# in local mode.
#
#
def
podfile_from_spec
(
platform_name
,
deployment_target
,
use_frameworks
=
nil
)
def
podfile_from_spec
(
platform_name
,
deployment_target
,
use_frameworks
=
true
)
name
=
subspec_name
?
subspec_name
:
spec
.
name
name
=
subspec_name
?
subspec_name
:
spec
.
name
podspec
=
file
.
realpath
podspec
=
file
.
realpath
local
=
local?
local
=
local?
urls
=
source_urls
urls
=
source_urls
podfile
=
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
urls
.
each
{
|
u
|
source
(
u
)
}
urls
.
each
{
|
u
|
source
(
u
)
}
use_frameworks!
(
use_frameworks
)
unless
use_frameworks
.
nil?
use_frameworks!
(
use_frameworks
)
platform
(
platform_name
,
deployment_target
)
platform
(
platform_name
,
deployment_target
)
if
local
if
local
pod
name
,
:path
=>
podspec
.
dirname
.
to_s
pod
name
,
:path
=>
podspec
.
dirname
.
to_s
...
...
spec/unit/validator_spec.rb
View file @
c64bd68b
...
@@ -442,6 +442,40 @@ module Pod
...
@@ -442,6 +442,40 @@ module Pod
end
end
end
end
describe
'frameworks'
do
before
do
@validator
=
Validator
.
new
(
podspec_path
,
SourcesManager
.
master
.
map
(
&
:url
))
end
def
setup_validator
@validator
.
stubs
(
:validate_url
)
@validator
.
stubs
(
:validate_screenshots
)
@validator
.
stubs
(
:check_file_patterns
)
Installer
.
any_instance
.
stubs
(
:install!
)
Installer
.
any_instance
.
stubs
(
:aggregate_targets
).
returns
([])
end
it
'lints as a framework if specified'
do
@validator
.
use_frameworks
=
true
setup_validator
@validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
true
).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
true
).
once
@validator
.
send
(
:perform_extensive_analysis
,
@validator
.
spec
)
end
it
'lint as a static library if specified'
do
@validator
.
use_frameworks
=
false
setup_validator
@validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
false
).
once
@validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
false
).
once
@validator
.
send
(
:perform_extensive_analysis
,
@validator
.
spec
)
end
end
describe
'swift validation'
do
describe
'swift validation'
do
def
test_swiftpod
def
test_swiftpod
podspec
=
stub_podspec
(
/.*source_files.*/
,
'"source_files": "*.swift",'
)
podspec
=
stub_podspec
(
/.*source_files.*/
,
'"source_files": "*.swift",'
)
...
...
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