swiftperfect

Why is the --clean not available any more for Swift command line? How to do clean now?


I try to clean the build by following the instruction in Perfect (Server side Swift framework):

swift build --clean

but it shows error:

error: unknown option --clean; use --help to list available options

My swift version is

>> swift --version
Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
Target: x86_64-apple-macosx10.9

Why is the --clean not available any more? How to do clean now?


Solution

  • The command was renamed to swift package clean in Swift 3.1 and the old syntax was removed in Swift 4.0.