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
a2fb7a0a
Commit
a2fb7a0a
authored
Mar 08, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make more classes immutable
parent
e57559d7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
36 deletions
+34
-36
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+2
-4
specs_state.rb
lib/cocoapods/installer/analyzer/specs_state.rb
+16
-16
target_inspector.rb
lib/cocoapods/installer/analyzer/target_inspector.rb
+7
-11
resolver.rb
lib/cocoapods/resolver.rb
+9
-5
resolver_spec.rb
spec/unit/resolver_spec.rb
+0
-0
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
a2fb7a0a
...
...
@@ -777,8 +777,7 @@ module Pod
resolver_specs_by_target
=
nil
UI
.
section
"Resolving dependencies of
#{
UI
.
path
(
podfile
.
defined_in_file
)
||
'Podfile'
}
"
do
resolver
=
Resolver
.
new
(
sandbox
,
podfile
,
locked_dependencies
,
sources
)
resolver
.
specs_updated
=
specs_updated?
resolver
=
Resolver
.
new
(
sandbox
,
podfile
,
locked_dependencies
,
sources
,
specs_updated?
)
resolver_specs_by_target
=
resolver
.
resolve
resolver_specs_by_target
.
values
.
flatten
(
1
).
map
(
&
:spec
).
each
(
&
:validate_cocoapods_version
)
end
...
...
@@ -919,8 +918,7 @@ module Pod
project
=
Xcodeproj
::
Project
.
open
(
project_path
)
target_inspectors
.
each
do
|
inspector
|
target_definition
=
inspector
.
target_definition
inspector
.
user_project
=
project
results
=
inspector
.
compute_results
results
=
inspector
.
compute_results
(
project
)
inspection_result
[
target_definition
]
=
results
UI
.
message
(
'Using `ARCHS` setting to build architectures of '
\
"target `
#{
target_definition
.
label
}
`: (`
#{
results
.
archs
.
join
(
'`, `'
)
}
`)"
)
...
...
lib/cocoapods/installer/analyzer/specs_state.rb
View file @
a2fb7a0a
...
...
@@ -12,6 +12,22 @@ module Pod
# subspecs are added instead of the name of the Pods.
#
class
SpecsState
# @return [Set<String>] the names of the pods that were added.
#
attr_reader
:added
# @return [Set<String>] the names of the pods that were changed.
#
attr_reader
:changed
# @return [Set<String>] the names of the pods that were deleted.
#
attr_reader
:deleted
# @return [Set<String>] the names of the pods that were unchanged.
#
attr_reader
:unchanged
# Initialize a new instance
#
# @param [Hash{Symbol=>String}] pods_by_state
...
...
@@ -38,22 +54,6 @@ module Pod
end
end
# @return [Set<String>] the names of the pods that were added.
#
attr_accessor
:added
# @return [Set<String>] the names of the pods that were changed.
#
attr_accessor
:changed
# @return [Set<String>] the names of the pods that were deleted.
#
attr_accessor
:deleted
# @return [Set<String>] the names of the pods that were unchanged.
#
attr_accessor
:unchanged
# Displays the state of each pod.
#
# @return [void]
...
...
lib/cocoapods/installer/analyzer/target_inspector.rb
View file @
a2fb7a0a
...
...
@@ -8,11 +8,12 @@ module Pod
# @return [TargetDefinition] the target definition to inspect
#
attr_
accesso
r
:target_definition
attr_
reade
r
:target_definition
# @return [Pathname] the root of the CocoaPods installation where the
# Podfile is located
attr_accessor
:installation_root
#
attr_reader
:installation_root
# Initialize a new instance
#
...
...
@@ -33,7 +34,7 @@ module Pod
#
# @return [TargetInspectionResult]
#
def
compute_results
def
compute_results
(
user_project
)
raise
ArgumentError
,
'Cannot compute results without a user project set'
unless
user_project
targets
=
compute_targets
(
user_project
)
...
...
@@ -81,11 +82,6 @@ module Pod
path
end
# @return [Xcodeproj::Project] the user's Xcode project, used for target
# inspection
#
attr_accessor
:user_project
#-----------------------------------------------------------------------#
private
...
...
@@ -115,7 +111,7 @@ module Pod
[
target
]
end
# @param [Array<PBXNativeTarget] the user's targets of the project of
# @param [Array<PBXNativeTarget]
user_targets
the user's targets of the project of
# #target_definition which needs to be integrated
#
# @return [Hash{String=>Symbol}] A hash representing the user build
...
...
@@ -132,7 +128,7 @@ module Pod
end
end
# @param [Array<PBXNativeTarget] the user's targets of the project of
# @param [Array<PBXNativeTarget]
user_targets
the user's targets of the project of
# #target_definition which needs to be integrated
#
# @return [Platform] The platform of the user's targets
...
...
@@ -171,7 +167,7 @@ module Pod
# Computes the architectures relevant for the user's targets.
#
# @param [Array<PBXNativeTarget] the user's targets of the project of
# @param [Array<PBXNativeTarget]
user_targets
the user's targets of the project of
# #target_definition which needs to be integrated
#
# @return [Array<String>]
...
...
lib/cocoapods/resolver.rb
View file @
a2fb7a0a
...
...
@@ -71,11 +71,11 @@ module Pod
# @return [Array<Source>] The list of the sources which will be used for
# the resolution.
#
attr_
accesso
r
:sources
attr_
reade
r
:sources
# @return [Bool] Whether the resolver has sources repositories up-to-date.
#
attr_
accesso
r
:specs_updated
attr_
reade
r
:specs_updated
alias
specs_updated?
specs_updated
# Init a new Resolver
...
...
@@ -84,14 +84,18 @@ module Pod
# @param [Podfile] podfile @see podfile
# @param [Array<Dependency>] locked_dependencies @see locked_dependencies
# @param [Array<Source>, Source] sources @see sources
# @param [Boolean] specs_updated @see specs_updated
# @param [PodfileDependencyCache] podfile_dependency_cache the podfile dependency cache to use
# within this Resolver.
#
def
initialize
(
sandbox
,
podfile
,
locked_dependencies
,
sources
,
def
initialize
(
sandbox
,
podfile
,
locked_dependencies
,
sources
,
specs_updated
,
podfile_dependency_cache:
Installer
::
Analyzer
::
PodfileDependencyCache
.
from_podfile
(
podfile
))
@sandbox
=
sandbox
@podfile
=
podfile
@podfile_dependency_cache
=
podfile_dependency_cache
@locked_dependencies
=
locked_dependencies
@sources
=
Array
(
sources
)
@specs_updated
=
specs_updated
@podfile_dependency_cache
=
podfile_dependency_cache
@platforms_by_dependency
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
[]
}
@cached_sets
=
{}
end
...
...
@@ -344,7 +348,7 @@ module Pod
# one Pod installation, so different version of the same Pods for
# target definitions are not allowed.
#
attr_
accesso
r
:cached_sets
attr_
reade
r
:cached_sets
#-------------------------------------------------------------------------#
...
...
spec/unit/resolver_spec.rb
View file @
a2fb7a0a
This diff is collapsed.
Click to expand it.
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