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
8c7eacb5
Commit
8c7eacb5
authored
Dec 24, 2014
by
Eloy Durán
Committed by
Samuel E. Giddins
Jul 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Frameworks] Add project/dylib/compatibility versions.
parent
854c0188
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+18
-0
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+28
-0
No files found.
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
8c7eacb5
...
@@ -36,6 +36,24 @@ module Pod
...
@@ -36,6 +36,24 @@ module Pod
private
private
# Adds the project/library and compatibility versions, which are only
# applicable to dynamic libraries.
#
# @return [Hash{String => String}]
#
def
custom_build_settings
settings
=
super
if
target
.
requires_frameworks?
version
=
target
.
root_spec
.
version
compatibility_version
=
version
.
segments
.
first
compatibility_version
=
version
.
version
if
compatibility_version
<
1
settings
[
'CURRENT_PROJECT_VERSION'
]
=
version
.
version
settings
[
'DYLIB_COMPATIBILITY_VERSION'
]
=
compatibility_version
.
to_s
settings
[
'DYLIB_CURRENT_VERSION'
]
=
'$(CURRENT_PROJECT_VERSION)'
end
settings
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
SOURCE_FILE_EXTENSIONS
=
Sandbox
::
FileAccessor
::
SOURCE_FILE_EXTENSIONS
SOURCE_FILE_EXTENSIONS
=
Sandbox
::
FileAccessor
::
SOURCE_FILE_EXTENSIONS
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
8c7eacb5
...
@@ -219,6 +219,7 @@ module Pod
...
@@ -219,6 +219,7 @@ module Pod
end
end
#--------------------------------------------------------------------------------#
#--------------------------------------------------------------------------------#
describe
'concerning compiler flags'
do
describe
'concerning compiler flags'
do
before
do
before
do
@spec
=
Pod
::
Spec
.
new
@spec
=
Pod
::
Spec
.
new
...
@@ -296,6 +297,33 @@ module Pod
...
@@ -296,6 +297,33 @@ module Pod
end
end
end
end
end
end
#--------------------------------------------------------------------------------#
describe
'concerning framework versions'
do
before
do
@pod_target
.
stubs
(
:requires_frameworks?
=>
true
)
@spec
.
stubs
(
:version
=>
Version
.
new
(
'1.2.3'
))
end
it
'sets the project and library version'
do
settings
=
@installer
.
send
(
:custom_build_settings
)
settings
[
'CURRENT_PROJECT_VERSION'
].
should
==
'1.2.3'
settings
[
'DYLIB_CURRENT_VERSION'
].
should
==
'$(CURRENT_PROJECT_VERSION)'
end
it
'sets the library compatibility version to the major version'
do
settings
=
@installer
.
send
(
:custom_build_settings
)
settings
[
'DYLIB_COMPATIBILITY_VERSION'
].
should
==
'1'
end
it
'sets the library compatibility version to the exact version when it is less than v1 (because SemVer makes no promises)'
do
@spec
.
stubs
(
:version
=>
Version
.
new
(
'0.1.2'
))
settings
=
@installer
.
send
(
:custom_build_settings
)
settings
[
'DYLIB_COMPATIBILITY_VERSION'
].
should
==
'0.1.2'
end
end
end
end
end
end
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