Skip to content

Commit 7985cc0

Browse files
authored
Merge pull request #92 from haskell-servant/ghc-8.6
Support GHC-8.6
2 parents 4273f9c + 890f4da commit 7985cc0

File tree

6 files changed

+58
-22
lines changed

6 files changed

+58
-22
lines changed

.travis.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# runghc make_travis_yml_2.hs '--branch' 'master' '--output' '.travis.yml' 'servant-swagger.cabal'
44
#
5-
# For more information, see https://github.com/hvr/multi-ghc-travis
5+
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
77
language: c
88
sudo: false
@@ -32,21 +32,24 @@ before_cache:
3232

3333
matrix:
3434
include:
35-
- compiler: "ghc-8.4.3"
35+
- compiler: "ghc-8.6.1"
3636
# env: TEST=--disable-tests BENCH=--disable-benchmarks
37-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}}
37+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}}
38+
- compiler: "ghc-8.4.4"
39+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
40+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
3841
- compiler: "ghc-8.2.2"
3942
# env: TEST=--disable-tests BENCH=--disable-benchmarks
40-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2], sources: [hvr-ghc]}}
43+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
4144
- compiler: "ghc-8.0.2"
4245
# env: TEST=--disable-tests BENCH=--disable-benchmarks
43-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2], sources: [hvr-ghc]}}
46+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
4447
- compiler: "ghc-7.10.3"
4548
# env: TEST=--disable-tests BENCH=--disable-benchmarks
46-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3], sources: [hvr-ghc]}}
49+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
4750
- compiler: "ghc-7.8.4"
4851
# env: TEST=--disable-tests BENCH=--disable-benchmarks
49-
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.4], sources: [hvr-ghc]}}
52+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}}
5053

5154
before_install:
5255
- HC=${CC}
@@ -89,8 +92,8 @@ install:
8992
# any command which exits with a non-zero exit code causes the build to fail.
9093
script:
9194
# test that source-distributions can be generated
92-
- (cd "." && cabal sdist)
93-
- mv "."/dist/servant-swagger-*.tar.gz ${DISTDIR}/
95+
- cabal new-sdist all
96+
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
9497
- cd ${DISTDIR} || false
9598
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
9699
- "printf 'packages: servant-swagger-*/*.cabal\\n' > cabal.project"
@@ -109,7 +112,6 @@ script:
109112
- (cd servant-swagger-* && cabal check)
110113

111114
# haddock
112-
- rm -rf ./dist-newstyle
113115
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
114116

115117
# Build without installed constraints for packages in global-db

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ next
44
* Fixes:
55
* `validateEveryToJSON` now prints validation errors
66

7+
* Notes:
8+
* GHC-8.6 compatible release
9+
710
1.1.5
811
-----
912

servant-swagger.cabal

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: servant-swagger
2-
version: 1.1.5
3-
x-revision: 5
2+
version: 1.1.6
43
synopsis: Generate Swagger specification for your servant API.
54
description:
65
Swagger is a project used to describe and document RESTful APIs.
@@ -28,11 +27,12 @@ category: Web, Servant, Swagger
2827
build-type: Custom
2928
cabal-version: 1.18
3029
tested-with:
31-
GHC==7.8.4,
32-
GHC==7.10.3,
33-
GHC==8.0.2,
34-
GHC==8.2.2,
35-
GHC==8.4.3
30+
GHC ==7.8.4
31+
|| ==7.10.3
32+
|| ==8.0.2
33+
|| ==8.2.2
34+
|| ==8.4.4
35+
|| ==8.6.1
3636

3737
extra-source-files:
3838
README.md
@@ -53,8 +53,8 @@ source-repository head
5353

5454
custom-setup
5555
setup-depends:
56-
base >=4.7 && <4.12,
57-
Cabal >= 1.18 && <2.3,
56+
base >=4.7 && <4.13,
57+
Cabal >= 1.18 && <2.5,
5858
cabal-doctest >=1.0.2 && <1.1
5959

6060
library
@@ -74,7 +74,7 @@ library
7474
hs-source-dirs: src
7575
build-depends: aeson >=0.11.2.0 && <1.5
7676
, aeson-pretty >=0.4 && <0.9
77-
, base >=4.7.0.0 && <4.12
77+
, base >=4.7.0.0 && <4.13
7878
, bytestring >=0.10.4.0 && <0.11
7979
, http-media >=0.6.3 && <0.8
8080
, insert-ordered-containers >=0.1.0.0 && <0.3
@@ -110,16 +110,19 @@ test-suite spec
110110
main-is: Spec.hs
111111
build-tool-depends: hspec-discover:hspec-discover
112112
build-depends: base
113+
, base-compat >= 0.10.4 && <0.11
113114
, aeson
114-
, aeson-qq >=0.8.1
115115
, hspec
116116
, QuickCheck
117117
, lens
118118
, servant
119119
, servant-swagger
120120
, swagger2
121121
, text
122+
, template-haskell
123+
, utf8-string >=1.0.1.1 && <1.1
122124
, time
123125
other-modules:
124126
Servant.SwaggerSpec
127+
Data.Aeson.QQ.Simple
125128
default-language: Haskell2010

src/Servant/Swagger/Internal.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
{-# LANGUAGE OverlappingInstances #-}
1515
#define OVERLAPPABLE_
1616
#endif
17+
#if __GLASGOW_HASKELL__ >= 806
18+
{-# LANGUAGE UndecidableInstances #-}
19+
#endif
1720
module Servant.Swagger.Internal where
1821

1922
import Control.Lens

test/Data/Aeson/QQ/Simple.hs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-- | Like "Data.Aeson.QQ" but without interpolation.
2+
module Data.Aeson.QQ.Simple (aesonQQ) where
3+
4+
import Data.Aeson (eitherDecode, Value)
5+
import Data.ByteString.Lazy.UTF8 as UTF8
6+
import qualified Data.Text as T
7+
import Language.Haskell.TH
8+
import Language.Haskell.TH.Quote
9+
import Language.Haskell.TH.Syntax (Lift (..))
10+
import Prelude ()
11+
import Prelude.Compat
12+
13+
aesonQQ :: QuasiQuoter
14+
aesonQQ = QuasiQuoter
15+
{ quoteExp = aesonExp
16+
, quotePat = const $ error "No quotePat defined for jsonQQ"
17+
, quoteType = const $ error "No quoteType defined for jsonQQ"
18+
, quoteDec = const $ error "No quoteDec defined for jsonQQ"
19+
}
20+
21+
aesonExp :: String -> ExpQ
22+
aesonExp txt =
23+
case eitherDecode $ UTF8.fromString txt of
24+
Left err -> error $ "Error in aesonExp: " ++ show err
25+
Right val -> lift (val :: Value)

test/Servant/SwaggerSpec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Servant.SwaggerSpec where
1212

1313
import Control.Lens
1414
import Data.Aeson (ToJSON(toJSON), Value, genericToJSON)
15-
import Data.Aeson.QQ
15+
import Data.Aeson.QQ.Simple
1616
import qualified Data.Aeson.Types as JSON
1717
import Data.Char (toLower)
1818
import Data.Int (Int64)

0 commit comments

Comments
 (0)