Compare commits

...

9 Commits

Author SHA1 Message Date
Oleg Grenrus 8973cf56f1 Merge pull request #840 from haskell-servant/release-0.11-travis-new-build
Release 0.11 travis new build
2017-10-23 08:51:14 +03:00
Oleg Grenrus 6ff70e2cdf Adopt http-types-0.10 2017-10-23 08:04:28 +03:00
Oleg Grenrus 85929abcc8 Improve .cabal files
- Add build-tool-depends, so new-build can use hspec-discover
- Add mtl bounds in tutorial (and dependency on mtl-compact)
- Add extra-source-files to tutorial, so it's buildable from sdist
2017-10-22 21:31:25 +03:00
Oleg Grenrus c3e4abd892 Don't build --dep for all
As tutorial depends on servant-js, which isn't in this repository
cabal fails fatally to `new-build --dep all`.

Instead we are building deps for servant-server and servant-client only,
which already includes e.g. http-client and warp, i.e. pretty much
everything we need. It's not bad that some dependencies might be build
during `script` phase
2017-10-22 21:31:25 +03:00
Oleg Grenrus b120c17137 cabal new-build based .travis.yml 2017-10-22 21:17:04 +03:00
Oleg Grenrus 03122c51a9 Update stack-ghc-8.2.1.yaml 2017-10-22 13:02:43 +03:00
Oleg Grenrus 26ffbd0033 Allow http-types-0.10 2017-10-22 12:29:55 +03:00
Oleg Grenrus 87800cd844 Bump servant-docs version to 0.11 2017-07-24 09:32:30 +03:00
Oleg Grenrus f18a848d4d Relax bounds 2017-06-28 12:07:39 +03:00
13 changed files with 195 additions and 45 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
**/*/dist
.ghc.environment.*
dist-newstyle
/bin
/lib

View File

@ -1,29 +1,113 @@
# This Travis job script has been generated by a script via
#
# make_travis_yml_2.hs '-o' '.travis.yml' 'cabal.project'
#
# For more information, see https://github.com/hvr/multi-ghc-travis
#
language: c
sudo: false
language: c
env:
- STACK_YAML=stack-ghc-7.8.4.yaml
- STACK_YAML=stack-ghc-7.10.3.yaml
- STACK_YAML=stack.yaml
addons:
apt:
packages:
- libgmp-dev
install:
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
- stack --version
- stack setup --no-terminal
- (cd $HOME/.local/bin && wget https://zalora-public.s3.amazonaws.com/tinc && chmod +x tinc)
script:
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ] ; then ./scripts/ci-cron.sh ; else stack test --ghc-options=-Werror --no-terminal ; fi
git:
submodules: false # whether to recursively clone submodules
cache:
directories:
- $HOME/.tinc/cache
- $HOME/.stack
- $HOME/.cabal/packages
- $HOME/.cabal/store
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
matrix:
include:
- compiler: "ghc-7.8.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
- compiler: "ghc-7.10.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
- compiler: "ghc-8.0.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
- compiler: "ghc-8.2.1"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
before_install:
- HC=${CC}
- HCPKG=${HC/ghc/ghc-pkg}
- unset CC
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
install:
- cabal --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- BENCH=${BENCH---enable-benchmarks}
- TEST=${TEST---enable-tests}
- HADDOCK=${HADDOCK-true}
- INSTALLED=${INSTALLED-true}
- travis_retry cabal update -v
- sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- rm -fv cabal.project.local
- if [ -f "servant/configure.ac" ]; then
(cd "servant"; autoreconf -i);
fi
- if [ -f "servant-client/configure.ac" ]; then
(cd "servant-client"; autoreconf -i);
fi
- if [ -f "servant-docs/configure.ac" ]; then
(cd "servant-docs"; autoreconf -i);
fi
- if [ -f "servant-foreign/configure.ac" ]; then
(cd "servant-foreign"; autoreconf -i);
fi
- if [ -f "servant-server/configure.ac" ]; then
(cd "servant-server"; autoreconf -i);
fi
- if [ -f "doc/tutorial/configure.ac" ]; then
(cd "doc/tutorial"; autoreconf -i);
fi
- rm -f cabal.project.freeze
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 servant-server servant-client
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 servant-server servant-client
- rm -rf "servant"/.ghc.environment.* "servant-client"/.ghc.environment.* "servant-docs"/.ghc.environment.* "servant-foreign"/.ghc.environment.* "servant-server"/.ghc.environment.* "doc/tutorial"/.ghc.environment.* "servant"/dist "servant-client"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
script:
# test that source-distributions can be generated
- (cd "servant"; cabal sdist)
- (cd "servant-client"; cabal sdist)
- (cd "servant-docs"; cabal sdist)
- (cd "servant-foreign"; cabal sdist)
- (cd "servant-server"; cabal sdist)
- (cd "doc/tutorial"; cabal sdist)
- mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz ${DISTDIR}/
- cd ${DISTDIR}
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
- "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal\n' > cabal.project"
# this builds all libraries and executables (without tests/benchmarks)
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
# Build with installed constraints for packages in global-db
- if $INSTALLED; then
echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh;
else echo "Not building with installed constraints"; fi
# build & run tests, build benchmarks
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
# haddock
- rm -rf ./dist-newstyle
- if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
# REGENDATA ["-o",".travis.yml","cabal.project"]
# EOF

View File

@ -27,7 +27,7 @@ release of `servant` package.
| servant-blaze | 0.7.1 | ? |
| servant-cassava | 0.7 | ? |
| servant-client | 0.10 | 0.11 |
| servant-docs | 0.10 | 0.10.1 |
| servant-docs | 0.10 | 0.11 |
| servant-foreign | 0.10 | 0.10.0.1 |
| servant-js | 0.9.1 | ? |
| servant-lucid | 0.7.1 | ? |

View File

@ -1,5 +1,4 @@
packages:
servant/
packages: servant/
servant-client/
servant-docs/
servant-foreign/

View File

@ -8,6 +8,14 @@ author: Servant Contributors
maintainer: haskell-servant-maintainers@googlegroups.com
build-type: Simple
cabal-version: >=1.10
tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.0.2
GHC==8.2.1
extra-source-files:
static/index.html
static/ui.js
library
exposed-modules: ApiType
@ -28,7 +36,7 @@ library
, servant == 0.11.*
, servant-server == 0.11.*
, servant-client == 0.11.*
, servant-docs == 0.10.*
, servant-docs == 0.11.*
, servant-js >= 0.9 && <0.10
, warp
, http-media
@ -37,7 +45,8 @@ library
, string-conversions
, bytestring
, attoparsec
, mtl
, mtl >=2.1 && <2.3
, mtl-compat
, random
, js-jquery
, wai
@ -56,6 +65,8 @@ test-suite spec
hs-source-dirs: test
main-is: Spec.hs
other-modules: JavascriptSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends: base == 4.*
, tutorial
, hspec

View File

@ -1,5 +1,6 @@
name: servant-client
version: 0.11
x-revision: 2
synopsis: automatical derivation of querying functions for servant webservices
description:
This library lets you derive automatically Haskell functions that
@ -16,7 +17,11 @@ copyright: 2014-2016 Zalora South East Asia Pte Ltd, Servant Contribut
category: Servant Web
build-type: Simple
cabal-version: >=1.10
tested-with: GHC >= 7.8
tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.0.2
GHC==8.2.1
homepage: http://haskell-servant.readthedocs.org/
Bug-reports: http://github.com/haskell-servant/servant/issues
extra-source-files:
@ -36,7 +41,7 @@ library
Servant.Common.BasicAuth
Servant.Common.Req
build-depends:
base >= 4.7 && < 4.10
base >= 4.7 && < 4.11
, base-compat >= 0.9.1 && < 0.10
, aeson >= 0.7 && < 1.3
, attoparsec >= 0.12 && < 0.14
@ -47,8 +52,8 @@ library
, http-api-data >= 0.3.6 && < 0.4
, http-client >= 0.4.18.1 && < 0.6
, http-client-tls >= 0.2.2 && < 0.4
, http-media >= 0.6.2 && < 0.7
, http-types >= 0.8.6 && < 0.10
, http-media >= 0.6.2 && < 0.8
, http-types >= 0.8.6 && < 0.11
, monad-control >= 1.0.0.4 && < 1.1
, network-uri >= 2.6 && < 2.7
, safe >= 0.3.9 && < 0.4
@ -76,6 +81,8 @@ test-suite spec
default-language: Haskell2010
hs-source-dirs: test
main-is: Spec.hs
build-tool-depends:
hspec-discover:hspec-discover
other-modules:
Servant.ClientSpec
, Servant.Common.BaseUrlSpec

View File

@ -1,3 +1,8 @@
0.11
----
* changed the type of `rqbody`.
0.10
----

View File

@ -1,5 +1,5 @@
name: servant-docs
version: 0.10.0.1
version: 0.11
synopsis: generate API docs for your servant webservice
description:
Library for generating API docs from a servant API definition.
@ -15,7 +15,11 @@ copyright: 2014-2016 Zalora South East Asia Pte Ltd, Servant Contribut
category: Servant Web
build-type: Simple
cabal-version: >=1.10
tested-with: GHC >= 7.8
tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.0.2
GHC==8.2.1
homepage: http://haskell-servant.readthedocs.org/
Bug-reports: http://github.com/haskell-servant/servant/issues
extra-source-files:
@ -75,6 +79,8 @@ test-suite spec
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules: Servant.DocsSpec
build-tool-depends:
hspec-discover:hspec-discover
hs-source-dirs: test
ghc-options: -Wall
build-depends:

View File

@ -22,6 +22,12 @@ extra-source-files:
CHANGELOG.md
README.md
bug-reports: http://github.com/haskell-servant/servant/issues
tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.0.2
GHC==8.2.1
source-repository head
type: git
location: http://github.com/haskell-servant/servant.git
@ -65,6 +71,8 @@ test-suite spec
include-dirs: include
main-is: Spec.hs
other-modules: Servant.ForeignSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends: base
, hspec >= 2.1.8
, servant

View File

@ -1,5 +1,5 @@
name: servant-server
version: 0.11
version: 0.11.0.1
synopsis: A family of combinators for defining webservices APIs and serving them
description:
A family of combinators for defining webservices APIs and serving them
@ -21,7 +21,11 @@ copyright: 2014-2016 Zalora South East Asia Pte Ltd, Servant Contribut
category: Servant Web
build-type: Custom
cabal-version: >=1.10
tested-with: GHC >= 7.8
tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.0.2
GHC==8.2.1
extra-source-files:
include/*.h
CHANGELOG.md
@ -51,7 +55,7 @@ library
Servant.Server.Internal.ServantErr
Servant.Utils.StaticFiles
build-depends:
base >= 4.7 && < 4.10
base >= 4.7 && < 4.11
, base-compat >= 0.9 && < 0.10
, aeson >= 0.7 && < 1.3
, attoparsec >= 0.12 && < 0.14
@ -60,7 +64,7 @@ library
, containers >= 0.5 && < 0.6
, exceptions >= 0.8 && < 0.9
, http-api-data >= 0.3 && < 0.4
, http-types >= 0.8 && < 0.10
, http-types >= 0.8 && < 0.11
, network-uri >= 2.6 && < 2.7
, monad-control >= 1.0.0.4 && < 1.1
, mtl >= 2 && < 2.3
@ -120,6 +124,8 @@ test-suite spec
Servant.Server.UsingContextSpec.TestCombinators
Servant.ServerSpec
Servant.Utils.StaticFilesSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends:
base == 4.*
, base-compat

View File

@ -28,7 +28,11 @@ import Network.HTTP.Types (Status (..), hAccept, hContentType,
methodDelete, methodGet,
methodHead, methodPatch,
methodPost, methodPut, ok200,
#if MIN_VERSION_http_types(0,10,0)
imATeapot418,
#else
imATeaPot418,
#endif
parseQuery)
import Network.Wai (Application, Request, requestHeaders, pathInfo,
queryString, rawQueryString,
@ -65,6 +69,11 @@ import Servant.Server.Experimental.Auth
import Servant.Server.Internal.Context
(NamedContext(..))
#if !MIN_VERSION_http_types(0,10,0)
imATeapot418 :: Status
imATeapot418 = imATeaPot418
#endif
-- * comprehensive api test
-- This declaration simply checks that all instances are in place.
@ -657,7 +666,7 @@ basicAuthApi = Proxy
basicAuthServer :: Server BasicAuthAPI
basicAuthServer =
const (return jerry) :<|>
(Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "")
(Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
basicAuthContext :: Context '[ BasicAuthCheck () ]
basicAuthContext =
@ -702,7 +711,7 @@ genAuthApi = Proxy
genAuthServer :: Server GenAuthAPI
genAuthServer = const (return tweety)
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "")
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
type instance AuthServerData (AuthProtect "auth") = ()

View File

@ -1,5 +1,6 @@
name: servant
version: 0.11
x-revision: 2
synopsis: A family of combinators for defining webservices APIs
description:
A family of combinators for defining webservices APIs and serving them
@ -17,7 +18,11 @@ copyright: 2014-2016 Zalora South East Asia Pte Ltd, Servant Contribut
category: Servant Web
build-type: Custom
cabal-version: >=1.10
tested-with: GHC >= 7.8
tested-with:
GHC==7.8.4
GHC==7.10.3
GHC==8.0.2
GHC==8.2.1
extra-source-files:
include/*.h
CHANGELOG.md
@ -57,15 +62,15 @@ library
Servant.Utils.Links
Servant.Utils.Enter
build-depends:
base >= 4.7 && < 4.10
base >= 4.7 && < 4.11
, base-compat >= 0.9 && < 0.10
, aeson >= 0.7 && < 1.3
, attoparsec >= 0.12 && < 0.14
, bytestring >= 0.10 && < 0.11
, case-insensitive >= 1.2 && < 1.3
, http-api-data >= 0.3 && < 0.4
, http-media >= 0.4 && < 0.7
, http-types >= 0.8 && < 0.10
, http-media >= 0.4 && < 0.8
, http-types >= 0.8 && < 0.11
, natural-transformation >= 0.4 && < 0.5
, mtl >= 2.0 && < 2.3
, mmorph >= 1 && < 1.2
@ -117,6 +122,8 @@ test-suite spec
Servant.API.ResponseHeadersSpec
Servant.Utils.LinksSpec
Servant.Utils.EnterSpec
build-tool-depends:
hspec-discover:hspec-discover
build-depends:
base == 4.*
, base-compat

7
stack-ghc-8.2.1.yaml Normal file
View File

@ -0,0 +1,7 @@
resolver: nightly-2017-09-01
packages:
- servant-client/
- servant-docs/
- servant-foreign/
- servant-server/
- servant/