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
76432759
Commit
76432759
authored
Feb 04, 2014
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Validate the configs a pos is whitelisted for.
parent
028921ab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
3 deletions
+39
-3
Gemfile.lock
Gemfile.lock
+2
-2
installer.rb
lib/cocoapods/installer.rb
+14
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+22
-0
No files found.
Gemfile.lock
View file @
76432759
...
@@ -7,7 +7,7 @@ GIT
...
@@ -7,7 +7,7 @@ GIT
GIT
GIT
remote: https://github.com/CocoaPods/Core.git
remote: https://github.com/CocoaPods/Core.git
revision:
73c5a6b0c6331c4bfdc0d58360abf0f3f13beb56
revision:
c53a14e82afa7bf03bcc6175c747a173d00c69b4
branch: lookback-pods-by-config
branch: lookback-pods-by-config
specs:
specs:
cocoapods-core (0.29.0)
cocoapods-core (0.29.0)
...
@@ -103,7 +103,7 @@ GEM
...
@@ -103,7 +103,7 @@ GEM
escape (0.0.4)
escape (0.0.4)
ffi (1.9.3)
ffi (1.9.3)
fuzzy_match (2.0.4)
fuzzy_match (2.0.4)
github-markup (1.0.
0
)
github-markup (1.0.
1
)
i18n (0.6.9)
i18n (0.6.9)
json (1.8.1)
json (1.8.1)
json_pure (1.8.1)
json_pure (1.8.1)
...
...
lib/cocoapods/installer.rb
View file @
76432759
...
@@ -94,6 +94,7 @@ module Pod
...
@@ -94,6 +94,7 @@ module Pod
def
resolve_dependencies
def
resolve_dependencies
UI
.
section
"Analyzing dependencies"
do
UI
.
section
"Analyzing dependencies"
do
analyze
analyze
validate_whitelisted_configurations
prepare_for_legacy_compatibility
prepare_for_legacy_compatibility
clean_sandbox
clean_sandbox
end
end
...
@@ -174,6 +175,19 @@ module Pod
...
@@ -174,6 +175,19 @@ module Pod
@aggregate_targets
=
analyzer
.
result
.
targets
@aggregate_targets
=
analyzer
.
result
.
targets
end
end
# @raise Raises an informative if the hooks raises.
def
validate_whitelisted_configurations
whitelisted_configs
=
pod_targets
.
map
do
|
target
|
target
.
target_definition
.
all_whitelisted_configurations
end
.
flatten
.
uniq
all_user_configurations
=
analysis_result
.
all_user_build_configurations
.
keys
remainder
=
whitelisted_configs
-
all_user_configurations
unless
remainder
.
empty?
raise
Informative
,
"Unknown
#{
'configuration'
.
pluralize
(
remainder
.
size
)
}
whitelisted:
#{
remainder
.
sort
.
to_sentence
}
."
end
end
# Prepares the Pods folder in order to be compatible with the most recent
# Prepares the Pods folder in order to be compatible with the most recent
# version of CocoaPods.
# version of CocoaPods.
#
#
...
...
lib/cocoapods/installer/analyzer.rb
View file @
76432759
...
@@ -181,7 +181,7 @@ module Pod
...
@@ -181,7 +181,7 @@ module Pod
else
else
target
.
client_root
=
config
.
installation_root
target
.
client_root
=
config
.
installation_root
target
.
user_target_uuids
=
[]
target
.
user_target_uuids
=
[]
target
.
user_build_configurations
=
{}
target
.
user_build_configurations
=
target_definition
.
build_configurations
||
{}
if
target_definition
.
platform
.
name
==
:osx
if
target_definition
.
platform
.
name
==
:osx
target
.
archs
=
'$(ARCHS_STANDARD_64_BIT)'
target
.
archs
=
'$(ARCHS_STANDARD_64_BIT)'
end
end
...
...
spec/unit/installer_spec.rb
View file @
76432759
...
@@ -124,6 +124,28 @@ module Pod
...
@@ -124,6 +124,28 @@ module Pod
#--------------------------------------#
#--------------------------------------#
describe
"#validate_whitelisted_configurations"
do
it
"raises when a whitelisted configuration doesn’t exist in the user's project"
do
target_definition
=
@installer
.
podfile
.
target_definitions
.
values
.
first
target_definition
.
whitelist_pod_for_configuration
(
'JSONKit'
,
'YOLO'
)
@installer
.
send
(
:analyze
)
should
.
raise
Informative
do
@installer
.
send
(
:validate_whitelisted_configurations
)
end
end
it
"does not raise if all whitelisted configurations exist in the user's project"
do
target_definition
=
@installer
.
podfile
.
target_definitions
.
values
.
first
target_definition
.
whitelist_pod_for_configuration
(
'JSONKit'
,
'Test'
)
@installer
.
send
(
:analyze
)
should
.
not
.
raise
do
@installer
.
send
(
:validate_whitelisted_configurations
)
end
end
end
#--------------------------------------#
describe
"#clean_sandbox"
do
describe
"#clean_sandbox"
do
before
do
before
do
...
...
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