SecretSquirrel: A Demonstration of releasing Closed Source libraries privately via SPM.
A demo repository that showcases how to properly vend a closed-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:
- First, you must run
./generateFatBinary.shto generate the closed-source binary that the app project consumes. - Open the app project and run the app.
Overview:
- The
SecretSquirrelFrameworkrepresents the "hidden" source that the client does not have access to. - The
generateFatBinary.shscript represents your library publishing process. Run./generateFatBinary.shin the project root directory to generate a "Release" of theSecretSquirrelFrameworkinto theProductsdirectory. - The
Productsdirectory represents the deliverable. After generating the release, The entire directory would be zipped up and given to the client. - The
SecretSquirrelApprepresents 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
SecretSquirrelSPMpackage is an empty wrapper type that allows us to wrapSecretSquirrelin a second framework that allows us to define and satisfy allSecretSquirreldependancies 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.
