Skip to content

Commit 5dc3dd6

Browse files
committed
Support GHC-8.2
1 parent a3af57f commit 5dc3dd6

File tree

6 files changed

+60
-228
lines changed

6 files changed

+60
-228
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
.DS_Store
33
*.nix
44
dist/
5+
dist-newstyle/
6+
.ghc.environment.*
57
/foo.json
68
servant-client-0.4.4/
79
cabal-dev

.travis.yml

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# make_travis_yml_2.hs 'servant-swagger.cabal'
3+
# make_travis_yml_2.hs '--branch' 'master' 'servant-swagger.cabal'
44
#
55
# For more information, see https://github.com/hvr/multi-ghc-travis
66
#
@@ -10,6 +10,10 @@ sudo: false
1010
git:
1111
submodules: false # whether to recursively clone submodules
1212

13+
branches:
14+
only:
15+
- master
16+
1317
cache:
1418
directories:
1519
- $HOME/.cabal/packages
@@ -27,14 +31,17 @@ before_cache:
2731
matrix:
2832
include:
2933
- compiler: "ghc-7.8.4"
30-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
34+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
3135
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
3236
- compiler: "ghc-7.10.3"
33-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
37+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
3438
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
3539
- compiler: "ghc-8.0.2"
36-
# env: TEST=--disable-tests BENCH=--disable-benchmarks
40+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
3741
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
42+
- compiler: "ghc-8.2.1"
43+
# env: TEST=--disable-tests BENCH=--disable-benchmarks
44+
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
3845

3946
before_install:
4047
- HC=${CC}
@@ -49,23 +56,17 @@ install:
4956
- TEST=${TEST---enable-tests}
5057
- travis_retry cabal update -v
5158
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
52-
# Install hspec-discover manually, before hackage accepts build-tool-depends
53-
- mkdir -p $HOME/.local/bin
54-
- export PATH=$HOME/.local/bin/:$PATH
55-
- cabal get hspec-discover
56-
- "cd hspec-discover-*; cabal new-build hspec-discover:exe:hspec-discover; cp $(find dist-newstyle -type f -name hspec-discover) $HOME/.local/bin; cd .."
57-
5859
- rm -fv cabal.project.local
5960
- "echo 'packages: .' > cabal.project"
6061
- rm -f cabal.project.freeze
61-
- cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2
62-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2
62+
- cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
63+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
6364

6465
# Here starts the actual work to be performed for the package under test;
6566
# any command which exits with a non-zero exit code causes the build to fail.
6667
script:
6768
- if [ -f configure.ac ]; then autoreconf -i; fi
68-
- rm -rf dist/ .ghc.environment.*
69+
- rm -rf .ghc.environment.* dist/
6970
- cabal sdist # test that a source-distribution can be generated
7071
- cd dist/
7172
- SRCTAR=(${PKGNAME}-*.tar.gz)
@@ -77,27 +78,12 @@ script:
7778
- "echo 'packages: .' > cabal.project"
7879
# this builds all libraries and executables (without tests/benchmarks)
7980
- rm -f cabal.project.freeze
80-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks
81-
82-
# Build with various constraints
83-
- if [ $HC = "ghc-8.0.2" ]; then UNLESSGHC802=true; fi
84-
- $UNLESSGHC802 cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.5.*"
85-
- $UNLESSGHC802 cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.6.*"
86-
- $UNLESSGHC802 cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.7.*"
87-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.8.*"
88-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.9.*"
89-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks "--constraint=servant==0.10.*"
90-
81+
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
9182
# this builds all libraries and executables (including tests/benchmarks)
9283
# - rm -rf ./dist-newstyle
93-
- cabal new-build -w ${HC} ${TEST} ${BENCH}
9484

95-
# there's no 'cabal new-test' yet, so let's emulate for now
96-
- TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) )
97-
- if [ "$TEST" != "--enable-tests" ]; then TESTS=(); fi
98-
- shopt -s globstar;
99-
RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
100-
if dist-newstyle/build/**/$SRC_BASENAME/**/build/$T/$T; then echo "= $T OK =";
101-
else echo "= $T FAILED ="; RC=false; fi; done; $RC
85+
# build & run tests
86+
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
87+
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
10288

10389
# EOF

Setup.hs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{-# LANGUAGE CPP #-}
2+
{-# OPTIONS_GHC -Wall #-}
3+
module Main (main) where
4+
5+
#ifndef MIN_VERSION_cabal_doctest
6+
#define MIN_VERSION_cabal_doctest(x,y,z) 0
7+
#endif
8+
9+
#if MIN_VERSION_cabal_doctest(1,0,0)
10+
11+
import Distribution.Extra.Doctest ( defaultMainWithDoctests )
12+
main :: IO ()
13+
main = defaultMainWithDoctests "doctests"
14+
15+
#else
16+
17+
#ifdef MIN_VERSION_Cabal
18+
-- If the macro is defined, we have new cabal-install,
19+
-- but for some reason we don't have cabal-doctest in package-db
20+
--
21+
-- Probably we are running cabal sdist, when otherwise using new-build
22+
-- workflow
23+
#warning You are configuring this package without cabal-doctest installed. \
24+
The doctests test-suite will not work as a result. \
25+
To fix this, install cabal-doctest before configuring.
26+
#endif
27+
28+
import Distribution.Simple
29+
30+
main :: IO ()
31+
main = defaultMain
32+
33+
#endif

Setup.lhs

Lines changed: 0 additions & 178 deletions
This file was deleted.

servant-swagger.cabal

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: servant-swagger
22
version: 1.1.3
3+
x-revision: 1
34
synopsis: Generate Swagger specification for your servant API.
45
description: Please see README.md
56
homepage: https://github.com/haskell-servant/servant-swagger
@@ -15,7 +16,8 @@ cabal-version: >=1.10
1516
tested-with:
1617
GHC==7.8.4,
1718
GHC==7.10.3,
18-
GHC==8.0.2
19+
GHC==8.0.2,
20+
GHC==8.2.1
1921
extra-source-files:
2022
README.md
2123
, CHANGELOG.md
@@ -35,9 +37,9 @@ source-repository head
3537

3638
custom-setup
3739
setup-depends:
38-
base >=4.7 && <4.10,
39-
Cabal >= 1.18 && <2.0,
40-
cabal-doctest >=1 && <1.1
40+
base >=4.7 && <4.11,
41+
Cabal >= 1.18 && <2.1,
42+
cabal-doctest >=1.0.2 && <1.1
4143

4244
library
4345
ghc-options: -Wall
@@ -55,7 +57,7 @@ library
5557
Servant.Swagger.Internal.TypeLevel.TMap
5658
hs-source-dirs: src
5759
build-depends: aeson >=0.11.2.0 && <1.3
58-
, base >=4.7.0.0 && <4.10
60+
, base >=4.7.0.0 && <4.11
5961
, bytestring >=0.10.4.0 && <0.11
6062
, http-media >=0.6.3 && <0.8
6163
, insert-ordered-containers >=0.1.0.0 && <0.3

test/doctests.hs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
-----------------------------------------------------------------------------
2-
-- |
3-
-- Module : Main (doctests)
4-
-- Copyright : (C) 2012-14 Edward Kmett
5-
-- License : BSD-style (see the file LICENSE)
6-
-- Maintainer : Edward Kmett <[email protected]>
7-
-- Stability : provisional
8-
-- Portability : portable
9-
--
10-
-- This module provides doctests for a project based on the actual versions
11-
-- of the packages it was built with. It requires a corresponding Setup.lhs
12-
-- to be added to the project
13-
-----------------------------------------------------------------------------
141
module Main where
152

163
import Build_doctests (flags, pkgs, module_sources)

0 commit comments

Comments
 (0)