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
70e18447
Commit
70e18447
authored
Feb 14, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analizer] Never consider aggregate targets for integration (from
109af82e
).
parent
ec06a64f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+13
-5
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+10
-0
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+4
-1
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
70e18447
...
...
@@ -72,7 +72,7 @@ module Pod
# @return [Bool] Whether the sandbox is in synch with the lockfile.
#
def
sandbox_needs_install?
lockfile
=!
sandbox
.
manifest
lockfile
!=
sandbox
.
manifest
end
#-------------------------------------------------------------------------#
...
...
@@ -324,7 +324,7 @@ module Pod
root_specs
=
specifications
.
map
(
&
:root
).
uniq
is_changed
=
lambda
do
|
name
|
spec
=
root_specs
.
find
{
|
spec
|
spec
.
name
==
name
}
spec
=
root_specs
.
find
{
|
r_spec
|
r_
spec
.
name
==
name
}
spec
.
version
!=
sandbox_lockfile
.
version
(
name
)
\
||
spec
.
checksum
!=
sandbox_lockfile
.
checksum
(
name
)
\
||
resolved_subspecs_names
[
name
]
=!
sandbox_subspecs_names
[
name
]
\
...
...
@@ -411,19 +411,27 @@ module Pod
#
def
compute_user_project_targets
(
target_definition
,
user_project
)
if
link_with
=
target_definition
.
link_with
targets
=
user_project
.
targets
.
select
{
|
t
|
link_with
.
include?
t
.
name
}
targets
=
native_targets
(
user_project
)
.
select
{
|
t
|
link_with
.
include?
t
.
name
}
raise
Informative
,
"Unable to find the targets named `
#{
link_with
.
to_sentence
}
` to link with target definition `
#{
target_definition
.
name
}
`"
if
targets
.
empty?
elsif
target_definition
.
name
!=
:default
target
=
user_project
.
targets
.
find
{
|
t
|
t
.
name
==
target_definition
.
name
.
to_s
}
target
=
native_targets
(
user_project
)
.
find
{
|
t
|
t
.
name
==
target_definition
.
name
.
to_s
}
targets
=
[
target
].
compact
raise
Informative
,
"Unable to find a target named `
#{
target_definition
.
name
.
to_s
}
`"
if
targets
.
empty?
else
targets
=
[
user_project
.
targets
.
first
].
compact
targets
=
[
native_targets
(
user_project
)
.
first
].
compact
raise
Informative
,
"Unable to find a target"
if
targets
.
empty?
end
targets
end
# @return [Array<PBXNativeTarget>] Returns the user’s targets, excluding
# aggregate targets.
def
native_targets
(
user_project
)
user_project
.
targets
.
reject
do
|
target
|
target
.
is_a?
Xcodeproj
::
Project
::
Object
::
PBXAggregateTarget
end
end
# @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`).
...
...
spec/unit/installer/analyzer_spec.rb
View file @
70e18447
...
...
@@ -211,6 +211,16 @@ module Pod
e
=
lambda
{
@analyzer
.
send
(
:compute_user_project_path
,
target_definition
)
}.
should
.
raise
Informative
e
.
message
.
should
.
match
/Could not.*select.*project/
end
it
"does not take aggregate targets into consideration"
do
aggregate_class
=
Xcodeproj
::
Project
::
Object
::
PBXAggregateTarget
sample_project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
sample_project
=
Xcodeproj
::
Project
.
new
(
sample_project_path
)
sample_project
.
targets
.
map
(
&
:class
).
should
.
include
(
aggregate_class
)
native_targets
=
@analyzer
.
send
(
:native_targets
,
sample_project
).
map
(
&
:class
)
native_targets
.
should
.
not
.
include
(
aggregate_class
)
end
end
#--------------------------------------#
...
...
spec/unit/installer/user_project_integrator_spec.rb
View file @
70e18447
...
...
@@ -27,7 +27,10 @@ module Pod
lib
=
Library
.
new
(
target_definition
)
lib
.
user_project_path
=
sample_project_path
lib
.
target
=
@pods_project
.
new_target
(
:static_library
,
target_definition
.
label
,
target_definition
.
platform
.
name
)
lib
.
user_targets
=
sample_project
.
targets
lib
.
user_targets
=
sample_project
.
targets
.
reject
do
|
target
|
target
.
is_a?
Xcodeproj
::
Project
::
Object
::
PBXAggregateTarget
end
lib
.
support_files_root
=
config
.
sandbox
.
root
lib
.
user_project
=
sample_project
lib
...
...
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