id = "stack" name = "Stack" homepage = "https://haskellstack.org" description = "Stack is a program for developing Haskell projects, aimed at new and experienced users and supporting Linux, macOS and Windows." # Stack's own favicon, from its documentation site. icon = "https://docs.haskellstack.org/en/stable/img/stack-favicon.svg" executables = ["stack"] [dotfiles] # https://docs.haskellstack.org/en/stable/topics/stack_root/ — the Stack root # is ~/.stack on Unix-like operating systems and %APPDATA%\stack on Windows, # and config.yaml in it is "Stack's global configuration file". The rest of the # root (pantry/, programs/, snapshots/, stack.sqlite3, setup-exe-cache/) is # multi-gigabyte build state, so only the config file is listed. paths = ["~/.stack/config.yaml", "%APPDATA%/stack/config.yaml"] exclude = [] # Same page: the upload directory "may contain saved credentials for uploading # packages to Hackage (credentials.json)" — written when save-hackage-creds is # left at its default. A Hackage username and password, whole file. secret = ["~/.stack/upload/credentials.json", "%APPDATA%/stack/upload/credentials.json"] # Both spellings, or a Windows machine syncs its own C:\ paths out. Every key # here names a directory that exists on this machine only: # https://docs.haskellstack.org/en/stable/configure/yaml/non-project/ — # local-bin-path is "the target directory for stack build --copy-bins and # stack install", local-programs-path "overrides the location of the Stack # 'programs' directory, where tools like GHC get installed", extra-include-dirs # and extra-lib-dirs are "extra paths to be searched for header files" and # "for libraries" (typically a Homebrew or MSYS2 prefix), and extra-path is # "additional directories to prepend to the PATH". # # templates.params (author-name, author-email, github-username) is deliberately # not here: that is identity the user wants on every machine. # # local-bin-path, local-programs-path and extra-path are the user's own layout — # where their binaries go, where GHC gets installed, what they prepend to PATH — # so they are kept for rebuilding this machine and applied to no other. [[dotfiles.machine_lines]] file = ["~/.stack/config.yaml", "%APPDATA%/stack/config.yaml"] match = { key_path = [ "local-bin-path", "local-programs-path", "extra-path", ] } scope = "backup" # extra-include-dirs and extra-lib-dirs are the Homebrew or MSYS2 prefix the # headers and libraries were installed under, which follows from the OS and the # architecture and not from this box — hence the split from the three above, # and hence a value shared across that whole machine class. [[dotfiles.machine_lines]] file = ["~/.stack/config.yaml", "%APPDATA%/stack/config.yaml"] match = { key_path = [ "extra-include-dirs", "extra-lib-dirs", ] } scope = "platform" [commands] format = 1 label = "Haskell Stack" description = "Build, test and create Haskell projects. Setup, upload and the other stack commands are left out." quality = "ai-draft" base = "fig:stack" 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/stack.ts" license = "MIT" [[commands.subcommand]] path = ["build"] label = "Build packages" description = "Build the packages in the current project." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/stack.ts" license = "MIT" [[commands.subcommand.field]] id = "targets" label = "Targets" type = "string" position = 0 description = "Packages or targets to build; empty builds the project." multiple = true sources = ["fig"] [[commands.subcommand.field]] id = "test" label = "Run tests" type = "boolean" option = ["--test"] description = "Run the complete test suite." sources = ["fig"] [[commands.subcommand.field]] id = "bench" label = "Run benchmarks" type = "boolean" option = ["--bench"] description = "Run benchmarks." sources = ["fig"] [[commands.subcommand.field]] id = "haddock" label = "Build Haddocks" type = "boolean" option = ["--haddock"] description = "Generate Haddocks." sources = ["fig"] [[commands.subcommand.field]] id = "file_watch" label = "Watch files" type = "boolean" option = ["--file-watch"] description = "Rebuild when files change." sources = ["fig"] [[commands.subcommand.field]] id = "pedantic" label = "Pedantic" type = "boolean" option = ["--pedantic"] description = "Turn on -Wall and -Werror." sources = ["fig"] [[commands.subcommand.field]] id = "copy_bins" label = "Copy binaries" type = "boolean" option = ["--copy-bins"] description = "Copy executables to the local bin path." sources = ["fig"] [[commands.subcommand.field]] id = "resolver" label = "Resolver" type = "string" option = ["--resolver"] description = "Override the resolver in the project file." sources = ["fig"] [[commands.subcommand.field]] id = "ghc_options" label = "GHC options" type = "string" option = ["--ghc-options"] description = "Additional options passed to GHC for local targets." sources = ["fig"] [[commands.subcommand.task]] id = "build" label = "Build" fields = ["targets", "pedantic"] required = [] [[commands.subcommand.task]] id = "watch" label = "Build on change" set = { file_watch = [true] } fields = ["targets"] required = [] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["targets", "test", "haddock", "file_watch", "pedantic"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["resolver", "ghc_options", "copy_bins", "bench"]