LoginSignup
1
2

More than 1 year has passed since last update.

【SwiftPM】依存関係のバージョンの書き方

Posted at

開発環境

  • Xcode13.3
  • Swift5.6

依存関係のバージョンの書き方

メジャーバージョンは同じままで、特定のバージョン以降を指定

次の例では、Swift パッケージマネージャが 1.2.3, 1.2.4, 1.3.0 のようなバージョンを選択し、2.0.0 を選択しないようにしています。

.package(url: "https://example.com/example-package.git", from: "1.2.3"),

範囲指定

Open Range

次の例では、Swift パッケージマネージャがバージョン 1.2.3、1.2.4、1.2.5 を選択し、1.2.6 を選択しないようにします。

.package(url: "https://example.com/example-package.git", "1.2.3"..<"1.2.6"),

Close Range

次の例では、Swift パッケージマネージャが 1.2.3, 1.2.4, 1.2.5, 1.2.6 のバージョンを選択できるようにしています。

.package(url: "https://example.com/example-package.git", "1.2.3"..."1.2.6"),

特定のバージョンを指定

次の例では、Swift パッケージマネージャが 1.2.3のバージョンを選択できるようにしています。

.package(url: "https://example.com/example-package.git", exact: "1.2.3"),

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2