A demo repository that showcases how to properly vend a closed-source framework via SPM

SecretSquirrel: A Demonstration of releasing Closed Source libraries privately via SPM.

A demo repository that showcases how to properly vend a close-source framework.

  • Check out The Basic Demo to get the basic idea of how this is done
  • Check out The Dependancy Demo to see how you can easily satisfy external dependancies for an opaque binary framework using a wrapper package.

Getting Started:

  1. First, you must run ./generateFatBinary.sh to generate the closed-source binary that the app project consumes.
  2. Open the app project and run the app.

Overview:

  • The SecretSquirrelFramework represents the “hidden” source that the client does not have access to.
  • The generateFatBinary.sh script represents your library publishing process. Run ./generateFatBinary.sh in the project root directory to generate a “Release” of the SecretSquirrelFramework into the Products directory.
  • The Products directory represents the deliverable. After generating the release, The entire directory would be zipped up and given to the client.
  • The SecretSquirrelApp represents the client app that uses the black-box framework. It consumes the library’s package.swift as part of the local swift package deliverable that would be ordinarily recieved as a zip, decompressed, and then bundled into the client project.
  • The SecretSquirrelSPM package is an empty wrapper type that allows us to wrap SecretSquirrel in a second framework that allows us to define and satisfy all SecretSquirrel dependancies for the client without betraying any source. The only reason the swift file exists is because SPM refuses to generate a target package that contains no source at all.

GitHub

View Github