Commit d436c306 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #3899 from CocoaPods/seg-project-version

[PodTargetInstaller] Only set project, dylib, and compatibility versi…
parents 1ce76f34 0bd2f9f7
...@@ -28,6 +28,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -28,6 +28,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#3529](https://github.com/CocoaPods/CocoaPods/issues/3529) [#3529](https://github.com/CocoaPods/CocoaPods/issues/3529)
* Only set project, dylib, and compatibility versions to valid, three integer
values.
[Samuel Giddins](https://github.com/segiddins)
[#3887](https://github.com/CocoaPods/CocoaPods/issues/3887)
## 0.38.1 ## 0.38.1
......
...@@ -7,7 +7,7 @@ GIT ...@@ -7,7 +7,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Core.git remote: https://github.com/CocoaPods/Core.git
revision: d5a4287c801623b7df69c150c94c7bf1955769d6 revision: 8e162858381d2a079d81c12be79fd5443f17c4ea
branch: master branch: master
specs: specs:
cocoapods-core (0.38.1) cocoapods-core (0.38.1)
......
...@@ -45,9 +45,10 @@ module Pod ...@@ -45,9 +45,10 @@ module Pod
settings = super settings = super
if target.requires_frameworks? if target.requires_frameworks?
version = target.root_spec.version version = target.root_spec.version
compatibility_version = version.segments.first project_version = [version.major, version.minor, version.patch].join('.')
compatibility_version = version.version if compatibility_version < 1 compatibility_version = version.major
settings['CURRENT_PROJECT_VERSION'] = version.version compatibility_version = project_version if compatibility_version < 1
settings['CURRENT_PROJECT_VERSION'] = project_version
settings['DYLIB_COMPATIBILITY_VERSION'] = compatibility_version.to_s settings['DYLIB_COMPATIBILITY_VERSION'] = compatibility_version.to_s
settings['DYLIB_CURRENT_VERSION'] = '$(CURRENT_PROJECT_VERSION)' settings['DYLIB_CURRENT_VERSION'] = '$(CURRENT_PROJECT_VERSION)'
end end
......
Subproject commit 6e68269b557236f9bd5afa3bc41b0f05d7d224ba Subproject commit 7f22925eb2376498253642dfce1b729d44375d16
...@@ -322,6 +322,23 @@ module Pod ...@@ -322,6 +322,23 @@ module Pod
settings = @installer.send(:custom_build_settings) settings = @installer.send(:custom_build_settings)
settings['DYLIB_COMPATIBILITY_VERSION'].should == '0.1.2' settings['DYLIB_COMPATIBILITY_VERSION'].should == '0.1.2'
end end
describe 'with weird version numbers' do
handles = -> (version, project_version, compatibility_version) do
it "handles #{version}" do
@spec.stubs(:version => Version.new(version))
settings = @installer.send(:custom_build_settings)
settings['CURRENT_PROJECT_VERSION'].should == project_version
settings['DYLIB_COMPATIBILITY_VERSION'].should == compatibility_version
end
end
handles['1.alpha', '1.0.0', '1']
handles['0.1-alpha', '0.1.0', '0.1.0']
handles['1.2.3.4', '1.2.3', '1']
handles['0.2.3.4', '0.2.3', '0.2.3']
handles['1.alpha.2', '1.0.0', '1']
end
end end
end end
end end
......
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