Commit 1ba0903e authored by Samuel E. Giddins's avatar Samuel E. Giddins

[PodTargetInstaller] Only set project, dylib, and compatibility versions to…

[PodTargetInstaller] Only set project, dylib, and compatibility versions to valid, three integer values.
parent 1ce76f34
...@@ -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
......
...@@ -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 dc259ab02f3c492504f164b82c29e846243e4b52
...@@ -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