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
6159183f
Commit
6159183f
authored
Mar 01, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analyzer] Adapt for TargetDefinition#link_with_first_target
parent
e515bb4d
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
13 deletions
+19
-13
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+1
-1
integration_spec.rb
spec/integration_spec.rb
+4
-2
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+2
-1
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+1
-1
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+2
-1
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+1
-1
library_spec.rb
spec/unit/library_spec.rb
+4
-2
resolver_spec.rb
spec/unit/resolver_spec.rb
+2
-2
validator_spec.rb
spec/unit/validator_spec.rb
+2
-2
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
6159183f
...
...
@@ -383,7 +383,7 @@ module Pod
if
link_with
=
target_definition
.
link_with
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
elsif
target_definition
.
link_with_first_target?
targets
=
[
native_targets
(
user_project
).
first
].
compact
raise
Informative
,
"Unable to find a target"
if
targets
.
empty?
else
...
...
spec/integration_spec.rb
View file @
6159183f
require
File
.
expand_path
(
'../spec_helper'
,
__FILE__
)
require
'yaml'
#-----------------------------------------------------------------------------#
# TODO These checks need to be migrated to spec/integration_2.rb
#-----------------------------------------------------------------------------#
# @!group Helpers
...
...
@@ -212,7 +214,7 @@ module Pod
saved_project
=
Xcodeproj
.
read_plist
(
project_file
)
saved_project
.
should
==
installer
.
pods_project
.
to_hash
should_xcodebuild
(
podfile
.
target_definitions
[
:default
])
should_xcodebuild
(
podfile
.
target_definitions
[
'Pods'
])
end
#--------------------------------------#
...
...
@@ -293,7 +295,7 @@ module Pod
(
config
.
sandbox_root
+
file
).
should
.
exist
end
should_xcodebuild
(
podfile
.
target_definitions
[
:default
])
should_xcodebuild
(
podfile
.
target_definitions
[
'Pods'
])
should_xcodebuild
(
podfile
.
target_definitions
[
:debug
])
should_xcodebuild
(
podfile
.
target_definitions
[
:test
])
end
...
...
spec/unit/installer/analyzer_spec.rb
View file @
6159183f
...
...
@@ -269,7 +269,8 @@ module Pod
end
it
"returns the first target of the project if the target definition is named default"
do
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
target_definition
.
link_with_first_target
=
true
user_project
=
Xcodeproj
::
Project
.
new
user_project
.
new_target
(
:application
,
'FirstTarget'
,
:ios
)
user_project
.
new_target
(
:application
,
'UserTarget'
,
:ios
)
...
...
spec/unit/installer/target_installer_spec.rb
View file @
6159183f
...
...
@@ -10,7 +10,7 @@ module Pod
platform
:ios
xcodeproj
'dummy'
end
@target_definition
=
@podfile
.
target_definitions
[
:default
]
@target_definition
=
@podfile
.
target_definitions
[
'Pods'
]
@project
=
Project
.
new
(
config
.
sandbox
.
project_path
)
config
.
sandbox
.
project
=
@project
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
6159183f
...
...
@@ -9,7 +9,8 @@ module Pod
sample_project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
@sample_project
=
Xcodeproj
::
Project
.
new
sample_project_path
@target
=
@sample_project
.
targets
.
first
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
target_definition
.
link_with_first_target
=
true
@lib
=
Library
.
new
(
target_definition
)
@lib
.
user_project_path
=
sample_project_path
pods_project
=
Project
.
new
()
...
...
spec/unit/installer/user_project_integrator_spec.rb
View file @
6159183f
...
...
@@ -17,7 +17,7 @@ module Pod
end
end
config
.
sandbox
.
project
=
Project
.
new
()
@library
=
Library
.
new
(
@podfile
.
target_definitions
[
:default
])
@library
=
Library
.
new
(
@podfile
.
target_definitions
[
'Pods'
])
@library
.
user_project_path
=
sample_project_path
@library
.
user_target_uuids
=
[
'A346496C14F9BE9A0080D870'
]
@library
.
support_files_root
=
config
.
sandbox
.
root
...
...
spec/unit/library_spec.rb
View file @
6159183f
...
...
@@ -5,7 +5,8 @@ module Pod
describe
"In general"
do
before
do
@target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
@target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
@target_definition
.
link_with_first_target
=
true
@lib
=
Library
.
new
(
@target_definition
)
end
...
...
@@ -28,7 +29,8 @@ module Pod
describe
"Support files"
do
before
do
@target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
@target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
@target_definition
.
link_with_first_target
=
true
@lib
=
Library
.
new
(
@target_definition
)
@lib
.
support_files_root
=
config
.
sandbox
.
root
@lib
.
user_project_path
=
config
.
sandbox
.
root
+
'../user_project.xcodeproj'
...
...
spec/unit/resolver_spec.rb
View file @
6159183f
...
...
@@ -27,7 +27,7 @@ module Pod
#--------------------------------------#
it
"resolves the specification of the podfile"
do
target_definition
=
@podfile
.
target_definitions
[
:default
]
target_definition
=
@podfile
.
target_definitions
[
'Pods'
]
specs
=
@resolver
.
resolve
[
target_definition
]
specs
.
map
(
&
:to_s
).
should
==
[
"A2DynamicDelegate (2.0.2)"
,
...
...
@@ -38,7 +38,7 @@ module Pod
it
"returns the resolved specifications grouped by target definition"
do
@resolver
.
resolve
target_definition
=
@podfile
.
target_definitions
[
:default
]
target_definition
=
@podfile
.
target_definitions
[
'Pods'
]
specs
=
@resolver
.
specs_by_target
[
target_definition
]
specs
.
map
(
&
:to_s
).
should
==
[
"A2DynamicDelegate (2.0.2)"
,
...
...
spec/unit/validator_spec.rb
View file @
6159183f
...
...
@@ -96,7 +96,7 @@ module Pod
it
"respects the local option"
do
validator
=
Validator
.
new
(
podspec_path
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
deployment_target
=
podfile
.
target_definitions
[
:default
].
platform
.
deployment_target
deployment_target
=
podfile
.
target_definitions
[
'Pods'
].
platform
.
deployment_target
deployment_target
.
to_s
.
should
==
"5.0"
end
...
...
@@ -114,7 +114,7 @@ module Pod
it
"uses the deployment target of the specification"
do
validator
=
Validator
.
new
(
podspec_path
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
dependency
=
podfile
.
target_definitions
[
:default
].
dependencies
.
first
dependency
=
podfile
.
target_definitions
[
'Pods'
].
dependencies
.
first
dependency
.
external_source
.
has_key?
(
:podspec
).
should
.
be
.
true
end
end
...
...
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