bignerdranch / Freddy

A reusable framework for parsing JSON in Swift.
MIT License
1.09k stars 120 forks source link

CocoaPods: Requesting version '~> 3.0.2' installs version 3.0.3 #272

Closed YMonnier closed 6 years ago

YMonnier commented 6 years ago

Hello,

I have found an issue with Freddy by using Cocoapods. When I specify the version Freddy 3.0.2, cocoapods installs the version 3.0.3.

Below my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'SuperApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for SuperApp
  pod 'Freddy', '~> 3.0.2'

  target 'SuperAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'SuperAppUITests' do
    inherit! :search_paths
    # Pods for testing
  end
end

When I run pod install:

Analyzing dependencies
Downloading dependencies
Installing Freddy (3.0.3)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `SuperApp.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] Automatically assigning platform ios with version 10.3 on target test because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

I have the same issue with my pods development :

s.dependency 'Freddy', '~> 3.0.2'

pod install:

...
Installing Freddy 3.0.3 (was 3.0.2)
...

Thanks, YM

jeremy-w commented 6 years ago

If you just want 3.0.2, then say 'Freddy', '3.0.2'.

As-is, it works as expected for the ~> 3.0.2 version specifier:

In addition to the logic operators CocoaPods has an optimistic operator ~>:

  • '~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher

https://guides.cocoapods.org/using/the-podfile.html#specifying-pod-versions