JFrog Artifactory Supports Binary Dependencies for Swift

MMS Founder
MMS Sergio De Simone

Article originally posted on InfoQ. Visit InfoQ

JFrog has announced its Artifactory repository can be used as a binary package registry for Swift dependencies using the Swift Package Manager.

Since its introduction with Swift 3, Apple has been extending the Swift Package Manager to make it the go-to package manager for the Swift ecosystem. Originally, the Swift Package Manager was initially designed to work with source-only packages that could be retrieved from git-based repositories.

While sound, this approach posed a number of limitations to developers and companies, such as having to publish their source code with the only aim to create a Swift package and being restricted to a build process fitting into the Swift Package Manager build model. Additionally, developers have experienced other kinds of mishaps, such as broken dependencies due to commits or tags disappearing after history rewrites.

This led Apple to introduce support for package manager binary dependencies in 2020, which finally landed into the Swift 5.3 release. More recently, Apple has been working on adding support for registry-based package retrieval which paved the way to alternatives to using GitHub and other source-control services to store binary dependencies.

JFrog is now announcing that developers can use JFrog Artifactory to serve Swift binary packages.

Today there are thousands of packages available in public source control repositories and require a way to map URLs to unique identities, potentially across multiple SCM providers. Thankfully, Artifactory’s flexible metadata system makes it easy to map various URLs to a single identity, enabling the Swift Package Manager to query the registry and avoid duplication across the two identity systems.

Artifactory supports three types of repositories: local repos, aimed to host packages to be shared only within a team; remote repos, which are caching proxies for repositories managed at a remote URL; and virtual repos, which combine the features of both local and remote repositories.

According to JFrog, the use of registry-based dependencies brings a number of benefits, including increased efficiency thanks to the use of a specific protocol, the possibility of unequivocally tying a given dependency version to its author, better stability for interoperation with multiple languages, and support for metadata.

JFrog Artifactory can be run either self-hosted or using its Cloud platform, which also provides a free tier.

About the Author

Subscribe for MMS Newsletter

By signing up, you will receive updates about our latest information.

  • This field is for validation purposes and should be left unchanged.