Difference between revisions of "Script Snippet: Swift Packages"

From Coder Merlin
(Undo revision 2997 by Merlin (talk))
Tag: Undo
 
Line 3: Line 3:
swift package init --type executable
swift package init --type executable
</syntaxhighlight>
</syntaxhighlight>
You’ll see your login name, an at (@) sign, the name of the server (“codermerlin”), a colon (:), a tilde (~), and a $. This will be followed by a flashing block called a '''cursor'''. The cursor indicates where new characters will appear as you type. The cursor will continue to flash patiently as it awaits input. We’ll get back to the meaning of the tilde soon.


== Remove the build artifacts of a Swift Package ==
== Remove the build artifacts of a Swift Package ==

Latest revision as of 13:36, 1 July 2019

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Create a new Swift Package for an Executable[edit]

swift package init --type executable

Remove the build artifacts of a Swift Package[edit]

swift package reset

Build a Swift Package in default debug mode[edit]

swift build

Build a Swift Package for debugging in lldb[edit]

swift build -Xswiftc -g

Build a Swift Package in release mode[edit]

swift build

Create a Library[edit]

swift build -Xswiftc -emit-library

Consume a Library[edit]

swift build -Xswiftc -I -Xswiftc ./.build/debug -Xswiftc -L -Xswiftc ./.build/debug -Xswiftc -lmyDynamicLib

Reference