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
11ec1224
Commit
11ec1224
authored
Mar 04, 2015
by
Boris Bügling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Lint dynamic libs for iOS > 7.
parent
563225d1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
0 deletions
+34
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
validator.rb
lib/cocoapods/validator.rb
+14
-0
empty.dylib
spec/fixtures/empty.dylib
+0
-0
validator_spec.rb
spec/unit/validator_spec.rb
+16
-0
No files found.
CHANGELOG.md
View file @
11ec1224
...
@@ -25,6 +25,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -25,6 +25,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Boris Bügling
](
https://github.com/neonichu
)
[
Boris Bügling
](
https://github.com/neonichu
)
[
#3194
](
https://github.com/CocoaPods/CocoaPods/issues/3194
)
[
#3194
](
https://github.com/CocoaPods/CocoaPods/issues/3194
)
*
Lint to prevent dynamic libraries and frameworks from passing with iOS 7.
[
Boris Bügling
](
https://github.com/neonichu
)
[
#3193
](
https://github.com/CocoaPods/CocoaPods/issues/3193
)
## 0.36.0.rc.1
## 0.36.0.rc.1
...
...
lib/cocoapods/validator.rb
View file @
11ec1224
...
@@ -213,6 +213,7 @@ module Pod
...
@@ -213,6 +213,7 @@ module Pod
@consumer
=
spec
.
consumer
(
platform
)
@consumer
=
spec
.
consumer
(
platform
)
setup_validation_environment
setup_validation_environment
install_pod
install_pod
validate_vendored_dynamic_frameworks
build_pod
build_pod
check_file_patterns
check_file_patterns
tear_down_validation_environment
tear_down_validation_environment
...
@@ -322,6 +323,19 @@ module Pod
...
@@ -322,6 +323,19 @@ module Pod
config
.
silent
config
.
silent
end
end
def
validate_vendored_dynamic_frameworks
deployment_target
=
spec
.
subspec_by_name
(
subspec_name
).
deployment_target
(
consumer
.
platform_name
)
unless
file_accessor
.
nil?
dynamic_frameworks
=
file_accessor
.
vendored_frameworks
.
select
{
|
fw
|
`file
#{
fw
+
fw
.
basename
(
'.framework'
)
}
2>&1`
=~
/dynamically linked/
}
dynamic_libraries
=
file_accessor
.
vendored_libraries
.
select
{
|
lib
|
`file
#{
lib
}
2>&1`
=~
/dynamically linked/
}
if
(
dynamic_frameworks
.
count
>
0
||
dynamic_libraries
.
count
>
0
)
&&
consumer
.
platform_name
==
:ios
&&
(
deployment_target
.
nil?
||
Version
.
new
(
deployment_target
).
major
<
8
)
error
(
'dynamic'
,
'Dynamic frameworks and libraries are only supported on iOS 8.0 and onwards.'
)
end
end
end
# Performs platform specific analysis. It requires to download the source
# Performs platform specific analysis. It requires to download the source
# at each iteration
# at each iteration
#
#
...
...
spec/fixtures/empty.dylib
0 → 100755
View file @
11ec1224
File added
spec/unit/validator_spec.rb
View file @
11ec1224
...
@@ -485,6 +485,22 @@ module Pod
...
@@ -485,6 +485,22 @@ module Pod
end
end
end
end
describe
'dynamic binaries validation'
do
it
'fails with dynamic binaries on iOS < 8'
do
podspec
=
stub_podspec
(
/.*license.*$/
,
'"license": "Public Domain",'
)
file
=
write_podspec
(
podspec
)
Pod
::
Sandbox
::
FileAccessor
.
any_instance
.
stubs
(
:vendored_libraries
).
returns
([
fixture
(
'empty.dylib'
)])
validator
=
Validator
.
new
(
file
,
SourcesManager
.
master
.
map
(
&
:url
))
validator
.
stubs
(
:build_pod
)
validator
.
stubs
(
:validate_url
)
validator
.
validate
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/Dynamic frameworks.*iOS 8.0 and onwards/
validator
.
result_type
.
should
==
:error
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