Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Fix build dependencies #48

Merged
merged 4 commits into from
Oct 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 37 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
language: haskell
ghc:
- 7.6
- 7.8
script:
- cabal install --dependencies-only && cabal build

env:
- GHCVER=7.6.3
- GHCVER=7.8.2
- GHCVER=7.8.3

before_install:
# If $GHCVER is the one travis has, don't bother reinstalling it.
# We can also have faster builds by installing some libraries with
# `apt`. If it isn't, install the GHC we want from hvr's PPA along
# with cabal-1.18.
- |
if [ $GHCVER = `ghc --numeric-version` ]; then
# Try installing some of the build-deps with apt-get for speed.
travis/cabal-apt-install --enable-tests $MODE
export CABAL=cabal
else
# Install the GHC we want from hvr's PPA
travis_retry sudo add-apt-repository -y ppa:hvr/ghc
travis_retry sudo apt-get update
travis_retry sudo apt-get install cabal-install-1.18 ghc-$GHCVER happy
export CABAL=cabal-1.18
export PATH=/opt/ghc/$GHCVER/bin:$PATH
fi
# Uncomment whenever hackage is down.
# - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && $CABAL update
- $CABAL update

# Update happy when building with GHC head
- |
if [ $GHCVER = "7.8.3" ] || [ $GHCVER = "7.8.2" ]; then
$CABAL install happy alex
export PATH=$HOME/.cabal/bin:$PATH
fi

install:
- $CABAL install --dependencies-only --enable-tests && $CABAL build
10 changes: 5 additions & 5 deletions haskell/LTHaskellClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import qualified Data.ByteString.Lazy.Char8 as BS

import GHC.Generics (Generic)
import Language.Haskell.GhcMod (check, defaultOptions, findCradle,
lintSyntax, withGHC)
lint, runGhcModT)

import Language.Haskell.Stylish

Expand Down Expand Up @@ -166,10 +166,10 @@ format x = do

getSyntaxIssues :: FilePath -> IO [String]
getSyntaxIssues filePath = do
cradle <- findCradle
withGHC filePath $ check defaultOptions cradle [filePath]
(Right result, _) <- runGhcModT defaultOptions $ check [filePath]
return $ either (:[]) lines result

getLintIssues :: FilePath -> IO [String]
getLintIssues file = do
syntaxIssues <- lintSyntax defaultOptions file
return $ lines syntaxIssues
(Right lintIssues, _) <- runGhcModT defaultOptions $ lint file
return $ lines lintIssues
8 changes: 4 additions & 4 deletions light-haskell.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ executable light-haskell

-- Other library packages from which modules are imported.
build-depends:
base ==4.6.*,
network ==2.4.*,
base (>=4.0 && <5),
network >=2.4,
directory ==1.2.*,
containers ==0.5.*,
text ==1.1.*,
bytestring ==0.10.*,
aeson ==0.7.*,
process ==1.1.*,
ghc-mod ==3.1.*,
process >=1.1,
ghc-mod >=5.1,
stylish-haskell ==0.5.*

-- Directories containing source files.
Expand Down