This document has some notes, instructions, and recommendations for making a contribution to the project.
This project supports 3 build tools:
- Cabal
- Stack
- Nix (package manager) (also Cabal and Stack are available in the nix-shell configuration)
cabal build
stack build
nix-build
See for result*
files.
nix-shell
You can also use direnv. See .envrc example file.
Cabal is turned on by default. You can change what tools are available by
providing buildTools
argument:
nix-shell --arg buildTools '[ "cabal" "stack" ]'
HLS is turned on by
default (see withHLS
argument).
If you are using (Neo)Vim you can use vim-lsp plugin. Here is a configuration example:
if executable('haskell-language-server-wrapper')
aug HaskellLsp
au! User lsp_setup cal lsp#register_server({
\ 'name': 'hls',
\ 'cmd': {server_info->['haskell-language-server-wrapper', '--lsp']},
\ 'allowlist': ['haskell'],
\ })
aug END
en
See nixpkgs.haskell.packages.*
for available GHC versions.
Example (HLS was failing to build with GHC 9.2.3 at the moment, turned it off):
nix-shell --argstr ghcVersion ghc923 --arg withHLS false
See https://hackage.haskell.org/upload page for details.
We are going to use Cabal for this. If you are using Nix you can just enter
nix-shell
being in the directory of this repository, Cabal will be available.
I recommend to use at least Cabal v3 for this.
-
Check the CI first that everything is green.
https://github.com/unclechu/haskell-qm-interpolated-string/actions
-
Cleanup the artifacts of previous builds:
cabal clean
-
Check that everything is okay with *.cabal file:
cabal check
-
Build the library:
cabal build
-
Run tests:
cabal test
-
Build documentation using Haddock:
cabal v2-haddock --builddir=dist-docs --haddock-for-hackage --enable-documentation
-
Create a source distribution:
cabal sdist
-
Test the distribution as a candidate:
-
Upload produced tarball:
cabal upload dist-newstyle/sdist/qm-interpolated-string-0.3.1.0.tar.gz
where
0.3.1.0
is a version you're going to release. -
Upload previously generated docs for the candidate:
cabal upload -d dist-docs/qm-interpolated-string-0.3.1.0-docs.tar.gz
where
0.3.1.0
is a version you're going to release. -
Look for the given link in the logs to the candidate page, open it, and inspect carefully that everything seems correct, including documentation.
-
-
If you sure it's ready to be released (this cannot be undone!) then do it:
cabal upload --publish dist-newstyle/sdist/qm-interpolated-string-0.3.1.0.tar.gz
where
0.3.1.0
is a version you're going to release. -
Publish previously generated docs:
cabal upload --publish -d dist-docs/qm-interpolated-string-0.3.1.0-docs.tar.gz
where
0.3.1.0
is a version you're going to release. -
Do not forget to create and push a Git tag for the new version!
https://github.com/unclechu/haskell-qm-interpolated-string/tags