summaryrefslogtreecommitdiff
path: root/plugins/swiftpm/_swift
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/swiftpm/_swift')
-rw-r--r--plugins/swiftpm/_swift225
1 files changed, 163 insertions, 62 deletions
diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift
index bed6e13a7..fe6f1c9aa 100644
--- a/plugins/swiftpm/_swift
+++ b/plugins/swiftpm/_swift
@@ -72,16 +72,25 @@ _swift_build() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
- "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
"--disable-prefetching[]"
"--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
+ "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
"--version[]"
"--destination[]: :_files"
"(--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-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
+ "--force-resolved-versions[]"
+ "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
+ "--enable-index-store[Enable indexing-while-building feature]"
+ "--disable-index-store[Disable indexing-while-building feature]"
+ "--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: "
@@ -108,17 +117,28 @@ _swift_run() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
- "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
"--disable-prefetching[]"
"--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
+ "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
"--version[]"
"--destination[]: :_files"
"(--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-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
+ "--force-resolved-versions[]"
+ "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
+ "--enable-index-store[Enable indexing-while-building feature]"
+ "--disable-index-store[Disable indexing-while-building feature]"
+ "--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]"
)
_arguments $arguments && return
}
@@ -140,16 +160,25 @@ _swift_package() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
- "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
"--disable-prefetching[]"
"--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
+ "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
"--version[]"
"--destination[]: :_files"
"(--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-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
+ "--force-resolved-versions[]"
+ "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
+ "--enable-index-store[Enable indexing-while-building feature]"
+ "--disable-index-store[Disable indexing-while-building feature]"
+ "--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]"
'(-): :->command'
'(-)*:: :->arg'
)
@@ -158,33 +187,28 @@ _swift_package() {
(command)
local modes
modes=(
- 'edit:Put a package in editable mode'
- 'clean:Delete build artifacts'
- 'init:Initialize a new package'
+ 'completion-tool:Completion tool (for shell completions)'
'dump-package:Print parsed Package.swift as JSON'
'describe:Describe the current package'
+ 'clean:Delete build artifacts'
+ 'show-dependencies:Print the resolved dependency graph'
+ 'init:Initialize a new package'
'unedit:Remove a package from editable mode'
- 'update:Update package dependencies'
- 'completion-tool:Completion tool (for shell completions)'
'tools-version:Manipulate tools version of the current package'
- 'reset:Reset the complete cache/build directory'
+ 'fetch:'
'resolve:Resolve package dependencies'
+ 'reset:Reset the complete cache/build directory'
'generate-xcodeproj:Generates an Xcode project'
- 'fetch:'
- 'show-dependencies:Print the resolved dependency graph'
+ 'edit:Put a package in editable mode'
+ 'config:Manipulate configuration of the package'
+ 'update:Update package dependencies'
)
_describe "mode" modes
;;
(arg)
case ${words[1]} in
- (edit)
- _swift_package_edit
- ;;
- (clean)
- _swift_package_clean
- ;;
- (init)
- _swift_package_init
+ (completion-tool)
+ _swift_package_completion-tool
;;
(dump-package)
_swift_package_dump-package
@@ -192,91 +216,92 @@ _swift_package() {
(describe)
_swift_package_describe
;;
- (unedit)
- _swift_package_unedit
+ (clean)
+ _swift_package_clean
;;
- (update)
- _swift_package_update
+ (show-dependencies)
+ _swift_package_show-dependencies
;;
- (completion-tool)
- _swift_package_completion-tool
+ (init)
+ _swift_package_init
+ ;;
+ (unedit)
+ _swift_package_unedit
;;
(tools-version)
_swift_package_tools-version
;;
- (reset)
- _swift_package_reset
+ (fetch)
+ _swift_package_fetch
;;
(resolve)
_swift_package_resolve
;;
+ (reset)
+ _swift_package_reset
+ ;;
(generate-xcodeproj)
_swift_package_generate-xcodeproj
;;
- (fetch)
- _swift_package_fetch
+ (edit)
+ _swift_package_edit
;;
- (show-dependencies)
- _swift_package_show-dependencies
+ (config)
+ _swift_package_config
+ ;;
+ (update)
+ _swift_package_update
;;
esac
;;
esac
}
-_swift_package_edit() {
- arguments=(
- ":The name of the package to edit:_swift_dependency"
- "--revision[The revision to edit]:The revision to edit: "
- "--branch[The branch to create]:The branch to create: "
- "--path[Create or use the checkout at this path]:Create or use the checkout at this path:_files"
- )
- _arguments $arguments && return
-}
-
-_swift_package_clean() {
+_swift_package_completion-tool() {
arguments=(
+ ": :{_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_init() {
+_swift_package_dump-package() {
arguments=(
- "--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]'}"
)
_arguments $arguments && return
}
-_swift_package_dump-package() {
+_swift_package_describe() {
arguments=(
+ "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}"
)
_arguments $arguments && return
}
-_swift_package_describe() {
+_swift_package_clean() {
arguments=(
- "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}"
)
_arguments $arguments && return
}
-_swift_package_unedit() {
+_swift_package_show-dependencies() {
arguments=(
- ":The name of the package to unedit:_swift_dependency"
- "--force[Unedit the package even if it has uncommited and unpushed changes.]"
+ "--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_update() {
+_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]'}"
+ "--name[Provide custom package name]:Provide custom package name: "
)
_arguments $arguments && return
}
-_swift_package_completion-tool() {
+_swift_package_unedit() {
arguments=(
- ": :{_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]'}"
+ ":The name of the package to unedit:_swift_dependency"
+ "--force[Unedit the package even if it has uncommited and unpushed changes.]"
)
_arguments $arguments && return
}
@@ -289,7 +314,7 @@ _swift_package_tools-version() {
_arguments $arguments && return
}
-_swift_package_reset() {
+_swift_package_fetch() {
arguments=(
)
_arguments $arguments && return
@@ -305,6 +330,12 @@ _swift_package_resolve() {
_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"
@@ -312,19 +343,78 @@ _swift_package_generate-xcodeproj() {
"--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
}
-_swift_package_fetch() {
+_swift_package_edit() {
arguments=(
+ ":The name of the package to edit:_swift_dependency"
+ "--revision[The revision to edit]:The revision to edit: "
+ "--branch[The branch to create]:The branch to create: "
+ "--path[Create or use the checkout at this path]:Create or use the checkout at this path:_files"
)
_arguments $arguments && return
}
-_swift_package_show-dependencies() {
+_swift_package_config() {
+ arguments=(
+ '(-): :->command'
+ '(-)*:: :->arg'
+ )
+ _arguments $arguments && return
+ case $state in
+ (command)
+ local modes
+ modes=(
+ 'unset-mirror:Remove an existing mirror'
+ 'get-mirror:Print mirror configuration for the given package dependency'
+ 'set-mirror:Set a mirror for a dependency'
+ )
+ _describe "mode" modes
+ ;;
+ (arg)
+ case ${words[1]} in
+ (unset-mirror)
+ _swift_package_config_unset-mirror
+ ;;
+ (get-mirror)
+ _swift_package_config_get-mirror
+ ;;
+ (set-mirror)
+ _swift_package_config_set-mirror
+ ;;
+ esac
+ ;;
+ esac
+}
+
+_swift_package_config_unset-mirror() {
+ arguments=(
+ "--package-url[The package dependency url]:The package dependency url: "
+ "--mirror-url[The mirror url]:The mirror url: "
+ )
+ _arguments $arguments && return
+}
+
+_swift_package_config_get-mirror() {
+ arguments=(
+ "--package-url[The package dependency url]:The package dependency url: "
+ )
+ _arguments $arguments && return
+}
+
+_swift_package_config_set-mirror() {
+ arguments=(
+ "--package-url[The package dependency url]:The package dependency url: "
+ "--mirror-url[The mirror url]:The mirror url: "
+ )
+ _arguments $arguments && return
+}
+
+_swift_package_update() {
arguments=(
- "--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
}
@@ -346,23 +436,34 @@ _swift_test() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
- "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]' 'undefined[enable Undefined Behavior sanitizer]'}"
"--disable-prefetching[]"
"--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
+ "--disable-package-manifest-caching[Disable caching Package.swift manifests]"
"--version[]"
"--destination[]: :_files"
"(--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-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
+ "--force-resolved-versions[]"
+ "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]"
+ "--enable-index-store[Enable indexing-while-building feature]"
+ "--disable-index-store[Disable indexing-while-building feature]"
+ "--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]"
"--parallel[Run the tests in parallel.]"
+ "--num-workers[Number of tests to execute in parallel.]:Number of tests to execute in parallel.: "
"(--specifier -s)"{--specifier,-s}"[]: : "
"--xunit-output[]: :_files"
"--filter[Run test cases matching regular expression, Format: <test-target>.<test-case> or <test-target>.<test-case>/<test>]:Run test cases matching regular expression, Format: <test-target>.<test-case> or <test-target>.<test-case>/<test>: "
+ "--enable-code-coverage[Test with code coverage enabled]"
)
_arguments $arguments && return
}