THE SWIFT PACKAGE MANAGER — X — FILE

PACKAGE

HOW TO ENABLE YOUR CURRENT FRAMEWORK XCODE PROJECT TO SUPPORT SPM?

Duplicate Debug configuration by pressing the “+” button and rename it to Debug-test
Under the target build settings search for “Other swift flag” and write -DTEST only for Debug-test configuration
In the scheme for the target select Test and change its build configuration to Debug-test
Duplicate the LittleBlueTooth target
Set that target to compile with the -DTEST flag
In the general settings, be sure you have your dependency set in Frameworks and Libraries
Do the same in Build phases for Link Binary With Libraries
Modify the scheme to launch testing using the Debug-test configuration and using the + add the LittleBlueToothTests bundle
Remove the unit test bundle from the original target
  • Symlink are not the same thing as Finder aliases. Aliases won’t work
  • Symlink must have a relative path to the repo, by default absolute path are created and they will work only on your machine

CONCLUSION

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store