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
3198bde0
Commit
3198bde0
authored
Nov 13, 2015
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTarget] Ensure the deployment target is high enough for frameworks
parent
61b3669d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
17 deletions
+40
-17
installer.rb
lib/cocoapods/installer.rb
+1
-0
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+0
-12
pod_target.rb
lib/cocoapods/target/pod_target.rb
+20
-2
validator.rb
lib/cocoapods/validator.rb
+9
-2
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+10
-1
No files found.
lib/cocoapods/installer.rb
View file @
3198bde0
...
@@ -380,6 +380,7 @@ module Pod
...
@@ -380,6 +380,7 @@ module Pod
aggregate_targets
.
each
do
|
aggregate_target
|
aggregate_targets
.
each
do
|
aggregate_target
|
aggregate_target
.
pod_targets
.
each
do
|
pod_target
|
aggregate_target
.
pod_targets
.
each
do
|
pod_target
|
pod_target
.
host_requires_frameworks
||=
aggregate_target
.
requires_frameworks?
pod_target
.
host_requires_frameworks
||=
aggregate_target
.
requires_frameworks?
pod_target
.
platform
=
nil
# needs to be recomputed
end
end
end
end
end
end
...
...
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
3198bde0
...
@@ -325,18 +325,6 @@ module Pod
...
@@ -325,18 +325,6 @@ module Pod
end
end
end
end
# The deployment target for the pod target, which is the maximum of all
# the deployment targets for the current platform of the target.
#
# @return [String] The deployment target.
#
def
deployment_target
default
=
Podfile
::
TargetDefinition
::
PLATFORM_DEFAULTS
[
target
.
platform
.
name
]
target
.
specs
.
map
do
|
spec
|
Pod
::
Version
.
new
(
spec
.
deployment_target
(
target
.
platform
.
name
)
||
default
)
end
.
max
.
to_s
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
end
end
end
end
...
...
lib/cocoapods/target/pod_target.rb
View file @
3198bde0
...
@@ -88,12 +88,30 @@ module Pod
...
@@ -88,12 +88,30 @@ module Pod
end
end
end
end
# @return [Platform] the platform for this target.
# The deployment target for the pod target, which is the maximum of all
# the deployment targets for the current platform of the target.
#
# @return [String] The deployment target.
#
#
def
platform
def
platform
@platform
||=
target_definitions
.
first
.
platform
@platform
||=
begin
platform_name
=
target_definitions
.
first
.
platform
.
name
default
=
Podfile
::
TargetDefinition
::
PLATFORM_DEFAULTS
[
platform_name
]
deployment_target
=
specs
.
map
do
|
spec
|
version
=
Pod
::
Version
.
new
(
spec
.
deployment_target
(
platform_name
)
||
default
)
if
platform_name
==
:ios
&&
requires_frameworks?
minimum
=
Version
.
new
(
'8.0'
)
version
=
[
version
,
minimum
].
max
end
version
end
.
max
Platform
.
new
(
platform_name
,
deployment_target
)
end
end
end
# @visibility private
attr_writer
:platform
# @return [Podfile] The podfile which declares the dependency.
# @return [Podfile] The podfile which declares the dependency.
#
#
def
podfile
def
podfile
...
...
lib/cocoapods/validator.rb
View file @
3198bde0
...
@@ -364,8 +364,16 @@ module Pod
...
@@ -364,8 +364,16 @@ module Pod
Config
.
instance
=
@original_config
Config
.
instance
=
@original_config
end
end
def
d
ownload_pod
def
d
eployment_target
deployment_target
=
spec
.
subspec_by_name
(
subspec_name
).
deployment_target
(
consumer
.
platform_name
)
deployment_target
=
spec
.
subspec_by_name
(
subspec_name
).
deployment_target
(
consumer
.
platform_name
)
if
consumer
.
platform_name
==
:ios
&&
use_frameworks
minimum
=
Version
.
new
(
'8.0'
)
deployment_target
=
[
Version
.
new
(
deployment_target
),
minimum
].
max
.
to_s
end
deployment_target
end
def
download_pod
podfile
=
podfile_from_spec
(
consumer
.
platform_name
,
deployment_target
,
use_frameworks
)
podfile
=
podfile_from_spec
(
consumer
.
platform_name
,
deployment_target
,
use_frameworks
)
sandbox
=
Sandbox
.
new
(
config
.
sandbox_root
)
sandbox
=
Sandbox
.
new
(
config
.
sandbox_root
)
@installer
=
Installer
.
new
(
sandbox
,
podfile
)
@installer
=
Installer
.
new
(
sandbox
,
podfile
)
...
@@ -376,7 +384,6 @@ module Pod
...
@@ -376,7 +384,6 @@ module Pod
def
create_app_project
def
create_app_project
app_project
=
Xcodeproj
::
Project
.
new
(
validation_dir
+
'App.xcodeproj'
)
app_project
=
Xcodeproj
::
Project
.
new
(
validation_dir
+
'App.xcodeproj'
)
deployment_target
=
spec
.
subspec_by_name
(
subspec_name
).
deployment_target
(
consumer
.
platform_name
)
app_project
.
new_target
(
:application
,
'App'
,
consumer
.
platform_name
,
deployment_target
)
app_project
.
new_target
(
:application
,
'App'
,
consumer
.
platform_name
,
deployment_target
)
app_project
.
save
app_project
.
save
app_project
.
recreate_user_schemes
app_project
.
recreate_user_schemes
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
3198bde0
...
@@ -49,8 +49,17 @@ module Pod
...
@@ -49,8 +49,17 @@ module Pod
target
.
build_settings
(
'Debug'
)[
'IPHONEOS_DEPLOYMENT_TARGET'
].
should
==
'4.3'
target
.
build_settings
(
'Debug'
)[
'IPHONEOS_DEPLOYMENT_TARGET'
].
should
==
'4.3'
end
end
it
'sets the platform and the deployment target for iOS targets that require frameworks'
do
@pod_target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@installer
.
install!
target
=
@project
.
targets
.
first
target
.
platform_name
.
should
==
:ios
target
.
deployment_target
.
should
==
'8.0'
target
.
build_settings
(
'Debug'
)[
'IPHONEOS_DEPLOYMENT_TARGET'
].
should
==
'8.0'
end
it
'sets the platform and the deployment target for OS X targets'
do
it
'sets the platform and the deployment target for OS X targets'
do
@pod_target
.
stubs
(
:platform
).
returns
(
Platform
.
new
(
:osx
,
'10.8'
))
@pod_target
.
target_definitions
.
first
.
stubs
(
:platform
).
returns
(
Platform
.
new
(
:osx
,
'10.8'
))
@installer
.
install!
@installer
.
install!
target
=
@project
.
targets
.
first
target
=
@project
.
targets
.
first
target
.
platform_name
.
should
==
:osx
target
.
platform_name
.
should
==
:osx
...
...
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