id = "swift" name = "Swift" homepage = "https://www.swift.org" description = "A general-purpose programming language built using a modern approach to safety, performance, and software design patterns." icon = "SimpleIcons:swift" executables = ["swift", "swiftc"] [dotfiles] # Sources/Basics/FileSystem/FileSystem+Extensions.swift in swift-package-manager # defines dotSwiftPM as ~/.swiftpm (or $XDG_CONFIG_HOME/swiftpm), with # dotSwiftPMConfigurationDirectory appending "configuration", # dotSwiftPMCachesDirectory "cache" and dotSwiftPMSecurityDirectory "security". # Documentation/PackageRegistry/PackageRegistryUsage.md: `swift # package-registry set --global` "applies the setting at the user level" and # writes ~/.swiftpm/configuration/registries.json. mirrors.json is not listed: # it moved to /.swiftpm/configuration/ in SwiftPM 5.6 and has no # user-level form. paths = ["~/.swiftpm/configuration/registries.json"] # ~/.swiftpm/cache is the download and manifest cache; ~/.swiftpm/security # holds the fingerprints and signing-entity records SwiftPM accumulates while # it resolves packages. Both are state it can regenerate. exclude = [ "~/.swiftpm/cache/", "~/.swiftpm/security/", ] # registries.json holds registry URLs and nothing else. The same document says # `swift package-registry login` saves the credential "to the operating # system's credential store (e.g. Keychain in macOS) or netrc file (which by # default is located at ~/.netrc)", never into this file. secret = [] # No machine_lines: a registry URL is a team-wide choice, and setting it # globally is the user saying they want it everywhere. [commands] format = 1 label = "Swift Package Manager" description = "Build, run and test a Swift package. Compiler flags, package and other subcommands are left out." quality = "ai-draft" base = "fig:swift" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/swift.ts" license = "MIT" [[commands.subcommand]] path = ["build"] label = "Build" description = "Build sources into binary products." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/swift.ts" license = "MIT" [[commands.subcommand.field]] id = "product" label = "Product" type = "string" option = ["--product"] sources = ["fig"] [[commands.subcommand.field]] id = "target" label = "Target" type = "string" option = ["--target"] sources = ["fig"] [[commands.subcommand.field]] id = "build_tests" label = "Build tests too" type = "boolean" option = ["--build-tests"] sources = ["fig"] [[commands.subcommand.field]] id = "show_bin_path" label = "Print binary path" type = "boolean" option = ["--show-bin-path"] sources = ["fig"] [[commands.subcommand.task]] id = "build" label = "Build package" fields = ["product", "target", "build_tests"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["product", "target", "build_tests", "show_bin_path"] [[commands.subcommand]] path = ["run"] label = "Run" description = "Build and run an executable product." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/swift.ts" license = "MIT" [[commands.subcommand.field]] id = "executable" label = "Executable" type = "string" position = 0 sources = ["fig"] [[commands.subcommand.field]] id = "arguments" label = "Arguments" type = "string" position = 1 multiple = true sources = ["fig"] [[commands.subcommand.field]] id = "skip_build" label = "Skip build" type = "boolean" option = ["--skip-build"] sources = ["fig"] [[commands.subcommand.field]] id = "build_tests" label = "Build tests too" type = "boolean" option = ["--build-tests"] sources = ["fig"] [[commands.subcommand.field]] id = "repl" label = "Launch REPL" type = "boolean" option = ["--repl"] sources = ["fig"] [[commands.subcommand.task]] id = "run" label = "Run executable" fields = ["executable", "arguments", "skip_build"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["executable", "arguments", "skip_build"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["build_tests", "repl"] [[commands.subcommand]] path = ["test"] label = "Test" description = "Build and run tests." parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/swift.ts" license = "MIT" [[commands.subcommand.field]] id = "filter" label = "Filter (regex)" type = "string" option = ["--filter"] sources = ["fig"] [[commands.subcommand.field]] id = "skip" label = "Skip (regex)" type = "string" option = ["--skip"] sources = ["fig"] [[commands.subcommand.field]] id = "parallel" label = "Run in parallel" type = "boolean" option = ["--parallel"] sources = ["fig"] [[commands.subcommand.field]] id = "num_workers" label = "Parallel workers" type = "integer" option = ["--num-workers"] sources = ["fig"] [[commands.subcommand.field]] id = "skip_build" label = "Skip build" type = "boolean" option = ["--skip-build"] sources = ["fig"] [[commands.subcommand.field]] id = "list_tests" label = "List tests" type = "boolean" option = ["--list-tests", "-l"] sources = ["fig"] [[commands.subcommand.field]] id = "xunit_output" label = "xUnit output file" type = "path" option = ["--xunit-output"] path = { kind = "file", role = "output", must_exist = false } sources = ["fig"] [[commands.subcommand.task]] id = "test" label = "Run tests" fields = ["filter", "parallel"] required = [] [[commands.subcommand.task]] id = "list" label = "List tests" set = { list_tests = [true] } lock = ["list_tests"] fields = ["list_tests", "filter"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["filter", "skip", "parallel", "list_tests"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["num_workers", "skip_build", "xunit_output"]