Class: Pod::Installer::Analyzer::TargetInspector

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/installer/analyzer/target_inspector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_definition, installation_root) ⇒ TargetInspector

Initialize a new instance

Parameters:

  • target_definition (TargetDefinition)

    @see #target_definition

  • installation_root (Pathname)

    @see #installation_root



21
22
23
24
# File 'lib/cocoapods/installer/analyzer/target_inspector.rb', line 21

def initialize(target_definition, installation_root)
  @target_definition = target_definition
  @installation_root = installation_root
end

Instance Attribute Details

#installation_rootPathname

Returns the root of the CocoaPods installation where the Podfile is located.

Returns:

  • (Pathname)

    the root of the CocoaPods installation where the Podfile is located



11
12
13
# File 'lib/cocoapods/installer/analyzer/target_inspector.rb', line 11

def installation_root
  @installation_root
end

#target_definitionTargetDefinition

Returns the target definition to inspect.

Returns:

  • (TargetDefinition)

    the target definition to inspect



7
8
9
# File 'lib/cocoapods/installer/analyzer/target_inspector.rb', line 7

def target_definition
  @target_definition
end

Instance Method Details

#compute_resultsTargetInspectionResult

Inspect the #target_definition



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/cocoapods/installer/analyzer/target_inspector.rb', line 30

def compute_results
  project_path = compute_project_path
  user_project = Xcodeproj::Project.open(project_path)
  targets = compute_targets(user_project)

  result = TargetInspectionResult.new
  result.target_definition = target_definition
  result.project_path = project_path
  result.project_target_uuids = targets.map(&:uuid)
  result.build_configurations = compute_build_configurations(targets)
  result.platform = compute_platform(targets)
  result.archs = compute_archs(targets)
  result
end