SwiftyBuild
SwiftyBones is built in a modular way with multiple files, which means we will need to compile all necessary files within our project. It would very quickly become annoying compiling our projects like this:
swiftc -o myexec main.swift tempSensor.swift SwiftyBonesCommon.swift SwiftyBonesDigitalGPIO.swift
With this in mind, SwiftyBones comes with a script that would search the current directory and all subdirectories for any files that has the .swift
extension. This script will then build a swift compiler command that compiles all of the swift files that it found into a single executable. The script is named swiftybuild.sh
. This script takes a single optional command line argument that would be the name of the executable file if everything successfully compiles. You would use this script like this:
./swiftybuild.sh or ./swiftybuild.sh myexec
The output from the first command would be an executable file named main
if everything compiled successfully. The second command would...