swift package

Perform operations on Swift packages

Subcommands

NameDescription
cleanDelete build artifacts
purge-cachePurge the global repository cache
resetReset the complete cache/build directory
updateUpdate package dependencies
describeDescribe the current package
initInitialize a new package
experimental-api-diffDiagnose API-breaking changes to Swift modules in a package
dump-symbol-graphDump Symbol Graph
dump-pifDump PIF
dump-packagePrint parsed Package.swift as JSON
editPut a package in editable mode
uneditRemove a package from editable mode
configManipulate configuration of the package
resolveResolve package dependencies
show-dependenciesPrint the resolved dependency graph
tools-versionManipulate tools version of the current package
generate-xcodeprojGenerates an Xcode project (this command will be deprecated soon)
compute-checksumCompute the checksum for a binary artifact
archive-sourceCreate a source archive for the package
completion-toolCompletion tool (for shell completions)

Options

NameDescription
--help, -h, -helpShow help information
--versionShow the version
-Xcc <flag>Pass a flag through to all C compiler invocations
-Xswiftc <flag>Pass a flag through to all Swift compiler invocations
-Xlinker <flag>Pass a flag through to all linker invocations
-c, --configuration <configuration>Build with configuration (default: debug)
--build-path <path>Specify build/cache directory
--cache-path <path>Specify the shared cache directory
--enable-repository-cacheEnable the use of a shared cache when fetching repositories (default: enabled)
--disable-repository-cacheDisable the use of a shared cache when fetching repositories (default: enabled)
-C, --chdir <chdir>The custom working directory that the tool should operate in
--package-path <path>Change working directory before any other operation
--multiroot-data-file <multiroot-data-file>The path to the file containing multiroot package data. This is currently Xcode's workspace file
--enable-prefetchingEnable prefetching in resolver which will kick off parallel git cloning (default: enabled)
--disable-prefetchingDisable prefetching in resolver which will kick off parallel git cloning (default: enabled)
-v, --verboseIncrease verbosity of informational output
--disable-sandboxDisable using the sandbox when executing subprocesses
--manifest-cache <mode>Caching mode of Package.swift manifests
--destination <path>Path to the compilation destination describing JSON file
--triple <triple>The compilation destination's target triple
--sdk <path>Path to the compilation destination's SDK
--toolchain <path>Path to the compilation destination's toolchain
--static-swift-stdlibLink Swift stdlib statically (default: false)
--no-static-swift-stdlibDon't link Swift stdlib statically (default: false)
--skip-updateSkip updating dependencies from their remote during a resolution
--sanitize <type>Turn on runtime checks for erroneous behavior
--enable-code-coverageEnable code coverage (default: disabled)
--disable-code-coverageDisable code coverage (default: disabled)
--force-resolved-versions, --disable-automatic-resolution, --only-use-versions-from-resolved-fileOnly use versions from the Package.resolved file and fail resolution if it is out-of-date
--auto-index-storeEnable or disable indexing-while-building feature (default: auto)
--enable-index-storeEnable indexing-while-building feature (default: auto)
--disable-index-storeDisable indexing-while-building feature (default: auto)
--enable-parseable-module-interfacesWhether to enable generation of `.swiftinterface`s alongside `.swiftmodule`s
--trace-resolverWrite dependency resolver trace to a file
-j, --jobs <jobs>The number of jobs to spawn in parallel during the build process
--enable-build-manifest-cachingWhether to enable llbuild manifest caching (default: enabled)
--disable-build-manifest-cachingWhether to disable llbuild manifest caching (default: enabled)
--emit-swift-module-separatelyEmit the Swift module separately from the object files
--use-integrated-swift-driverWhether to use the integrated Swift driver rather than shelling out to a separate process
--experimental-explicit-module-buildWhether to use the explicit module build flow (with the integrated driver)
--print-manifest-job-graphWrite the command graph for the build manifest as a graphviz file
--build-system <build system>The build system to use (default: native)
--netrc <bool>Whether to load .netrc files for authenticating with remote servers when downloading binary artifacts or communicating with a registry
--netrc-file <path>The path to the .netrc file used when `netrc` is `true`