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
eb272e33
Commit
eb272e33
authored
Mar 16, 2018
by
Dimitris Koutsogiorgas
Committed by
Dimitris Koutsogiorgas
May 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove analyzer `attr_accessor` properties
parent
4f8ffc7b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
31 deletions
+58
-31
installer.rb
lib/cocoapods/installer.rb
+4
-6
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+0
-0
analysis_result.rb
lib/cocoapods/installer/analyzer/analysis_result.rb
+47
-22
source_provider_hooks_context.rb
lib/cocoapods/installer/source_provider_hooks_context.rb
+3
-1
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+0
-0
pods_project_generator_spec.rb
spec/unit/installer/xcode/pods_project_generator_spec.rb
+4
-2
installer_spec.rb
spec/unit/installer_spec.rb
+0
-0
No files found.
lib/cocoapods/installer.rb
View file @
eb272e33
...
@@ -241,15 +241,13 @@ module Pod
...
@@ -241,15 +241,13 @@ module Pod
# @return [void]
# @return [void]
#
#
def
analyze
(
analyzer
=
create_analyzer
)
def
analyze
(
analyzer
=
create_analyzer
)
analyzer
.
update
=
update
@analysis_result
=
analyzer
.
analyze
@analysis_result
=
analyzer
.
analyze
@aggregate_targets
=
analyzer
.
result
.
targets
@aggregate_targets
=
@analysis_
result
.
targets
end
end
def
create_analyzer
(
plugin_sources
=
nil
)
def
create_analyzer
(
plugin_sources
=
nil
)
Analyzer
.
new
(
sandbox
,
podfile
,
lockfile
,
plugin_sources
).
tap
do
|
analyzer
|
Analyzer
.
new
(
sandbox
,
podfile
,
lockfile
,
plugin_sources
,
has_dependencies?
,
update
).
tap
do
|
analyzer
|
analyzer
.
installation_options
=
installation_options
analyzer
.
installation_options
=
installation_options
analyzer
.
has_dependencies
=
has_dependencies?
end
end
end
end
...
@@ -684,9 +682,9 @@ module Pod
...
@@ -684,9 +682,9 @@ module Pod
plugin_sources
=
run_source_provider_hooks
plugin_sources
=
run_source_provider_hooks
analyzer
=
create_analyzer
(
plugin_sources
)
analyzer
=
create_analyzer
(
plugin_sources
)
analyze
(
analyzer
)
analyze
(
analyzer
)
if
analy
zer
.
podfile_needs_install?
(
analyzer
.
result
)
if
analy
sis_result
.
podfile_needs_install?
raise
Pod
::
Informative
,
'The Podfile has changed, you must run `pod install`'
raise
Pod
::
Informative
,
'The Podfile has changed, you must run `pod install`'
elsif
analy
zer
.
sandbox_needs_install?
(
analyzer
.
result
)
elsif
analy
sis_result
.
sandbox_needs_install?
raise
Pod
::
Informative
,
'The `Pods` directory is out-of-date, you must run `pod install`'
raise
Pod
::
Informative
,
'The `Pods` directory is out-of-date, you must run `pod install`'
end
end
...
...
lib/cocoapods/installer/analyzer.rb
View file @
eb272e33
This diff is collapsed.
Click to expand it.
lib/cocoapods/installer/analyzer/analysis_result.rb
View file @
eb272e33
module
Pod
module
Pod
class
Installer
class
Installer
class
Analyzer
class
Analyzer
# A simple container produced after a analysis is completed by the {Analyzer}.
#
class
AnalysisResult
class
AnalysisResult
# @return [SpecsState] the states of the Podfile specs.
# @return [SpecsState] the states of the Podfile specs.
#
#
attr_
accesso
r
:podfile_state
attr_
reade
r
:podfile_state
# @return [Hash{TargetDefinition => Array<Specification>}] the
# @return [Hash{TargetDefinition => Array<Specification>}] the specifications grouped by target.
# specifications grouped by target.
#
#
attr_
accesso
r
:specs_by_target
attr_
reade
r
:specs_by_target
# @return [Hash{Source => Array<Specification>}] the
# @return [Hash{Source => Array<Specification>}] the specifications grouped by spec repo source.
# specifications grouped by spec repo source.
#
#
attr_
accesso
r
:specs_by_source
attr_
reade
r
:specs_by_source
# @return [Array<Specification>] the specifications of the resolved
# @return [Array<Specification>] the specifications of the resolved version of Pods that should be installed.
# version of Pods that should be installed.
#
#
attr_
accesso
r
:specifications
attr_
reade
r
:specifications
# @return [SpecsState] the states of the {Sandbox} respect the resolved
# @return [SpecsState] the states of the {Sandbox} respect the resolved specifications.
# specifications.
#
#
attr_accessor
:sandbox_state
attr_accessor
:sandbox_state
# @return [Array<AggregateTarget>] The aggregate targets created for each
# @return [Array<AggregateTarget>] The aggregate targets created for each {TargetDefinition} from the {Podfile}.
# {TargetDefinition} from the {Podfile}.
#
#
attr_
accesso
r
:targets
attr_
reade
r
:targets
# @return [Hash{TargetDefinition => Array<TargetInspectionResult>}] the
# @return [PodfileDependencyCache] the cache of all dependencies in the podfile.
# results of inspecting the user targets
#
#
attr_
accessor
:target_inspections
attr_
reader
:podfile_dependency_cache
# @return [PodfileDependencyCache] the cache of all dependencies in the
def
initialize
(
podfile_state
,
specs_by_target
,
specs_by_source
,
specifications
,
sandbox_state
,
targets
,
# podfile.
podfile_dependency_cache
)
#
@podfile_state
=
podfile_state
attr_accessor
:podfile_dependency_cache
@specs_by_target
=
specs_by_target
@specs_by_source
=
specs_by_source
@specifications
=
specifications
@sandbox_state
=
sandbox_state
@targets
=
targets
@podfile_dependency_cache
=
podfile_dependency_cache
end
# @return [Hash{String=>Symbol}] A hash representing all the user build
# @return [Hash{String=>Symbol}] A hash representing all the user build
# configurations across all integration targets. Each key
# configurations across all integration targets. Each key
...
@@ -51,6 +53,29 @@ module Pod
...
@@ -51,6 +53,29 @@ module Pod
result
.
merge
(
target
.
user_build_configurations
)
result
.
merge
(
target
.
user_build_configurations
)
end
end
end
end
# @return [Bool] Whether an installation should be performed or this
# CocoaPods project is already up to date.
#
def
needs_install?
podfile_needs_install?
||
sandbox_needs_install?
end
# @return [Bool] Whether the podfile has changes respect to the lockfile.
#
def
podfile_needs_install?
state
=
podfile_state
needing_install
=
state
.
added
.
length
+
state
.
changed
.
length
+
state
.
deleted
.
length
needing_install
>
0
end
# @return [Bool] Whether the sandbox is in synch with the lockfile.
#
def
sandbox_needs_install?
state
=
sandbox_state
needing_install
=
state
.
added
.
length
+
state
.
changed
.
length
+
state
.
deleted
.
length
needing_install
>
0
end
end
end
end
end
end
end
...
...
lib/cocoapods/installer/source_provider_hooks_context.rb
View file @
eb272e33
...
@@ -20,7 +20,9 @@ module Pod
...
@@ -20,7 +20,9 @@ module Pod
@sources
=
[]
@sources
=
[]
end
end
# @param [Source] Source object to be added to the installer
# @param [Source] source object to be added to the installer
#
# @return [void]
#
#
def
add_source
(
source
)
def
add_source
(
source
)
unless
source
.
nil?
unless
source
.
nil?
...
...
spec/unit/installer/analyzer_spec.rb
View file @
eb272e33
This diff is collapsed.
Click to expand it.
spec/unit/installer/xcode/pods_project_generator_spec.rb
View file @
eb272e33
...
@@ -63,8 +63,10 @@ module Pod
...
@@ -63,8 +63,10 @@ module Pod
aggregate_targets
=
[
@ios_target
,
@osx_target
]
aggregate_targets
=
[
@ios_target
,
@osx_target
]
@analysis_result
=
Pod
::
Installer
::
Analyzer
::
AnalysisResult
.
new
@analysis_result
=
Pod
::
Installer
::
Analyzer
::
AnalysisResult
.
new
(
Pod
::
Installer
::
Analyzer
::
SpecsState
.
new
,
@analysis_result
.
targets
=
aggregate_targets
{},
{},
[],
Pod
::
Installer
::
Analyzer
::
SpecsState
.
new
,
aggregate_targets
,
nil
)
@installation_options
=
Pod
::
Installer
::
InstallationOptions
.
new
@installation_options
=
Pod
::
Installer
::
InstallationOptions
.
new
...
...
spec/unit/installer_spec.rb
View file @
eb272e33
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