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
0feb5f1d
Commit
0feb5f1d
authored
Nov 15, 2013
by
Joshua Kalpin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master'
Conflicts: CHANGELOG.md
parents
cd6354a5
f09bb136
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
74 deletions
+124
-74
CHANGELOG.md
CHANGELOG.md
+6
-0
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+2
-1
spec_spec.rb
spec/functional/command/spec_spec.rb
+19
-7
xcconfig_helper_spec.rb
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
+18
-3
validator_spec.rb
spec/unit/validator_spec.rb
+79
-63
No files found.
CHANGELOG.md
View file @
0feb5f1d
...
...
@@ -6,6 +6,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
###### Bug Fixes
*
Fixed the developer frameworks search paths so that
`$(SDKROOT)/Developer/Library/Frameworks`
is used for iOS and
`$(DEVELOPER_LIBRARY_DIR)/Frameworks`
is used for OS X
[
Kevin Wales
](
https://github.com/kwales
)
[
#1562
](
https://github.com/CocoaPods/pull/1562
)
*
When updating the pod repos, repositories with unreachable remotes
are now ignored. This fixes an issue with certain private repositories.
[
Joshua Kalpin
](
https://github.com/Kapin
)
...
...
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
0feb5f1d
...
...
@@ -103,9 +103,10 @@ module Pod
search_paths
=
xcconfig
.
attributes
[
'FRAMEWORK_SEARCH_PATHS'
]
||=
''
search_paths_to_add
=
[]
search_paths_to_add
<<
'$(inherited)'
search_paths_to_add
<<
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
if
platform
==
:ios
search_paths_to_add
<<
'"$(SDKROOT)/Developer/Library/Frameworks"'
else
search_paths_to_add
<<
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
end
search_paths_to_add
.
each
do
|
search_path
|
unless
search_paths
.
include?
(
search_path
)
...
...
spec/functional/command/spec_spec.rb
View file @
0feb5f1d
...
...
@@ -15,6 +15,7 @@ module Pod
lambda
{
run_command
(
'spec'
,
'which'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'spec'
,
'cat'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'spec'
,
'edit'
)
}.
should
.
raise
CLAide
::
Help
lambda
{
run_command
(
'spec'
,
'browse'
)
}.
should
.
raise
CLAide
::
Help
end
end
...
...
@@ -174,32 +175,43 @@ module Pod
#-------------------------------------------------------------------------#
de
scribe
Command
::
Spec
::
Which
do
de
f
it_should_check_for_existence
(
command
)
it
"errors if a given podspec doesn't exist"
do
e
=
lambda
{
command
(
'spec'
,
'which'
,
'some_pod_that_doesnt_exist'
).
run
}.
should
.
raise
Informative
e
=
lambda
{
command
(
'spec'
,
command
,
'some_pod_that_doesnt_exist'
).
run
}.
should
.
raise
Informative
e
.
message
.
should
.
match
/Unable to find a pod with/
end
end
def
it_should_check_for_ambiguity
(
command
)
it
"complains provided spec name is ambigious"
do
e
=
lambda
{
command
(
'spec'
,
command
,
'AF'
).
run
}.
should
.
raise
Informative
e
.
message
.
should
.
match
/More than one/
end
end
describe
Command
::
Spec
::
Which
do
it_should_check_for_existence
(
"which"
)
it_should_check_for_ambiguity
(
"which"
)
it
"prints the path of a given podspec"
do
lambda
{
command
(
'spec'
,
'which'
,
'AFNetworking'
).
run
}.
should
.
not
.
raise
text
=
"AFNetworking.podspec"
UI
.
output
.
should
.
include
text
.
gsub
(
/\n/
,
''
)
end
it
"complains provided spec name is ambigious"
do
e
=
lambda
{
command
(
'spec'
,
'cat'
,
'AF'
).
run
}.
should
.
raise
Informative
e
.
message
.
should
.
match
/More than one/
end
end
#-------------------------------------------------------------------------#
describe
Command
::
Spec
::
Cat
do
it_should_check_for_existence
(
"cat"
)
it_should_check_for_ambiguity
(
"cat"
)
end
#-------------------------------------------------------------------------#
describe
Command
::
Spec
::
Edit
do
it_should_check_for_existence
(
"edit"
)
it_should_check_for_ambiguity
(
"edit"
)
end
#-------------------------------------------------------------------------#
...
...
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
View file @
0feb5f1d
...
...
@@ -94,7 +94,7 @@ module Pod
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-weak_framework iAd'
end
it
"adds the developer frameworks search paths if needed"
do
it
"adds the
ios
developer frameworks search paths if needed"
do
xcconfig
=
Xcodeproj
::
Config
.
new
consumer
=
stub
({
:xcconfig
=>
{},
...
...
@@ -104,7 +104,22 @@ module Pod
:platform_name
=>
:ios
})
@sut
.
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
.
include
(
'SDKROOT'
)
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
.
not
.
include
(
'DEVELOPER_LIBRARY_DIR'
)
end
it
"adds the osx developer frameworks search paths if needed"
do
xcconfig
=
Xcodeproj
::
Config
.
new
consumer
=
stub
({
:xcconfig
=>
{},
:libraries
=>
[],
:frameworks
=>
[
'SenTestingKit'
],
:weak_frameworks
=>
[],
:platform_name
=>
:osx
})
@sut
.
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
.
include
(
'DEVELOPER_LIBRARY_DIR'
)
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
.
not
.
include
(
'SDKROOT'
)
end
end
...
...
@@ -159,7 +174,7 @@ module Pod
frameworks_search_paths
=
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
]
frameworks_search_paths
.
should
.
include?
(
'$(inherited)'
)
frameworks_search_paths
.
should
.
include?
(
'"$(SDKROOT)/Developer/Library/Frameworks"'
)
frameworks_search_paths
.
should
.
include?
(
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
)
frameworks_search_paths
.
should
.
not
.
include?
(
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
)
end
it
"adds the developer frameworks search paths to the xcconfig if XCTest has been detected"
do
...
...
@@ -168,7 +183,7 @@ module Pod
frameworks_search_paths
=
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
]
frameworks_search_paths
.
should
.
include?
(
'$(inherited)'
)
frameworks_search_paths
.
should
.
include?
(
'"$(SDKROOT)/Developer/Library/Frameworks"'
)
frameworks_search_paths
.
should
.
include?
(
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
)
frameworks_search_paths
.
should
.
not
.
include?
(
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
)
end
it
"doesn't adds the developer frameworks relative to the SDK for OS X"
do
...
...
spec/unit/validator_spec.rb
View file @
0feb5f1d
...
...
@@ -32,96 +32,112 @@ module Pod
#-------------------------------------------------------------------------#
describe
"Quick mode"
do
it
"validates a correct podspec"
do
validator
=
Validator
.
new
(
podspec_path
)
validator
.
quick
=
true
validator
.
validate
validator
.
results
.
should
==
[]
validator
.
validated?
.
should
.
be
.
true
sut
=
Validator
.
new
(
podspec_path
)
sut
.
quick
=
true
sut
.
validate
sut
.
results
.
should
==
[]
sut
.
validated?
.
should
.
be
.
true
end
it
"lints the podspec during validation"
do
podspec
=
stub_podspec
(
/s.name.*$/
,
's.name = "TEST"'
)
file
=
write_podspec
(
podspec
)
validator
=
Validator
.
new
(
file
)
validator
.
quick
=
true
validator
.
validate
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/should match the name/
validator
.
validated?
.
should
.
be
.
false
sut
=
Validator
.
new
(
file
)
sut
.
quick
=
true
sut
.
validate
sut
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/should match the name/
sut
.
validated?
.
should
.
be
.
false
end
it
"uses xcodebuild to generate notes and warnings"
do
validator
=
Validator
.
new
(
podspec_path
)
validator
.
stubs
(
:check_file_patterns
)
validator
.
stubs
(
:xcodebuild
).
returns
(
"file.m:1:1: warning: direct access to objective-c's isa is deprecated"
)
validator
.
validate
first
=
validator
.
results
.
map
(
&
:to_s
).
first
first
.
should
.
include
"[xcodebuild]"
validator
.
result_type
.
should
==
:note
it
"respects quick mode"
do
file
=
write_podspec
(
stub_podspec
)
sut
=
Validator
.
new
(
file
)
sut
.
quick
=
true
sut
.
expects
(
:perform_extensive_analysis
).
never
sut
.
validate
end
it
"checks for file patterns"
do
file
=
write_podspec
(
stub_podspec
(
/s\.source_files = 'JSONKit\.\*'/
,
"s.source_files = 'wrong_paht.*'"
))
validator
=
Validator
.
new
(
file
)
validator
.
stubs
(
:build_pod
)
validator
.
validate
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/source_files.*did not match/
validator
.
result_type
.
should
==
:error
it
"respects the only errors option"
do
podspec
=
stub_podspec
(
/s.summary.*/
,
"s.summary = 'A short description of'"
)
file
=
write_podspec
(
podspec
)
sut
=
Validator
.
new
(
file
)
sut
.
quick
=
true
sut
.
only_errors
=
true
sut
.
validate
sut
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/summary.*meaningful/
sut
.
validated?
.
should
.
be
.
true
end
it
"validates a podspec with dependencies"
do
podspec
=
stub_podspec
(
/s.name.*$/
,
's.name = "ZKit"'
)
podspec
.
gsub!
(
/s.requires_arc/
,
"s.dependency 'SBJson', '~> 3.2'
\n
s.requires_arc"
)
podspec
.
gsub!
(
/s.license.*$/
,
's.license = "Public Domain"'
)
file
=
write_podspec
(
podspec
,
"ZKit.podspec"
)
spec
=
Specification
.
from_file
(
file
)
validator
=
Validator
.
new
(
spec
)
validator
.
validate
validator
.
validated?
.
should
.
be
.
true
end
#--------------------------------------#
#--------------------------------------
-----------------------------------
#
it
"respects quick mode"
do
describe
"Extensive analysis"
do
it
"respects the no clean option"
do
file
=
write_podspec
(
stub_podspec
)
validator
=
Validator
.
new
(
file
)
validator
.
quick
=
true
validator
.
expects
(
:perform_extensive_analysis
).
never
validator
.
validate
sut
=
Validator
.
new
(
file
)
sut
.
no_clean
=
true
sut
.
validate
sut
.
validation_dir
.
should
.
exist
end
it
"respects the no clean option
"
do
it
"builds the pod per platform
"
do
file
=
write_podspec
(
stub_podspec
)
validator
=
Validator
.
new
(
file
)
validator
.
no_clean
=
true
validator
.
validate
validator
.
validation_dir
.
should
.
exist
sut
=
Validator
.
new
(
file
)
sut
.
expects
(
:install_pod
).
twice
sut
.
expects
(
:build_pod
).
twice
sut
.
expects
(
:check_file_patterns
).
twice
sut
.
validate
end
it
"uses the deployment target of the specification"
do
sut
=
Validator
.
new
(
podspec_path
)
podfile
=
sut
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
dependency
=
podfile
.
target_definitions
[
'Pods'
].
dependencies
.
first
dependency
.
external_source
.
has_key?
(
:podspec
).
should
.
be
.
true
end
it
"respects the local option"
do
validator
=
Validator
.
new
(
podspec_path
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
sut
=
Validator
.
new
(
podspec_path
)
podfile
=
sut
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
deployment_target
=
podfile
.
target_definitions
[
'Pods'
].
platform
.
deployment_target
deployment_target
.
to_s
.
should
==
"5.0"
end
it
"respects the only errors option"
do
podspec
=
stub_podspec
(
/s.summary.*/
,
"s.summary = 'A short description of'"
)
file
=
write_podspec
(
podspec
)
validator
=
Validator
.
new
(
file
)
validator
.
quick
=
true
validator
.
only_errors
=
true
validator
.
validate
validator
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/summary.*meaningful/
validator
.
validated?
.
should
.
be
.
true
it
"uses xcodebuild to generate notes and warnings"
do
sut
=
Validator
.
new
(
podspec_path
)
sut
.
stubs
(
:check_file_patterns
)
sut
.
stubs
(
:xcodebuild
).
returns
(
"file.m:1:1: warning: direct access to objective-c's isa is deprecated"
)
sut
.
validate
first
=
sut
.
results
.
map
(
&
:to_s
).
first
first
.
should
.
include
"[xcodebuild]"
sut
.
result_type
.
should
==
:note
end
it
"uses the deployment target of the specification"
do
validator
=
Validator
.
new
(
podspec_path
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
dependency
=
podfile
.
target_definitions
[
'Pods'
].
dependencies
.
first
dependency
.
external_source
.
has_key?
(
:podspec
).
should
.
be
.
true
it
"checks for file patterns"
do
file
=
write_podspec
(
stub_podspec
(
/s\.source_files = 'JSONKit\.\*'/
,
"s.source_files = 'wrong_paht.*'"
))
sut
=
Validator
.
new
(
file
)
sut
.
stubs
(
:build_pod
)
sut
.
validate
sut
.
results
.
map
(
&
:to_s
).
first
.
should
.
match
/source_files.*did not match/
sut
.
result_type
.
should
==
:error
end
it
"validates a podspec with dependencies"
do
podspec
=
stub_podspec
(
/s.name.*$/
,
's.name = "ZKit"'
)
podspec
.
gsub!
(
/s.requires_arc/
,
"s.dependency 'SBJson', '~> 3.2'
\n
s.requires_arc"
)
podspec
.
gsub!
(
/s.license.*$/
,
's.license = "Public Domain"'
)
file
=
write_podspec
(
podspec
,
"ZKit.podspec"
)
spec
=
Specification
.
from_file
(
file
)
sut
=
Validator
.
new
(
spec
)
sut
.
validate
sut
.
validated?
.
should
.
be
.
true
end
end
#-------------------------------------------------------------------------#
end
end
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