Skip to content

Commit

Permalink
support ghc 7.4 and 7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ssadler committed Jan 20, 2017
1 parent 9532ada commit bc6a54a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ before_cache:

matrix:
include:
- env: CABALVER=1.18 GHCVER=7.8.4
- env: CABALVER=1.16 GHCVER=7.4.2
compiler: ": #GHC 7.4.2"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
- env: CABALVER=1.16 GHCVER=7.6.3
compiler: ": #GHC 7.6.3"
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
- env: CABALVER=1.18 GHCVER=7.8.4 ENABLE_BENCHMARKS=--enable-benchmarks
compiler: ": #GHC 7.8.4"
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
- env: CABALVER=1.22 GHCVER=7.10.2
- env: CABALVER=1.22 GHCVER=7.10.2 ENABLE_BENCHMARKS=--enable-benchmarks
compiler: ": #GHC 7.10.2"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=8.0.1
- env: CABALVER=1.24 GHCVER=8.0.1 ENABLE_BENCHMARKS=--enable-benchmarks
compiler: ": #GHC 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}

Expand All @@ -37,7 +43,7 @@ install:
fi
- travis_retry cabal update -v
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
- cabal install --only-dependencies --enable-tests $ENABLE_BENCHMARKS --dry -v > installplan.txt
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt

# check whether current requested install-plan matches cached package-db snapshot
Expand All @@ -51,7 +57,7 @@ install:
echo "cabal build-cache MISS";
rm -rf $HOME/.cabsnap;
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
cabal install --only-dependencies --enable-tests --enable-benchmarks;
cabal install --only-dependencies --enable-tests $ENABLE_BENCHMARKS;
fi

# snapshot package-db on cache miss
Expand All @@ -67,7 +73,7 @@ install:
# any command which exits with a non-zero exit code causes the build to fail.
script:
- if [ -f configure.ac ]; then autoreconf -i; fi
- cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
- cabal configure --enable-tests $ENABLE_BENCHMARKS -v2 # -v2 provides useful information for debugging
- cabal build # this builds all libraries and executables (including tests/benchmarks)
- cabal test
- cabal check
Expand Down
7 changes: 5 additions & 2 deletions aeson-quick.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: aeson-quick
Version: 0.1.1.1
Build-Type: Simple
Cabal-Version: >= 1.10
Cabal-Version: >= 1.16
License: BSD3
License-File: LICENSE
Author: Scott Sadler
Expand All @@ -12,7 +12,7 @@ Synopsis: Quick JSON extractions with Aeson
Description: DSL on top of Aeson. This library is /experimental/.
Copyright: (c) 2014-2017 Scott Sadler
Stability: Experimental
Tested-With: GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1
Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1


Library
Expand All @@ -25,6 +25,8 @@ Library
, text >= 1.2 && < 1.3
, unordered-containers >= 0.2.5 && < 0.3
, vector >= 0.10 && < 0.12
if impl(ghc < 7.5)
Build-Depends: ghc-prim >= 0.2
default-language: Haskell2010

test-suite aeson-quick-test
Expand Down Expand Up @@ -55,6 +57,7 @@ benchmark benchmark
, text >= 1.2 && < 1.3
default-language: Haskell2010


source-repository head
type: git
location: https://github.com/libscott/aeson-quick
5 changes: 4 additions & 1 deletion test/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Control.Applicative

import Data.Aeson.Quick
import Data.ByteString.Lazy (ByteString)
import Data.Either

import Lens.Micro

Expand Down Expand Up @@ -160,3 +159,7 @@ d s = case decode s of
Just v -> v
Nothing -> error $ "Coult not decode JSON: " ++ show s


isLeft :: Either a b -> Bool
isLeft e = case e of Left _ -> True
_ -> False

0 comments on commit bc6a54a

Please sign in to comment.