This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.0.
This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.1.
To start using it, add the `swiftpm` plugin to your `plugins` array in `~/.zshrc`:
"--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
"--enable-parseable-module-interfaces[]"
"--trace-resolver[]"
"(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
"--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
"--build-tests[Build both source and test targets]"
"--product[Build the specified product]:Build the specified product: "
"--target[Build the specified target]:Build the specified target: "
...
...
@@ -125,13 +127,15 @@ _swift_run() {
"(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
"--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
"--static-swift-stdlib[Link Swift stdlib statically]"
"--enable-llbuild-library[Enable building with the llbuild library]"
"--force-resolved-versions[]"
"--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
"--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
"--enable-parseable-module-interfaces[]"
"--trace-resolver[]"
"(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
"--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
"--skip-build[Skip building the executable product]"
"--build-tests[Build both source and test targets]"
"--repl[Launch Swift REPL for the package]"
...
...
@@ -166,13 +170,15 @@ _swift_package() {
"(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
"--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
"--static-swift-stdlib[Link Swift stdlib statically]"
"--enable-llbuild-library[Enable building with the llbuild library]"
"--force-resolved-versions[]"
"--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
"--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
"--enable-parseable-module-interfaces[]"
"--trace-resolver[]"
"(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
"--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}"
)
_arguments $arguments && return
}
_swift_package_dump-package() {
arguments=(
)
_arguments $arguments && return
...
...
@@ -264,20 +277,23 @@ _swift_package_describe() {
_arguments $arguments && return
}
_swift_package_resolve() {
_swift_package_clean() {
arguments=(
":The name of the package to resolve:_swift_dependency"
"--version[The version to resolve at]:The version to resolve at: "
"--branch[The branch to resolve at]:The branch to resolve at: "
"--revision[The revision to resolve at]:The revision to resolve at: "
)
_arguments $arguments && return
}
_swift_package_tools-version() {
_swift_package_show-dependencies() {
arguments=(
"--set[Set tools version of package to the given value]:Set tools version of package to the given value: "
"--set-current[Set tools version of package to the current tools version in use]"
"--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}"
)
_arguments $arguments && return
}
_swift_package_init() {
arguments=(
"--type[empty|library|executable|system-module|manifest]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}"
"--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}"
"--set[Set tools version of package to the given value]:Set tools version of package to the given value: "
"--set-current[Set tools version of package to the current tools version in use]"
)
_arguments $arguments && return
}
...
...
@@ -303,8 +320,30 @@ _swift_package_fetch() {
_arguments $arguments && return
}
_swift_package_dump-package() {
_swift_package_resolve() {
arguments=(
":The name of the package to resolve:_swift_dependency"
"--version[The version to resolve at]:The version to resolve at: "
"--branch[The branch to resolve at]:The branch to resolve at: "
"--revision[The revision to resolve at]:The revision to resolve at: "
)
_arguments $arguments && return
}
_swift_package_reset() {
arguments=(
)
_arguments $arguments && return
}
_swift_package_generate-xcodeproj() {
arguments=(
"--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files"
"--enable-code-coverage[Enable code coverage in the generated project]"
"--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files"
"--legacy-scheme-generator[Use the legacy scheme generator]"
"--watch[Watch for changes to the Package manifest to regenerate the Xcode project]"
"--skip-extra-files[Do not add file references for extra files to the generated Xcode project]"
)
_arguments $arguments && return
}
...
...
@@ -330,8 +369,8 @@ _swift_package_config() {
local modes
modes=(
'unset-mirror:Remove an existing mirror'
'set-mirror:Set a mirror for a dependency'
'get-mirror:Print mirror configuration for the given package dependency'
"--type[empty|library|executable|system-module]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}"
"--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]"
"--enable-parseable-module-interfaces[]"
"--trace-resolver[]"
"(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: "
"--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]"
"--skip-build[Skip building the test target]"
"(--list-tests -l)"{--list-tests,-l}"[Lists test methods in specifier format]"
"--generate-linuxmain[Generate LinuxMain.swift entries for the package]"