]> git.wincent.com - docvim.git/commitdiff
Switch to Stack
authorGreg Hurrell <greg@hurrell.net>
Thu, 24 Mar 2016 14:54:04 +0000 (07:54 -0700)
committerGreg Hurrell <greg@hurrell.net>
Thu, 24 Mar 2016 14:54:04 +0000 (07:54 -0700)
.gitignore
README.md
stack.yaml [new file with mode: 0644]

index ba561ab2d0799485333f327a4272d964090258fd..0077f9c305314a4cab93dc8158537a5198d2e53b 100644 (file)
@@ -1,2 +1,3 @@
 /.cabal-sandbox
+/.stack-work
 /cabal.sandbox.config
index 5e24be348690504883757b012c884fbd3d2f0b3e..8d21f9b2950f0dd9c76b5fcbe6555f16e5077c76 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,7 +6,15 @@ docvim is a documentation generator for Vim plug-ins, written in Haskell.
 
 ### Set-up
 
-```
+You can set-up a development environment using [Stack] (recommended) or [Cabal]:
+
+```bash
+# Stack:
+brew install haskell-stack
+stack build
+
+# Cabal:
+brew install cabal-install
 cabal sandbox init
 cabal install --only-dependencies --enable-tests
 cabal build
@@ -14,38 +22,65 @@ cabal build
 
 ### Running
 
-Run using `cabal run` and passing in docvim-specific `OPTIONS`:
+Run using `stack exec` (or `cabal run`) and passing in docvim-specific `OPTIONS`:
 
-```
+```bash
+# Stack:
+stack exec docvim [OPTIONS]
+
+# Cabal:
 cabal run -- [OPTIONS]
 ```
 
-You can also run the modules from inside the Cabal REPL:
+You can also run the modules from inside the REPL:
 
-```
-cabal repl
+```bash
+# Stack:
+stack repl
+> pp "let l:test=1" -- pretty-prints AST
+
+# Cabal:
+cabal repl`
 > import Docvim.Parse
-> let sample = "let l:test=1"
-> pp sample -- pretty-prints AST
+> pp "let l:test=1" -- pretty-prints AST
 ```
 
 ### Building and viewing the code-level documentation
 
-```
+```bash
+# Stack:
+stack haddock
+open .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/doc/html/docvim/index.html
+
+# Cabal:
 cabal haddock --executables
 open dist/doc/html/docvim/docvim/index.html
 ```
 
 ### Testing
 
-```
+```bash
+# Stack:
+stack test
+
+# Cabal:
 cabal test
 ```
 
 ### Linting
 
+```bash
+# Stack:
+stack test              # Runs linter as part of overall suite.
+stack test docvim:hlint # Runs the linter alone.
+
+# Cabal:
+cabal install hlint     # (First-time only).
+cabal test              # Runs linter as part of overall suite.
+cabal test hlint        # Runs linter alone.
+
+hlint src               # If you have HLint installed under $PATH.
 ```
-cabal install hlint
-hlint src # or, alternatively...
-cabal test
-```
+
+[Cabal]: https://www.haskell.org/cabal/
+[Stack]: http://haskellstack.org/
diff --git a/stack.yaml b/stack.yaml
new file mode 100644 (file)
index 0000000..3fd55f3
--- /dev/null
@@ -0,0 +1,35 @@
+# This file was automatically generated by stack init
+# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/
+
+# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
+resolver: lts-5.9
+
+# Local packages, usually specified by relative directory name
+packages:
+- '.'
+# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
+extra-deps: []
+
+# Override default flag values for local packages and extra-deps
+flags: {}
+
+# Extra package databases containing global packages
+extra-package-dbs: []
+
+# Control whether we use the GHC we find on the path
+# system-ghc: true
+
+# Require a specific version of stack, using version ranges
+# require-stack-version: -any # Default
+# require-stack-version: >= 1.0.0
+
+# Override the architecture used by stack, especially useful on Windows
+# arch: i386
+# arch: x86_64
+
+# Extra directories used by stack for building
+# extra-include-dirs: [/path/to/dir]
+# extra-lib-dirs: [/path/to/dir]
+
+# Allow a newer minor version of GHC than the snapshot specifies
+# compiler-check: newer-minor