Unverified Commit 1f95c589 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7505 from dnkoutso/immutability_wins_3

More "immutability" across several classes
parents b7e195d9 f7009cf7
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-06-09 08:12:30 -0500 using RuboCop version 0.37.2.
# on 2018-03-23 11:00:14 -0700 using RuboCop version 0.37.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
......@@ -13,7 +13,7 @@
Lint/EndAlignment:
Enabled: false
# Offense count: 11
# Offense count: 13
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/cocoapods/command.rb'
......@@ -22,37 +22,25 @@ Lint/IneffectiveAccessModifier:
- 'lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb'
- 'lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
Lint/LiteralInInterpolation:
Exclude:
- 'Dangerfile'
# Offense count: 1
# Offense count: 2
Lint/NonLocalExitFromIterator:
Exclude:
- 'spec/unit/installer_spec.rb'
# Offense count: 1
Lint/UnreachableCode:
Exclude:
- 'Dangerfile'
# Offense count: 40
# Offense count: 41
Lint/UselessAccessModifier:
Enabled: false
# Offense count: 2035
# Offense count: 3682
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 279
# Offense count: 1
# Offense count: 5
# Configuration parameters: CountKeywordArgs.
ParameterLists:
Max: 6
Metrics/ParameterLists:
Max: 9
# Offense count: 5
# Cop supports --auto-correct.
......@@ -64,13 +52,12 @@ Performance/Casecmp:
- 'lib/cocoapods/project.rb'
- 'lib/cocoapods/sandbox/path_list.rb'
# Offense count: 3
# Offense count: 2
# Cop supports --auto-correct.
Performance/RedundantBlockCall:
Exclude:
- 'lib/cocoapods/downloader/cache.rb'
- 'lib/cocoapods/installer/analyzer/pod_variant_set.rb'
- 'spec/unit/validator_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
......@@ -85,7 +72,7 @@ Performance/StringReplacement:
Exclude:
- 'spec/functional/command/spec_spec.rb'
# Offense count: 22
# Offense count: 25
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: prefer_alias, prefer_alias_method
......@@ -105,7 +92,6 @@ Style/Alias:
- 'lib/cocoapods/validator.rb'
- 'spec/spec_helper.rb'
- 'spec/spec_helper/user_interface.rb'
- 'spec/unit/validator_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
......@@ -115,12 +101,11 @@ Style/AlignParameters:
Exclude:
- 'lib/cocoapods/project.rb'
# Offense count: 6
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: SingleLineConditionsOnly.
Style/ConditionalAssignment:
Exclude:
- 'lib/cocoapods/command/repo/push.rb'
- 'lib/cocoapods/external_sources/abstract_external_source.rb'
- 'lib/cocoapods/sandbox/file_accessor.rb'
- 'lib/cocoapods/sandbox/path_list.rb'
......@@ -138,28 +123,28 @@ Style/IfInsideElse:
Exclude:
- 'lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb'
# Offense count: 24
# Offense count: 26
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Style/IndentArray:
EnforcedStyle: consistent
# Offense count: 24
# Offense count: 28
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Style/MultilineMethodCallIndentation:
Enabled: false
# Offense count: 3
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Style/MultilineOperationIndentation:
Enabled: false
# Offense count: 12
# Offense count: 11
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
......@@ -168,7 +153,6 @@ Style/MutableConstant:
- 'lib/cocoapods/generator/copy_resources_script.rb'
- 'lib/cocoapods/installer.rb'
- 'lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb'
- 'lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb'
- 'lib/cocoapods/project.rb'
- 'spec/unit/installer/user_project_integrator/target_integrator/xcconfig_integrator_spec.rb'
......@@ -189,7 +173,7 @@ Style/RedundantSelf:
Exclude:
- 'lib/cocoapods/command.rb'
# Offense count: 13
# Offense count: 11
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
......@@ -201,13 +185,6 @@ Style/RegexpLiteral:
- 'spec/integration.rb'
- 'spec/unit/external_sources/path_source_spec.rb'
- 'spec/unit/external_sources/podspec_source_spec.rb'
- 'spec/unit/resolver_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/SpaceAroundKeyword:
Exclude:
- 'lib/cocoapods/project.rb'
# Offense count: 1
# Cop supports --auto-correct.
......
......@@ -191,11 +191,11 @@ module Pod
class Indenter < ::Array
# @return [Fixnum] The indentation level of the UI.
#
attr_accessor :indent
attr_reader :indent
# @return [IO] the {IO} to which the output should be printed.
#
attr_accessor :io
attr_reader :io
# Init a new Indenter
#
......
......@@ -24,9 +24,9 @@ module Pod
# Initialize a new instance
#
# @param [String] name @see name
# @param [Hash] params @see params
# @param [String] podfile_path @see podfile_path
# @param [String] name @see #name
# @param [Hash] params @see #params
# @param [String] podfile_path @see #podfile_path
#
def initialize(name, params, podfile_path)
@name = name
......
......@@ -15,10 +15,10 @@ module Pod
# Initialize a new instance
#
# @param [Array<FileAccessor>] file_accessors
# @see file_accessors
# @see #file_accessors
#
# @param [Platform] platform
# @see platform
# @see Header#platform
#
def initialize(file_accessors, platform)
@file_accessors = file_accessors
......
......@@ -13,21 +13,20 @@ module Pod
#
attr_reader :configuration_name
# Initialize a new instance
# @return [Xcodeproj::Config] The generated xcconfig.
#
# @param [Target] target @see target
attr_reader :xcconfig
# Initialize a new instance
#
# @param [String] configuration_name @see configuration_name
# @param [Target] target @see #target
# @param [String] configuration_name @see #configuration_name
#
def initialize(target, configuration_name)
@target = target
@configuration_name = configuration_name
end
# @return [Xcodeproj::Config] The generated xcconfig.
#
attr_reader :xcconfig
# Generates and saves the xcconfig to the given path.
#
# @param [Pathname] path
......
......@@ -12,9 +12,13 @@ module Pod
#
attr_reader :target
# @return [Xcodeproj::Config] The generated xcconfig.
#
attr_reader :xcconfig
# Initialize a new instance
#
# @param [Target] target @see target
# @param [Target] target @see #target
#
# @param [Boolean] test_xcconfig
# whether this is an xcconfig for a test native target.
......@@ -24,10 +28,6 @@ module Pod
@test_xcconfig = test_xcconfig
end
# @return [Xcodeproj::Config] The generated xcconfig.
#
attr_reader :xcconfig
# Generates and saves the xcconfig to the given path.
#
# @param [Pathname] path
......
......@@ -61,9 +61,9 @@ module Pod
# Initialize a new instance
#
# @param [Sandbox] sandbox @see sandbox
# @param [Podfile] podfile @see podfile
# @param [Lockfile] lockfile @see lockfile
# @param [Sandbox] sandbox @see #sandbox
# @param [Podfile] podfile @see #podfile
# @param [Lockfile] lockfile @see #lockfile
#
def initialize(sandbox, podfile, lockfile = nil)
@sandbox = sandbox
......
......@@ -39,10 +39,10 @@ module Pod
# Initialize a new instance
#
# @param [Sandbox] sandbox @see sandbox
# @param [Podfile] podfile @see podfile
# @param [Lockfile] lockfile @see lockfile
# @param [Array<Source>] plugin_sources @see plugin_sources
# @param [Sandbox] sandbox @see #sandbox
# @param [Podfile] podfile @see #podfile
# @param [Lockfile] lockfile @see #lockfile
# @param [Array<Source>] plugin_sources @see #plugin_sources
#
def initialize(sandbox, podfile, lockfile = nil, plugin_sources = nil)
@sandbox = sandbox
......@@ -430,29 +430,27 @@ module Pod
# @return [AggregateTarget]
#
def generate_target(target_definition, pod_targets, resolver_specs_by_target)
target = AggregateTarget.new(target_definition, sandbox)
target.host_requires_frameworks |= target_definition.uses_frameworks?
if installation_options.integrate_targets?
target_inspection = result.target_inspections[target_definition]
raise "missing inspection: #{target_definition.name}" unless target_inspection
target.user_project = target_inspection.project
target.client_root = target.user_project_path.dirname.realpath
target.user_target_uuids = target_inspection.project_target_uuids
target.user_build_configurations = target_inspection.build_configurations
target.archs = target_inspection.archs
user_project = target_inspection.project
client_root = user_project.path.dirname.realpath
user_target_uuids = target_inspection.project_target_uuids
user_build_configurations = target_inspection.build_configurations
archs = target_inspection.archs
else
target.client_root = config.installation_root.realpath
target.user_target_uuids = []
target.user_build_configurations = target_definition.build_configurations || { 'Release' => :release, 'Debug' => :debug }
user_project = nil
client_root = config.installation_root.realpath
user_target_uuids = []
user_build_configurations = target_definition.build_configurations || { 'Release' => :release, 'Debug' => :debug }
archs = []
if target_definition.platform && target_definition.platform.name == :osx
target.archs = '$(ARCHS_STANDARD_64_BIT)'
archs = ['$(ARCHS_STANDARD_64_BIT)']
end
end
target.pod_targets = filter_pod_targets_for_target_definition(target_definition, pod_targets, resolver_specs_by_target)
target
pod_targets = filter_pod_targets_for_target_definition(target_definition, pod_targets, resolver_specs_by_target)
AggregateTarget.new(sandbox, target_definition.uses_frameworks?, user_build_configurations, archs,
target_definition, client_root, user_project, user_target_uuids, pod_targets)
end
# Returns a filtered list of pod targets that should or should not be part of the target definition. Pod targets
......@@ -602,21 +600,19 @@ module Pod
# @return [PodTarget]
#
def generate_pod_target(target_definitions, pod_specs, scope_suffix: nil)
pod_target = PodTarget.new(pod_specs, target_definitions, sandbox, scope_suffix)
pod_target.host_requires_frameworks = target_definitions.any?(&:uses_frameworks?)
if installation_options.integrate_targets?
target_inspections = result.target_inspections.select { |t, _| target_definitions.include?(t) }.values
pod_target.user_build_configurations = target_inspections.map(&:build_configurations).reduce({}, &:merge)
pod_target.archs = target_inspections.flat_map(&:archs).compact.uniq.sort
user_build_configurations = target_inspections.map(&:build_configurations).reduce({}, &:merge)
archs = target_inspections.flat_map(&:archs).compact.uniq.sort
else
pod_target.user_build_configurations = {}
user_build_configurations = {}
archs = []
if target_definitions.first.platform.name == :osx
pod_target.archs = '$(ARCHS_STANDARD_64_BIT)'
archs = ['$(ARCHS_STANDARD_64_BIT)']
end
end
pod_target
PodTarget.new(sandbox, target_definitions.any?(&:uses_frameworks?), user_build_configurations, archs, pod_specs,
target_definitions, scope_suffix)
end
# Generates dependencies that require the specific version of the Pods
......
......@@ -53,10 +53,10 @@ module Pod
# Init a new SandboxAnalyzer
#
# @param [Sandbox] sandbox @see sandbox
# @param [Array<Specifications>] specs @see specs
# @param [Bool] update_mode @see update_mode
# @param [Lockfile] lockfile @see lockfile
# @param [Sandbox] sandbox @see #sandbox
# @param [Array<Specifications>] specs @see #specs
# @param [Bool] update_mode @see #update_mode
# @param [Lockfile] lockfile @see #lockfile
#
def initialize(sandbox, specs, update_mode, lockfile = nil)
@sandbox = sandbox
......
......@@ -24,9 +24,9 @@ module Pod
# Initialize a new instance
#
# @param [Sandbox] sandbox @see sandbox
# @param [Hash{Symbol=>Array}] specs_by_platform @see specs_by_platform
# @param [Boolean] can_cache @see can_cache
# @param [Sandbox] sandbox @see #sandbox
# @param [Hash{Symbol=>Array}] specs_by_platform @see #specs_by_platform
# @param [Boolean] can_cache @see #can_cache
#
def initialize(sandbox, specs_by_platform, can_cache: true)
@sandbox = sandbox
......
......@@ -4,22 +4,36 @@ module Pod
# the context of the installer.
#
class PostInstallHooksContext
# @return [String] The path to the sandbox root (`Pods` directory).
# @return [Sandbox] The Sandbox for the project.
#
attr_accessor :sandbox_root
attr_reader :sandbox
# @return [Project] The Pods Xcode project.
# @return [String] The path to the sandbox root (`Pods` directory).
#
attr_accessor :pods_project
attr_reader :sandbox_root
# @return [Sandbox] The Sandbox for the project.
# @return [Xcodeproj::Project] The Pods Xcode project.
#
attr_accessor :sandbox
attr_reader :pods_project
# @return [Array<UmbrellaTargetDescription>] The list of
# the CocoaPods umbrella targets generated by the installer.
#
attr_accessor :umbrella_targets
attr_reader :umbrella_targets
# Initialize a new instance
#
# @param [Sandbox] sandbox see #sandbox
# @param [String] sandbox_root see #sandbox_root
# @param [Xcodeproj::Project] pods_project see #pods_project
# @param [Array<UmbrellaTargetDescription>] umbrella_targets see #umbrella_targets
#
def initialize(sandbox, sandbox_root, pods_project, umbrella_targets)
@sandbox = sandbox
@sandbox_root = sandbox_root
@pods_project = pods_project
@umbrella_targets = umbrella_targets
end
# @return [PostInstallHooksContext] Convenience class generator method
#
......@@ -34,24 +48,17 @@ module Pod
# static context.
#
def self.generate(sandbox, aggregate_targets)
umbrella_targets_descriptions = []
aggregate_targets.each do |umbrella|
desc = UmbrellaTargetDescription.new
desc.user_project = umbrella.user_project
desc.user_targets = umbrella.user_targets
desc.specs = umbrella.specs
desc.platform_name = umbrella.platform.name
desc.platform_deployment_target = umbrella.platform.deployment_target.to_s
desc.cocoapods_target_label = umbrella.label
umbrella_targets_descriptions << desc
umbrella_targets_descriptions = aggregate_targets.map do |umbrella|
user_project = umbrella.user_project
user_targets = umbrella.user_targets
specs = umbrella.specs
platform_name = umbrella.platform.name
platform_deployment_target = umbrella.platform.deployment_target.to_s
cocoapods_target_label = umbrella.label
UmbrellaTargetDescription.new(user_project, user_targets, specs, platform_name, platform_deployment_target, cocoapods_target_label)
end
result = new
result.sandbox_root = sandbox.root.to_s
result.pods_project = sandbox.project
result.sandbox = sandbox
result.umbrella_targets = umbrella_targets_descriptions
result
new(sandbox, sandbox.root.to_s, sandbox.project, umbrella_targets_descriptions)
end
# Pure data class which describes and umbrella target.
......@@ -60,7 +67,47 @@ module Pod
# @return [Xcodeproj::Project] The user project into which this target
# is integrated.
#
attr_accessor :user_project
attr_reader :user_project
# @return [Array<PBXNativeTarget>]
# The list of user targets integrated by this umbrella target.
#
attr_reader :user_targets
# @return [Array<Specification>] The list of the
# specifications of the target.
#
attr_reader :specs
# @return [Symbol] The platform (either `:ios`, `:watchos`, `:tvos`, or `:osx`).
#
attr_reader :platform_name
# @return [String] The deployment target.
#
attr_reader :platform_deployment_target
# @return [String] The label for the target.
#
attr_reader :cocoapods_target_label
# Initialize a new instance
#
# @param [Xcodeproj::Project] user_project see #user_project
# @param [Array<PBXNativeTarget>] user_targets see #user_targets
# @param [Array<Specification>] specs see #specs
# @param [Symbol] platform_name see #platform_name
# @param [String] platform_deployment_target see #platform_deployment_target
# @param [String] cocoapods_target_label see #cocoapods_target_label
#
def initialize(user_project, user_targets, specs, platform_name, platform_deployment_target, cocoapods_target_label)
@user_project = user_project
@user_targets = user_targets
@specs = specs
@platform_name = platform_name
@platform_deployment_target = platform_deployment_target
@cocoapods_target_label = cocoapods_target_label
end
# @return [String] The path of the user project
# integrated by this target.
......@@ -69,11 +116,6 @@ module Pod
user_project.path if user_project
end
# @return [Array<PBXNativeTarget>]
# The list of user targets integrated by this umbrella target.
#
attr_accessor :user_targets
# @return [Array<String>] The list of the UUIDs of the
# user targets integrated by this umbrella
# target. They can be used to find the
......@@ -84,23 +126,6 @@ module Pod
def user_target_uuids
user_targets.map(&:uuid)
end
# @return [Array<Specification>] The list of the
# specifications of the target.
#
attr_accessor :specs
# @return [Symbol] The platform (either `:ios`, `:watchos`, `:tvos`, or `:osx`).
#
attr_accessor :platform_name
# @return [String] The deployment target.
#
attr_accessor :platform_deployment_target
# @return [String] The label for the target.
#
attr_accessor :cocoapods_target_label
end
end
end
......
......@@ -4,21 +4,35 @@ module Pod
# the context of the installer before analysis has been completed.
#
class PreInstallHooksContext
# @return [String] The path to the sandbox root (`Pods` directory).
#
attr_accessor :sandbox_root
# @return [Podfile] The Podfile for the project.
#
attr_accessor :podfile
attr_reader :podfile
# @return [Sandbox] The Sandbox for the project.
#
attr_accessor :sandbox
attr_reader :sandbox
# @return [String] The path to the sandbox root (`Pods` directory).
#
attr_reader :sandbox_root
# @return [Lockfile] The Lockfile for the project.
#
attr_accessor :lockfile
attr_reader :lockfile
# Initialize a new instance
#
# @param [Sandbox] sandbox see #sandbox
# @param [String] sandbox_root see #sandbox_root
# @param [Podfile] podfile see #podfile
# @param [Lockfile] lockfile see #lockfile
#
def initialize(podfile, sandbox, sandbox_root, lockfile)
@podfile = podfile
@sandbox = sandbox
@sandbox_root = sandbox_root
@lockfile = lockfile
end
# @param [Sandbox] sandbox see {#sandbox}
#
......@@ -30,12 +44,7 @@ module Pod
# static context.
#
def self.generate(sandbox, podfile, lockfile)
result = new
result.podfile = podfile
result.sandbox = sandbox
result.sandbox_root = sandbox.root.to_s
result.lockfile = lockfile
result
new(podfile, sandbox, sandbox.root.to_s, lockfile)
end
end
end
......
......@@ -43,12 +43,12 @@ module Pod
# Initialize a new instance
#
# @param [Array<AggregateTarget>] aggregate_targets @see aggregate_targets
# @param [Sandbox] sandbox @see sandbox
# @param [Array<PodTarget>] pod_targets @see pod_targets
# @param [Analyzer] analysis_result @see analysis_result
# @param [InstallationOptions] installation_options @see installation_options
# @param [Config] config @see config
# @param [Array<AggregateTarget>] aggregate_targets @see #aggregate_targets
# @param [Sandbox] sandbox @see #sandbox
# @param [Array<PodTarget>] pod_targets @see #pod_targets
# @param [Analyzer] analysis_result @see #analysis_result
# @param [InstallationOptions] installation_options @see #installation_options
# @param [Config] config @see #config
#
def initialize(aggregate_targets, sandbox, pod_targets, analysis_result, installation_options, config)
@aggregate_targets = aggregate_targets
......
......@@ -20,9 +20,9 @@ module Pod
# Initialize a new instance
#
# @param [Sandbox] sandbox @see sandbox
# @param [Array<PodTarget>] pod_targets @see pod_targets
# @param [Project] pods_project @see pod_project
# @param [Sandbox] sandbox @see #sandbox
# @param [Array<PodTarget>] pod_targets @see #pod_targets
# @param [Project] pods_project @see #pods_project
#
def initialize(sandbox, pod_targets, pods_project)
@sandbox = sandbox
......
......@@ -19,8 +19,8 @@ module Pod
# Initialize a new instance
#
# @param [Sandbox] sandbox @see sandbox
# @param [Target] target @see target
# @param [Sandbox] sandbox @see #sandbox
# @param [Target] target @see #target
#
def initialize(sandbox, target)
@sandbox = sandbox
......
......@@ -8,9 +8,22 @@ module Pod
# through the installation process.
#
class Project < Xcodeproj::Project
# @return [PBXGroup] The group for the support files of the aggregate
# targets.
#
attr_reader :support_files_group
# @return [PBXGroup] The group for the Pods.
#
attr_reader :pods
# @return [PBXGroup] The group for Development Pods.
#
attr_reader :development_pods
# Initialize a new instance
#
# @param [Pathname, String] path @see path
# @param [Pathname, String] path @see #path
# @param [Bool] skip_initialization
# Whether the project should be initialized from scratch.
# @param [Int] object_version
......@@ -27,19 +40,6 @@ module Pod
self.symroot = LEGACY_BUILD_ROOT
end
# @return [PBXGroup] The group for the support files of the aggregate
# targets.
#
attr_reader :support_files_group
# @return [PBXGroup] The group for the Pods.
#
attr_reader :pods
# @return [PBXGroup] The group for Development Pods.
#
attr_reader :development_pods
# Generates a list of new UUIDs that created objects can be assigned.
#
# @note Overridden to generate UUIDs in a much faster way, since we don't need to check for collisions
......
......@@ -52,7 +52,7 @@ module Pod
# Initialize a new instance
#
# @param [String, Pathname] root @see root
# @param [String, Pathname] root @see #root
#
def initialize(root)
FileUtils.mkdir_p(root)
......
......@@ -33,8 +33,8 @@ module Pod
# Initialize a new instance
#
# @param [Sandbox::PathList, Pathname] path_list @see path_list
# @param [Specification::Consumer] spec_consumer @see spec_consumer
# @param [Sandbox::PathList, Pathname] path_list @see #path_list
# @param [Specification::Consumer] spec_consumer @see #spec_consumer
#
def initialize(path_list, spec_consumer)
if path_list.is_a?(PathList)
......
......@@ -16,7 +16,7 @@ module Pod
#
attr_reader :sandbox
# @param [Sandbox] @see sandbox
# @param [Sandbox] @see #sandbox
#
# @param [String] relative_path
# the relative path to the sandbox root and hence to the Pods
......
......@@ -15,13 +15,31 @@ module Pod
# @return [Boolean] Whether the target needs to be implemented as a framework.
# Computed by analyzer.
#
attr_accessor :host_requires_frameworks
attr_reader :host_requires_frameworks
alias_method :host_requires_frameworks?, :host_requires_frameworks
# @return [Hash{String=>Symbol}] A hash representing the user build
# configurations where each key corresponds to the name of a
# configuration and its value to its type (`:debug` or `:release`).
#
attr_reader :user_build_configurations
# @return [Array<String>] The value for the ARCHS build setting.
#
attr_reader :archs
# Initialize a new target
#
def initialize
@archs = []
# @param [Sandbox] sandbox @see #sandbox
# @param [Boolean] host_requires_frameworks @see #host_requires_frameworks
# @param [Hash{String=>Symbol}] user_build_configurations @see #user_build_configurations
# @param [Array<String>] archs @see #archs
#
def initialize(sandbox, host_requires_frameworks, user_build_configurations, archs)
@sandbox = sandbox
@host_requires_frameworks = host_requires_frameworks
@user_build_configurations = user_build_configurations
@archs = archs
end
# @return [String] the name of the library.
......@@ -102,23 +120,11 @@ module Pod
#-------------------------------------------------------------------------#
# @!group Information storage
# @return [Hash{String=>Symbol}] A hash representing the user build
# configurations where each key corresponds to the name of a
# configuration and its value to its type (`:debug` or `:release`).
#
attr_accessor :user_build_configurations
# @return [PBXNativeTarget] the target generated in the Pods project for
# this library.
#
attr_accessor :native_target
# @return [Array<String>] The value for the ARCHS build setting.
#
attr_accessor :archs
#-------------------------------------------------------------------------#
# @!group Support files
......
......@@ -3,25 +3,73 @@ module Pod
# of the single Pods. The client targets will then depend on this one.
#
class AggregateTarget < Target
# Product types where the product's frameworks must be embedded in a host target
#
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :static_library, :messages_extension, :watch_extension, :xpc_service].freeze
# @return [TargetDefinition] the target definition of the Podfile that
# generated this target.
#
attr_reader :target_definition
# Product types where the product's frameworks must be embedded in a host target
# @return [Pathname] the folder where the client is stored used for
# computing the relative paths. If integrating it should be the
# folder where the user project is stored, otherwise it should
# be the installation root.
#
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :static_library, :messages_extension, :watch_extension, :xpc_service].freeze
attr_reader :client_root
# Initialize a new instance
# @return [Xcodeproj::Project] the user project that this target will
# integrate as identified by the analyzer.
#
attr_reader :user_project
# @return [Array<String>] the list of the UUIDs of the user targets that
# will be integrated by this target as identified by the analyzer.
#
# @note The target instances are not stored to prevent editing different
# instances.
#
attr_reader :user_target_uuids
# @return [Hash<String, Xcodeproj::Config>] Map from configuration name to
# configuration file for the target
#
# @note The configurations are generated by the {TargetInstaller} and
# used by {UserProjectIntegrator} to check for any overridden
# values.
#
attr_reader :xcconfigs
# @return [Array<PodTarget>] The dependencies for this target.
#
attr_accessor :pod_targets
# @return [Array<AggregateTarget>] The aggregate targets whose pods this
# target must be able to import, but will not directly link against.
#
# @param [TargetDefinition] target_definition @see target_definition
# @param [Sandbox] sandbox @see sandbox
attr_reader :search_paths_aggregate_targets
# Initialize a new instance
#
def initialize(target_definition, sandbox)
# @param [Sandbox] sandbox @see Target#sandbox
# @param [Boolean] host_requires_frameworks @see Target#host_requires_frameworks
# @param [Hash{String=>Symbol}] user_build_configurations @see Target#user_build_configurations
# @param [Array<String>] archs @see Target#archs
# @param [TargetDefinition] target_definition @see #target_definition
# @param [Pathname] client_root @see #client_root
# @param [Xcodeproj::Project] user_project @see #user_project
# @param [Array<String>] user_target_uuids @see #user_target_uuids
# @param [Array<PodTarget>] pod_targets @see #pod_targets
#
def initialize(sandbox, host_requires_frameworks, user_build_configurations, archs, target_definition, client_root, user_project, user_target_uuids, pod_targets)
super(sandbox, host_requires_frameworks, user_build_configurations, archs)
raise "Can't initialize an AggregateTarget with an abstract TargetDefinition" if target_definition.abstract?
super()
@target_definition = target_definition
@sandbox = sandbox
@pod_targets = []
@client_root = client_root
@user_project = user_project
@user_target_uuids = user_target_uuids
@pod_targets = pod_targets
@search_paths_aggregate_targets = []
@file_accessors = []
@xcconfigs = {}
......@@ -81,18 +129,6 @@ module Pod
target_definition.podfile
end
# @return [Pathname] the folder where the client is stored used for
# computing the relative paths. If integrating it should be the
# folder where the user project is stored, otherwise it should
# be the installation root.
#
attr_accessor :client_root
# @return [Xcodeproj::Project] the user project that this target will
# integrate as identified by the analyzer.
#
attr_accessor :user_project
# @return [Pathname] the path of the user project that this target will
# integrate as identified by the analyzer.
#
......@@ -100,14 +136,6 @@ module Pod
user_project.path if user_project
end
# @return [Array<String>] the list of the UUIDs of the user targets that
# will be integrated by this target as identified by the analyzer.
#
# @note The target instances are not stored to prevent editing different
# instances.
#
attr_accessor :user_target_uuids
# List all user targets that will be integrated by this #target.
#
# @return [Array<PBXNativeTarget>]
......@@ -124,24 +152,6 @@ module Pod
end
end
# @return [Hash<String, Xcodeproj::Config>] Map from configuration name to
# configuration file for the target
#
# @note The configurations are generated by the {TargetInstaller} and
# used by {UserProjectIntegrator} to check for any overridden
# values.
#
attr_reader :xcconfigs
# @return [Array<PodTarget>] The dependencies for this target.
#
attr_accessor :pod_targets
# @return [Array<AggregateTarget>] The aggregate targets whose pods this
# target must be able to import, but will not directly link against.
#
attr_reader :search_paths_aggregate_targets
# @param [String] build_configuration The build configuration for which the
# the pod targets should be returned.
#
......
......@@ -16,7 +16,7 @@ module Pod
#
attr_reader :build_headers
# @return [String] used as suffix in the label
# @return [String] the suffix used for this target when deduplicated. May be `nil`.
#
# @note This affects the value returned by #configuration_build_dir
# and accessors relying on this as #build_product_path.
......@@ -38,21 +38,24 @@ module Pod
#
attr_accessor :test_native_targets
# @param [Array<Specification>] specs @see #specs
# Initialize a new instance
#
# @param [Sandbox] sandbox @see Target#sandbox
# @param [Boolean] host_requires_frameworks @see Target#host_requires_frameworks
# @param [Hash{String=>Symbol}] user_build_configurations @see Target#user_build_configurations
# @param [Array<String>] archs @see Target#archs
# @param [Array<TargetDefinition>] target_definitions @see #target_definitions
# @param [Sandbox] sandbox @see #sandbox
# @param [String] scope_suffix @see #scope_suffix
#
def initialize(specs, target_definitions, sandbox, scope_suffix = nil)
def initialize(sandbox, host_requires_frameworks, user_build_configurations, archs, specs, target_definitions, scope_suffix = nil)
super(sandbox, host_requires_frameworks, user_build_configurations, archs)
raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
raise "Can't initialize a PodTarget without TargetDefinition!" if target_definitions.nil? || target_definitions.empty?
raise "Can't initialize a PodTarget with only abstract TargetDefinitions" if target_definitions.all?(&:abstract?)
raise "Can't initialize a PodTarget with an empty string scope suffix!" if scope_suffix == ''
super()
@specs = specs.dup.freeze
@test_specs, @non_test_specs = @specs.partition(&:test_specification?)
@target_definitions = target_definitions
@sandbox = sandbox
@scope_suffix = scope_suffix
@build_headers = Sandbox::HeadersStore.new(sandbox, 'Private', :private)
@file_accessors = []
......@@ -74,13 +77,10 @@ module Pod
if cache[cache_key]
cache[cache_key]
else
target = PodTarget.new(specs, [target_definition], sandbox, target_definition.label)
target = PodTarget.new(sandbox, host_requires_frameworks, user_build_configurations, archs, specs, [target_definition], target_definition.label)
target.file_accessors = file_accessors
target.user_build_configurations = user_build_configurations
target.native_target = native_target
target.archs = archs
target.dependent_targets = dependent_targets.flat_map { |pt| pt.scoped(cache) }.select { |pt| pt.target_definitions == [target_definition] }
target.host_requires_frameworks = host_requires_frameworks
cache[cache_key] = target
end
end
......
......@@ -125,15 +125,15 @@ def fixture_target_definition(name = 'Pods', platform = Pod::Platform.ios)
'platform' => platform_hash)
end
def fixture_pod_target(spec_or_name, target_definitions = [])
def fixture_pod_target(spec_or_name, host_requires_frameworks = false, user_build_configurations = {}, target_definitions = [])
spec = spec_or_name.is_a?(Pod::Specification) ? spec_or_name : fixture_spec(spec_or_name)
fixture_pod_target_with_specs([spec], target_definitions)
fixture_pod_target_with_specs([spec], host_requires_frameworks, user_build_configurations, target_definitions)
end
def fixture_pod_target_with_specs(specs, target_definitions = [])
def fixture_pod_target_with_specs(specs, host_requires_frameworks = false, user_build_configurations = {}, target_definitions = [])
target_definitions << fixture_target_definition if target_definitions.empty?
target_definitions.each { |td| specs.each { |spec| td.store_pod(spec.name) } }
Pod::PodTarget.new(specs, target_definitions, config.sandbox).tap do |pod_target|
Pod::PodTarget.new(config.sandbox, host_requires_frameworks, user_build_configurations, [], specs, target_definitions, nil).tap do |pod_target|
specs.each do |spec|
pod_target.file_accessors << fixture_file_accessor(spec, pod_target.platform)
consumer = spec.consumer(pod_target.platform)
......@@ -144,10 +144,7 @@ end
def fixture_aggregate_target(pod_targets = [], target_definition = nil)
target_definition ||= pod_targets.flat_map(&:target_definitions).first || fixture_target_definition
target = Pod::AggregateTarget.new(target_definition, config.sandbox)
target.client_root = config.sandbox.root.dirname
target.pod_targets = pod_targets
target
Pod::AggregateTarget.new(config.sandbox, false, {}, [], target_definition, config.sandbox.root.dirname, nil, nil, pod_targets)
end
#-----------------------------------------------------------------------------#
......
......@@ -4,7 +4,7 @@ module Pod
describe Generator::ModuleMap do
before do
spec = fixture_spec('banana-lib/BananaLib.podspec')
@pod_target = PodTarget.new([spec], [fixture_target_definition], config.sandbox)
@pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [fixture_target_definition], nil)
@gen = Generator::ModuleMap.new(@pod_target)
end
......
......@@ -9,7 +9,7 @@ module Pod
end
def pod_target(spec, target_definition)
fixture_pod_target(spec, [target_definition])
fixture_pod_target(spec, false, {}, [target_definition])
end
before do
......@@ -41,7 +41,8 @@ module Pod
podfile = @target.target_definition.podfile
podfile.stubs(:defined_in_file).returns(Pathname.new(@target.client_root) + 'Podfile')
@target.target_definition.stubs(:podfile).returns(podfile)
@target.client_root = Pathname.new(@target.client_root) + 'NestedFolder'
client_root = Pathname.new(@target.client_root) + 'NestedFolder'
@target.stubs(:client_root).returns(client_root)
@generator.target.podfile_dir_relative_path.should == '${SRCROOT}/..'
end
......@@ -159,7 +160,7 @@ module Pod
describe 'with a scoped pod target' do
def pod_target(spec, target_definition)
fixture_pod_target(spec, [target_definition]).scoped.first
fixture_pod_target(spec, false, {}, [target_definition]).scoped.first
end
it 'links the pod targets with the aggregate target' do
......
......@@ -41,9 +41,8 @@ module Pod
)
@spec = fixture_spec('banana-lib/BananaLib.podspec')
@pod_target = fixture_pod_target(@spec)
@pod_target = fixture_pod_target(@spec, true)
@pod_target.dependent_targets = [@monkey_pod_target, vendored_dep_target]
@pod_target.host_requires_frameworks = true
@consumer = @pod_target.spec_consumers.first
@podfile = @pod_target.podfile
......
......@@ -10,12 +10,9 @@ module Pod
user_project = Xcodeproj::Project.open(SpecHelper.create_sample_app_copy_from_fixture('SampleProject'))
user_target = user_project.native_targets.find { |np| np.name == 'SampleProject' }
target_definition = fixture_target_definition
pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
umbrella = AggregateTarget.new(target_definition, config.sandbox)
umbrella.user_project = user_project
umbrella.user_target_uuids = [user_target.uuid]
pod_target = PodTarget.new(sandbox, false, {}, [], [spec], [target_definition], nil)
umbrella = AggregateTarget.new(sandbox, false, {}, [], target_definition, config.sandbox.root.dirname, user_project, [user_target.uuid], [pod_target])
umbrella.stubs(:platform).returns(Platform.new(:ios, '8.0'))
umbrella.pod_targets = [pod_target]
result = Installer::PostInstallHooksContext.generate(sandbox, [umbrella])
result.class.should == Installer::PostInstallHooksContext
......
......@@ -9,10 +9,7 @@ module Pod
@target = @project.targets.first
target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.abstract = false
@pod_bundle = AggregateTarget.new(target_definition, config.sandbox)
@pod_bundle.user_project = @project
@pod_bundle.client_root = project_path.dirname
@pod_bundle.user_target_uuids = [@target.uuid]
@pod_bundle = AggregateTarget.new(config.sandbox, false, {}, [], target_definition, project_path.dirname, @project, [@target.uuid], [])
configuration = Xcodeproj::Config.new(
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
)
......
......@@ -14,11 +14,7 @@ module Pod
@target = @project.targets.first
target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.abstract = false
@pod_bundle = AggregateTarget.new(target_definition, config.sandbox)
@pod_bundle.user_project = @project
@pod_bundle.user_build_configurations = { 'Release' => :release, 'Debug' => :debug }
@pod_bundle.client_root = project_path.dirname
@pod_bundle.user_target_uuids = [@target.uuid]
@pod_bundle = AggregateTarget.new(config.sandbox, false, { 'Release' => :release, 'Debug' => :debug }, [], target_definition, project_path.dirname, @project, [@target.uuid], [])
@pod_bundle.stubs(:resource_paths_by_config).returns('Release' => %w(${PODS_ROOT}/Lib/Resources/image.png))
@pod_bundle.stubs(:framework_paths_by_config).returns('Release' => [{ :input_path => '${PODS_BUILD_DIR}/Lib/Lib.framework' }])
configuration = Xcodeproj::Config.new(
......
......@@ -17,16 +17,8 @@ module Pod
end
config.sandbox.project = Project.new(config.sandbox.project_path)
config.sandbox.project.save
@target = AggregateTarget.new(@podfile.target_definitions['SampleProject'], config.sandbox)
@target.client_root = sample_project_path.dirname
@target.user_project = Xcodeproj::Project.open(@sample_project_path)
@target.user_target_uuids = ['A346496C14F9BE9A0080D870']
@target.user_build_configurations = { 'Release' => :release, 'Debug' => :debug }
@empty_library = AggregateTarget.new(@podfile.target_definitions[:empty], config.sandbox)
@empty_library.client_root = sample_project_path.dirname
@empty_library.user_project = @target.user_project
@empty_library.user_target_uuids = ['C0C495321B9E5C47004F9854']
@empty_library.user_build_configurations = { 'Release' => :release, 'Debug' => :debug }
@target = AggregateTarget.new(config.sandbox, false, { 'Release' => :release, 'Debug' => :debug }, [], @podfile.target_definitions['SampleProject'], sample_project_path.dirname, Xcodeproj::Project.open(@sample_project_path), ['A346496C14F9BE9A0080D870'], [])
@empty_library = AggregateTarget.new(config.sandbox, false, { 'Release' => :release, 'Debug' => :debug }, [], @podfile.target_definitions[:empty], sample_project_path.dirname, @target.user_project, ['C0C495321B9E5C47004F9854'], [])
@integrator = UserProjectIntegrator.new(@podfile, config.sandbox, temporary_directory, [@target, @empty_library])
end
......
......@@ -26,15 +26,12 @@ module Pod
@project.add_file_reference(file, group)
end
@target = AggregateTarget.new(@target_definition, config.sandbox)
@target.client_root = config.sandbox.root.dirname
@target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release, 'AppStore' => :release, 'Test' => :debug }
user_build_configurations = { 'Debug' => :debug, 'Release' => :release, 'AppStore' => :release, 'Test' => :debug }
@pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox)
@pod_target.user_build_configurations = @target.user_build_configurations
@pod_target = PodTarget.new(config.sandbox, false, user_build_configurations, [], [@spec], [@target_definition], nil)
@pod_target.file_accessors = [file_accessor]
@target.pod_targets = [@pod_target]
@target = AggregateTarget.new(config.sandbox, false, user_build_configurations, [], @target_definition, config.sandbox.root.dirname, nil, nil, [@pod_target])
@installer = AggregateTargetInstaller.new(config.sandbox, @target)
......
......@@ -196,9 +196,9 @@ module Pod
describe 'Private Helpers' do
describe '#file_accessors' do
it 'returns the file accessors' do
pod_target_1 = PodTarget.new([stub('Spec', :test_specification? => false)], [fixture_target_definition], config.sandbox)
pod_target_1 = PodTarget.new(config.sandbox, false, {}, [], [stub('Spec', :test_specification? => false)], [fixture_target_definition], nil)
pod_target_1.file_accessors = [fixture_file_accessor('banana-lib/BananaLib.podspec')]
pod_target_2 = PodTarget.new([stub('Spec', :test_specification? => false)], [fixture_target_definition], config.sandbox)
pod_target_2 = PodTarget.new(config.sandbox, false, {}, [], [stub('Spec', :test_specification? => false)], [fixture_target_definition], nil)
pod_target_2.file_accessors = [fixture_file_accessor('banana-lib/BananaLib.podspec')]
installer = FileReferencesInstaller.new(config.sandbox, [pod_target_1, pod_target_2], @project)
roots = installer.send(:file_accessors).map { |fa| fa.path_list.root }
......@@ -206,7 +206,7 @@ module Pod
end
it 'handles pods without file accessors' do
pod_target_1 = PodTarget.new([stub('Spec', :test_specification? => false)], [fixture_target_definition], config.sandbox)
pod_target_1 = PodTarget.new(config.sandbox, false, {}, [], [stub('Spec', :test_specification? => false)], [fixture_target_definition], nil)
pod_target_1.file_accessors = []
installer = FileReferencesInstaller.new(config.sandbox, [pod_target_1], @project)
installer.send(:file_accessors).should == []
......
......@@ -29,9 +29,8 @@ module Pod
@project.add_file_reference(resource, group)
end
@pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox)
@pod_target = PodTarget.new(config.sandbox, false, { 'Debug' => :debug, 'Release' => :release }, [], [@spec], [@target_definition], nil)
@pod_target.file_accessors = [file_accessor]
@pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer = PodTargetInstaller.new(config.sandbox, @pod_target)
@spec.prefix_header_contents = '#import "BlocksKit.h"'
......@@ -180,13 +179,11 @@ module Pod
@project.add_file_reference(resource, group)
end
@coconut_pod_target = PodTarget.new([@coconut_spec, *@coconut_spec.recursive_subspecs], [@target_definition], config.sandbox)
@coconut_pod_target = PodTarget.new(config.sandbox, false, { 'Debug' => :debug, 'Release' => :release }, [], [@coconut_spec, *@coconut_spec.recursive_subspecs], [@target_definition], nil)
@coconut_pod_target.file_accessors = [file_accessor, test_file_accessor]
@coconut_pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer = PodTargetInstaller.new(config.sandbox, @coconut_pod_target)
@coconut_pod_target2 = PodTarget.new([@coconut_spec, *@coconut_spec.recursive_subspecs], [@target_definition2], config.sandbox)
@coconut_pod_target2 = PodTarget.new(config.sandbox, false, { 'Debug' => :debug, 'Release' => :release }, [], [@coconut_spec, *@coconut_spec.recursive_subspecs], [@target_definition2], nil)
@coconut_pod_target2.file_accessors = [file_accessor, test_file_accessor]
@coconut_pod_target2.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer2 = PodTargetInstaller.new(config.sandbox, @coconut_pod_target2)
end
......@@ -378,9 +375,8 @@ module Pod
@project.add_file_reference(file, group) if file.fnmatch?('*.m') || file.fnmatch?('*.h')
end
@minions_pod_target = PodTarget.new([@minions_spec, *@minions_spec.recursive_subspecs], [@target_definition], config.sandbox)
@minions_pod_target = PodTarget.new(config.sandbox, false, { 'Debug' => :debug, 'Release' => :release }, [], [@minions_spec, *@minions_spec.recursive_subspecs], [@target_definition], nil)
@minions_pod_target.file_accessors = [file_accessor]
@minions_pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer = PodTargetInstaller.new(config.sandbox, @minions_pod_target)
@first_json_file = file_accessor.source_files.find { |sf| sf.extname == '.json' }
......@@ -490,9 +486,8 @@ module Pod
@project.add_file_reference(resource, group)
end
@pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox)
@pod_target = PodTarget.new(config.sandbox, false, { 'Debug' => :debug, 'Release' => :release }, [], [@spec], [@target_definition], nil)
@pod_target.file_accessors = [file_accessor]
@pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer = PodTargetInstaller.new(config.sandbox, @pod_target)
end
......@@ -751,8 +746,7 @@ module Pod
before do
@project.add_pod_group('snake', fixture('snake'))
@pod_target = fixture_pod_target('snake/snake.podspec', [@target_definition])
@pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@pod_target = fixture_pod_target('snake/snake.podspec', false, { 'Debug' => :debug, 'Release' => :release }, [@target_definition])
@pod_target.stubs(:requires_frameworks? => true)
group = @project.group_for_spec('snake')
@pod_target.file_accessors.first.source_files.each do |file|
......@@ -933,9 +927,8 @@ module Pod
@spec.resource_bundle = nil
@project.add_pod_group('BananaLib', fixture('banana-lib'))
@pod_target = fixture_pod_target(@spec)
@pod_target = fixture_pod_target(@spec, false, 'Debug' => :debug, 'Release' => :release)
@pod_target.stubs(:requires_frameworks? => true)
@pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
target_installer = PodTargetInstaller.new(config.sandbox, @pod_target)
# Use a file references installer to add the files so that the correct ones are added.
......@@ -993,8 +986,7 @@ module Pod
@spec.resource_bundle = { 'banana_bundle' => ['Resources/**/*'] }
@project.add_pod_group('BananaLib', fixture('banana-lib'))
@pod_target = fixture_pod_target(@spec)
@pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@pod_target = fixture_pod_target(@spec, false, 'Debug' => :debug, 'Release' => :release)
target_installer = PodTargetInstaller.new(config.sandbox, @pod_target)
# Use a file references installer to add the files so that the correct ones are added.
......
......@@ -11,7 +11,7 @@ module Pod
@project.save
@target_definition = fixture_target_definition
@coconut_spec = fixture_spec('coconut-lib/CoconutLib.podspec')
@coconut_pod_target = PodTarget.new([@coconut_spec, *@coconut_spec.recursive_subspecs], [@target_definition], config.sandbox)
@coconut_pod_target = PodTarget.new(config.sandbox, false, {}, [], [@coconut_spec, *@coconut_spec.recursive_subspecs], [@target_definition], nil)
@native_target = stub('NativeTarget', :shell_script_build_phases => [], :build_phases => [], :project => @project)
@test_native_target = stub('TestNativeTarget', :symbol_type => :unit_test_bundle, :build_phases => [], :shell_script_build_phases => [], :project => @project)
@coconut_pod_target.stubs(:native_target).returns(@native_target)
......
......@@ -24,22 +24,20 @@ module Pod
@project.add_file_reference(file, group)
end
@pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox)
@pod_target = PodTarget.new(config.sandbox, false, { 'Debug' => :debug, 'Release' => :release, 'AppStore' => :release, 'Test' => :debug }, ['$(ARCHS_STANDARD_64_BIT)'], [@spec], [@target_definition], nil)
@pod_target.stubs(:platform).returns(Platform.new(:ios, '6.0'))
@pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release, 'AppStore' => :release, 'Test' => :debug }
@pod_target.file_accessors = [file_accessor]
@installer = TargetInstaller.new(config.sandbox, @pod_target)
end
it 'adds the architectures to the custom build configurations of the user target' do
@pod_target.archs = '$(ARCHS_STANDARD_64_BIT)'
@installer.send(:add_target)
@installer.send(:native_target).resolved_build_setting('ARCHS').should == {
'Release' => '$(ARCHS_STANDARD_64_BIT)',
'Debug' => '$(ARCHS_STANDARD_64_BIT)',
'AppStore' => '$(ARCHS_STANDARD_64_BIT)',
'Test' => '$(ARCHS_STANDARD_64_BIT)',
'Release' => ['$(ARCHS_STANDARD_64_BIT)'],
'Debug' => ['$(ARCHS_STANDARD_64_BIT)'],
'AppStore' => ['$(ARCHS_STANDARD_64_BIT)'],
'Test' => ['$(ARCHS_STANDARD_64_BIT)'],
}
end
......
......@@ -102,8 +102,8 @@ module Pod
it 'sets the deployment target for the whole project' do
target_definition_osx = fixture_target_definition('OSX Target', Platform.new(:osx, '10.8'))
target_definition_ios = fixture_target_definition('iOS Target', Platform.new(:ios, '6.0'))
aggregate_target_osx = AggregateTarget.new(target_definition_osx, config.sandbox)
aggregate_target_ios = AggregateTarget.new(target_definition_ios, config.sandbox)
aggregate_target_osx = AggregateTarget.new(config.sandbox, false, {}, [], target_definition_osx, config.sandbox.root.dirname, nil, nil, [])
aggregate_target_ios = AggregateTarget.new(config.sandbox, false, {}, [], target_definition_ios, config.sandbox.root.dirname, nil, nil, [])
@generator.stubs(:aggregate_targets).returns([aggregate_target_osx, aggregate_target_ios])
@generator.stubs(:pod_targets).returns([])
@generator.send(:prepare)
......@@ -134,7 +134,7 @@ module Pod
target_definition.set_platform(:ios, '8.0')
target_definition.abstract = false
target_definition.store_pod('BananaLib')
pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [target_definition], nil)
@generator.stubs(:aggregate_targets).returns([])
@generator.stubs(:pod_targets).returns([pod_target])
PodsProjectGenerator::PodTargetInstaller.any_instance.expects(:install!)
......@@ -146,7 +146,7 @@ module Pod
target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.set_platform(:ios, '8.0')
target_definition.abstract = false
pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [target_definition], nil)
@generator.stubs(:aggregate_targets).returns([])
@generator.stubs(:pod_targets).returns([pod_target])
PodsProjectGenerator::PodTargetInstaller.any_instance.expects(:install!).once
......@@ -181,8 +181,8 @@ module Pod
spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, @installer.podfile.root_target_definitions.first)
@pod_target = PodTarget.new([spec], [target_definition], config.sandbox)
@target = AggregateTarget.new(target_definition, config.sandbox)
@pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [target_definition], nil)
@target = AggregateTarget.new(config.sandbox, false, {}, [], target_definition, config.sandbox.root.dirname, nil, nil, [])
@mock_target = mock('PodNativeTarget')
......@@ -267,8 +267,8 @@ module Pod
spec = fixture_spec('coconut-lib/CoconutLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, @installer.podfile.root_target_definitions.first)
@pod_target = PodTarget.new([spec, *spec.recursive_subspecs], [target_definition], config.sandbox)
@target = AggregateTarget.new(target_definition, config.sandbox)
@pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec, *spec.recursive_subspecs], [target_definition], nil)
@target = AggregateTarget.new(config.sandbox, false, {}, [], target_definition, config.sandbox.root.dirname, nil, nil, [])
@mock_target = mock('PodNativeTarget')
......@@ -433,8 +433,7 @@ module Pod
proj = Xcodeproj::Project.new(tmp_directory + 'Yolo.xcodeproj', false, 1)
proj.save
aggregate_target = AggregateTarget.new(fixture_target_definition, config.sandbox)
aggregate_target.user_project = proj
aggregate_target = AggregateTarget.new(config.sandbox, false, {}, [], fixture_target_definition, config.sandbox.root.dirname, proj, nil, [])
@generator.stubs(:aggregate_targets).returns([aggregate_target])
@generator.send(:prepare)
......@@ -471,7 +470,7 @@ module Pod
it 'shares test schemes' do
spec = fixture_spec('coconut-lib/CoconutLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, @installer.podfile.root_target_definitions.first)
pod_target = Pod::PodTarget.new([spec, *spec.recursive_subspecs], [target_definition], config.sandbox)
pod_target = Pod::PodTarget.new(config.sandbox, false, {}, [], [spec, *spec.recursive_subspecs], [target_definition], nil)
pod_target.stubs(:should_build?).returns(true)
@generator.installation_options.
......
......@@ -376,7 +376,7 @@ module Pod
@analysis_result.sandbox_state = Installer::Analyzer::SpecsState.new
@spec = stub(:name => 'Spec', :test_specification? => false)
@spec.stubs(:root => @spec)
@pod_targets = [PodTarget.new([@spec], [fixture_target_definition], config.sandbox)]
@pod_targets = [PodTarget.new(config.sandbox, false, {}, [], [@spec], [fixture_target_definition], nil)]
@installer.stubs(:analysis_result).returns(@analysis_result)
@installer.stubs(:pod_targets).returns(@pod_targets)
@installer.stubs(:aggregate_targets).returns([])
......@@ -422,7 +422,7 @@ module Pod
end
it 'deletes the target support file dirs of the removed aggregate targets' do
aggregate_target = AggregateTarget.new(fixture_target_definition('MyApp'), config.sandbox)
aggregate_target = AggregateTarget.new(config.sandbox, false, {}, [], fixture_target_definition('MyApp'), config.sandbox.root.dirname, nil, nil, [])
@installer.stubs(:aggregate_targets).returns([aggregate_target])
FileUtils.mkdir_p(config.sandbox.target_support_files_root)
FileUtils.mkdir_p(@installer.aggregate_targets.first.support_files_dir)
......@@ -435,7 +435,7 @@ module Pod
end
it 'does not delete the target support file dirs for non removed aggregate targets' do
aggregate_target = AggregateTarget.new(fixture_target_definition('MyApp'), config.sandbox)
aggregate_target = AggregateTarget.new(config.sandbox, false, {}, [], fixture_target_definition('MyApp'), config.sandbox.root.dirname, nil, nil, [])
@installer.stubs(:aggregate_targets).returns([aggregate_target])
FileUtils.mkdir_p(config.sandbox.target_support_files_root)
FileUtils.mkdir_p(@installer.aggregate_targets.first.support_files_dir)
......@@ -470,7 +470,7 @@ module Pod
it 'correctly configures the Pod source installer' do
spec = fixture_spec('banana-lib/BananaLib.podspec')
pod_target = PodTarget.new([spec], [fixture_target_definition], config.sandbox)
pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [fixture_target_definition], nil)
pod_target.stubs(:platform).returns(:ios)
@installer.stubs(:pod_targets).returns([pod_target])
@installer.instance_variable_set(:@installed_specs, [])
......@@ -480,7 +480,7 @@ module Pod
it 'maintains the list of the installed specs' do
spec = fixture_spec('banana-lib/BananaLib.podspec')
pod_target = PodTarget.new([spec], [fixture_target_definition], config.sandbox)
pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [fixture_target_definition], nil)
pod_target.stubs(:platform).returns(:ios)
@installer.stubs(:pod_targets).returns([pod_target, pod_target])
@installer.instance_variable_set(:@installed_specs, [])
......@@ -553,7 +553,7 @@ module Pod
it 'raises when it attempts to install pod source with no target supporting it' do
spec = fixture_spec('banana-lib/BananaLib.podspec')
pod_target = PodTarget.new([spec], [fixture_target_definition], config.sandbox)
pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [fixture_target_definition], nil)
pod_target.stubs(:platform).returns(:ios)
@installer.stubs(:pod_targets).returns([pod_target])
should.raise Informative do
......@@ -564,7 +564,7 @@ module Pod
it 'prints a warning for installed pods that included script phases' do
spec = fixture_spec('coconut-lib/CoconutLib.podspec')
spec.test_specs.first.script_phase = { :name => 'Hello World', :script => 'echo "Hello World"' }
pod_target = PodTarget.new([spec, *spec.test_specs], [fixture_target_definition], config.sandbox)
pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec, *spec.test_specs], [fixture_target_definition], nil)
pod_target.stubs(:platform).returns(:ios)
sandbox_state = Installer::Analyzer::SpecsState.new
sandbox_state.added << 'CoconutLib'
......@@ -579,7 +579,7 @@ module Pod
it 'does not print a warning for already installed pods that include script phases' do
spec = fixture_spec('coconut-lib/CoconutLib.podspec')
spec.test_specs.first.script_phase = { :name => 'Hello World', :script => 'echo "Hello World"' }
pod_target = PodTarget.new([spec, *spec.test_specs], [fixture_target_definition], config.sandbox)
pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec, *spec.test_specs], [fixture_target_definition], nil)
pod_target.stubs(:platform).returns(:ios)
sandbox_state = Installer::Analyzer::SpecsState.new
sandbox_state.unchanged << 'CoconutLib'
......@@ -639,7 +639,8 @@ module Pod
describe 'Integrating client projects' do
it 'integrates the client projects' do
@installer.stubs(:aggregate_targets).returns([AggregateTarget.new(fixture_target_definition, config.sandbox)])
target = AggregateTarget.new(config.sandbox, false, {}, [], fixture_target_definition, config.sandbox.root.dirname, nil, nil, [])
@installer.stubs(:aggregate_targets).returns([target])
Installer::UserProjectIntegrator.any_instance.expects(:integrate!)
@installer.send(:integrate_user_project)
end
......
......@@ -5,7 +5,7 @@ module Pod
describe 'In general' do
before do
@target_definition = fixture_target_definition
@lib = AggregateTarget.new(@target_definition, config.sandbox)
@lib = AggregateTarget.new(config.sandbox, false, {}, [], @target_definition, config.sandbox.root.dirname, nil, nil, [])
end
it 'returns the target_definition that generated it' do
......@@ -28,8 +28,7 @@ module Pod
describe 'Support files' do
before do
@target_definition = fixture_target_definition
@lib = AggregateTarget.new(@target_definition, config.sandbox)
@lib.client_root = config.sandbox.root.dirname
@lib = AggregateTarget.new(config.sandbox, false, {}, [], @target_definition, config.sandbox.root.dirname, nil, nil, [])
end
it 'returns the absolute path of the xcconfig file' do
......
......@@ -6,7 +6,8 @@ module Pod
before do
@target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@target = AggregateTarget.new(@target_definition, config.sandbox)
project_path = SpecHelper.fixture('SampleProject/SampleProject.xcodeproj')
@target = AggregateTarget.new(config.sandbox, false, {}, [], @target_definition, config.sandbox.root.dirname, Xcodeproj::Project.open(project_path), ['A346496C14F9BE9A0080D870'], [])
end
it 'returns the target_definition that generated it' do
......@@ -30,9 +31,6 @@ module Pod
end
it 'returns the user targets' do
project_path = SpecHelper.fixture('SampleProject/SampleProject.xcodeproj')
@target.user_project = Xcodeproj::Project.open(project_path)
@target.user_target_uuids = ['A346496C14F9BE9A0080D870']
targets = @target.user_targets
targets.count.should == 1
targets.first.class.should == Xcodeproj::Project::PBXNativeTarget
......@@ -43,8 +41,7 @@ module Pod
before do
@target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@target = AggregateTarget.new(@target_definition, config.sandbox)
@target.client_root = config.sandbox.root.dirname
@target = AggregateTarget.new(config.sandbox, false, {}, [], @target_definition, config.sandbox.root.dirname, nil, nil, [])
end
it 'returns the absolute path of the xcconfig file' do
......@@ -90,21 +87,17 @@ module Pod
@target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@target_definition.set_platform(:ios, '10.0')
@pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox)
@target = AggregateTarget.new(@target_definition, config.sandbox)
@target.pod_targets = [@pod_target]
@pod_target = PodTarget.new(config.sandbox, false, {}, [], [@spec], [@target_definition], nil)
@target = AggregateTarget.new(config.sandbox, false, {}, [], @target_definition, config.sandbox.root.dirname, nil, nil, [@pod_target])
end
describe 'with configuration dependent pod targets' do
before do
@pod_target_release = PodTarget.new([@spec], [@target_definition], config.sandbox)
@pod_target_release = PodTarget.new(config.sandbox, false, {}, [], [@spec], [@target_definition], nil)
@pod_target_release.expects(:include_in_build_config?).with(@target_definition, 'Debug').returns(false)
@pod_target_release.expects(:include_in_build_config?).with(@target_definition, 'Release').returns(true)
@target.pod_targets = [@pod_target, @pod_target_release]
@target.user_build_configurations = {
'Debug' => :debug,
'Release' => :release,
}
@target.stubs(:pod_targets).returns([@pod_target, @pod_target_release])
@target.stubs(:user_build_configurations).returns('Debug' => :debug, 'Release' => :release)
end
it 'returns pod targets for given build configuration' do
......@@ -123,12 +116,9 @@ module Pod
describe 'frameworks by config and input output paths' do
before do
@coconut_spec = fixture_spec('coconut-lib/CoconutLib.podspec')
@pod_target_release = PodTarget.new([@coconut_spec], [@target_definition], config.sandbox)
@target.pod_targets = [@pod_target]
@target.user_build_configurations = {
'Debug' => :debug,
'Release' => :release,
}
@pod_target_release = PodTarget.new(config.sandbox, false, {}, [], [@coconut_spec], [@target_definition], nil)
@target.stubs(:pod_targets).returns([@pod_target])
@target.stubs(:user_build_configurations).returns('Debug' => :debug, 'Release' => :release)
end
it 'returns non vendored framework input and output paths by config' do
......@@ -175,7 +165,7 @@ module Pod
@pod_target_release.expects(:include_in_build_config?).with(@target_definition, 'Release').returns(true)
@pod_target.stubs(:should_build?).returns(true)
@pod_target.stubs(:requires_frameworks?).returns(true)
@target.pod_targets = [@pod_target, @pod_target_release]
@target.stubs(:pod_targets).returns([@pod_target, @pod_target_release])
framework_paths_by_config = @target.framework_paths_by_config
framework_paths_by_config['Debug'].should == [
{ :name => 'BananaLib.framework',
......@@ -254,8 +244,7 @@ module Pod
describe 'With libraries' do
before do
@pod_target = fixture_pod_target('banana-lib/BananaLib.podspec')
@target = AggregateTarget.new(@pod_target.target_definitions.first, config.sandbox)
@target.pod_targets = [@pod_target]
@target = AggregateTarget.new(config.sandbox, false, {}, [], @pod_target.target_definitions.first, config.sandbox.root.dirname, nil, nil, [@pod_target])
end
it 'returns that it does not use swift' do
......@@ -264,7 +253,7 @@ module Pod
describe 'Host requires frameworks' do
before do
@target.host_requires_frameworks = true
@target.stubs(:host_requires_frameworks?).returns(true)
end
it 'returns the product name' do
......@@ -289,6 +278,10 @@ module Pod
end
describe 'Host does not requires frameworks' do
before do
@target.stubs(:host_requires_frameworks?).returns(false)
end
it 'returns the product name' do
@target.product_name.should == 'libPods.a'
end
......@@ -314,10 +307,8 @@ module Pod
before do
target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.abstract = false
@target = AggregateTarget.new(target_definition, config.sandbox)
project_path = SpecHelper.fixture('SampleProject/SampleProject.xcodeproj')
@target.user_project = Xcodeproj::Project.open(project_path)
@target.user_target_uuids = ['A346496C14F9BE9A0080D870']
@target = AggregateTarget.new(config.sandbox, true, {}, [], target_definition, config.sandbox.root.dirname, Xcodeproj::Project.open(project_path), ['A346496C14F9BE9A0080D870'], [@pod_target])
end
it 'requires a host target for app extension targets' do
......@@ -356,8 +347,8 @@ module Pod
end
it 'does not require a host target, if there is no user project (manual integration)' do
@target.user_project = nil
@target.user_target_uuids = []
@target.stubs(:user_project).returns(nil)
@target.stubs(:user_target_uuids).returns([])
@target.requires_host_target?.should == false
end
......@@ -376,10 +367,8 @@ module Pod
before do
target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.abstract = false
@target = AggregateTarget.new(target_definition, config.sandbox)
project_path = SpecHelper.fixture('SampleProject/SampleProject.xcodeproj')
@target.user_project = Xcodeproj::Project.open(project_path)
@target.user_target_uuids = ['A346496C14F9BE9A0080D870']
@target = AggregateTarget.new(config.sandbox, true, {}, [], target_definition, config.sandbox.root.dirname, Xcodeproj::Project.open(project_path), ['A346496C14F9BE9A0080D870'], [@pod_target])
end
it 'is a library target if the user_target is a framework' do
......@@ -410,10 +399,8 @@ module Pod
describe 'With frameworks' do
before do
@pod_target = fixture_pod_target('orange-framework/OrangeFramework.podspec', [fixture_target_definition('iOS Example')])
@target = AggregateTarget.new(@pod_target.target_definitions.first, config.sandbox)
@target.stubs(:requires_frameworks?).returns(true)
@target.pod_targets = [@pod_target]
@pod_target = fixture_pod_target('orange-framework/OrangeFramework.podspec', true, {}, [fixture_target_definition('iOS Example')])
@target = AggregateTarget.new(config.sandbox, true, {}, [], @pod_target.target_definitions.first, config.sandbox.root.dirname, nil, nil, [@pod_target])
end
it 'returns that it uses swift' do
......
......@@ -6,7 +6,7 @@ module Pod
spec = fixture_spec('banana-lib/BananaLib.podspec')
@target_definition = Podfile::TargetDefinition.new('Pods', nil)
@target_definition.abstract = false
@pod_target = PodTarget.new([spec], [@target_definition], config.sandbox)
@pod_target = PodTarget.new(config.sandbox, false, {}, [], [spec], [@target_definition], nil)
@pod_target.stubs(:platform).returns(Platform.ios)
end
......@@ -252,7 +252,7 @@ module Pod
@pod_target.sandbox.public_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('monkey', Platform.ios)
monkey_spec = fixture_spec('monkey/monkey.podspec')
monkey_pod_target = PodTarget.new([monkey_spec], [@target_definition], config.sandbox)
monkey_pod_target = PodTarget.new(config.sandbox, false, {}, [], [monkey_spec], [@target_definition], nil)
monkey_pod_target.stubs(:platform).returns(Platform.ios)
@pod_target.stubs(:dependent_targets).returns([monkey_pod_target])
header_search_paths = @pod_target.header_search_paths
......@@ -270,7 +270,7 @@ module Pod
@pod_target.sandbox.public_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('monkey', Platform.osx)
monkey_spec = fixture_spec('monkey/monkey.podspec')
monkey_pod_target = PodTarget.new([monkey_spec], [@target_definition], config.sandbox)
monkey_pod_target = PodTarget.new(config.sandbox, false, {}, [], [monkey_spec], [@target_definition], nil)
monkey_pod_target.stubs(:platform).returns(Platform.ios)
@pod_target.stubs(:dependent_targets).returns([monkey_pod_target])
header_search_paths = @pod_target.header_search_paths
......@@ -317,7 +317,7 @@ module Pod
@pod_target.sandbox.public_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('monkey', Platform.ios)
monkey_spec = fixture_spec('monkey/monkey.podspec')
monkey_pod_target = PodTarget.new([monkey_spec], [@target_definition], config.sandbox)
monkey_pod_target = PodTarget.new(config.sandbox, false, {}, [], [monkey_spec], [@target_definition], nil)
monkey_pod_target.stubs(:platform).returns(Platform.ios)
@pod_target.stubs(:dependent_targets).returns([monkey_pod_target])
header_search_paths = @pod_target.header_search_paths
......@@ -332,7 +332,7 @@ module Pod
@pod_target.sandbox.public_headers.add_search_path('BananaLib', Platform.ios)
@pod_target.sandbox.public_headers.add_search_path('monkey', Platform.osx)
monkey_spec = fixture_spec('monkey/monkey.podspec')
monkey_pod_target = PodTarget.new([monkey_spec], [@target_definition], config.sandbox)
monkey_pod_target = PodTarget.new(config.sandbox, false, {}, [], [monkey_spec], [@target_definition], nil)
monkey_pod_target.stubs(:platform).returns(Platform.ios)
@pod_target.stubs(:dependent_targets).returns([monkey_pod_target])
header_search_paths = @pod_target.header_search_paths
......@@ -357,7 +357,7 @@ module Pod
describe 'Host requires frameworks' do
before do
@pod_target.host_requires_frameworks = true
@pod_target = fixture_pod_target('banana-lib/BananaLib.podspec', true)
end
it 'returns the product name' do
......@@ -413,8 +413,7 @@ module Pod
describe 'With frameworks' do
before do
@pod_target = fixture_pod_target('orange-framework/OrangeFramework.podspec')
@pod_target.host_requires_frameworks = true
@pod_target = fixture_pod_target('orange-framework/OrangeFramework.podspec', true)
end
it 'returns that it uses swift' do
......@@ -490,7 +489,7 @@ module Pod
@coconut_spec = fixture_spec('coconut-lib/CoconutLib.podspec')
@test_spec_target_definition = Podfile::TargetDefinition.new('Pods', nil)
@test_spec_target_definition.abstract = false
@test_pod_target = PodTarget.new([@coconut_spec, *@coconut_spec.recursive_subspecs], [@test_spec_target_definition], config.sandbox)
@test_pod_target = PodTarget.new(config.sandbox, false, {}, [], [@coconut_spec, *@coconut_spec.recursive_subspecs], [@test_spec_target_definition], nil)
@test_pod_target.stubs(:platform).returns(Platform.new(:ios, '6.0'))
end
......
......@@ -4,7 +4,7 @@ module Pod
describe Target do
describe '#c99ext_identifier' do
before do
@target = Target.new
@target = Target.new(config.sandbox, false, {}, [])
end
it 'should mask, but keep leading numbers' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment