Skip to content

Commit d206d75

Browse files
authored
Merge pull request #50 from haskell-servant/servant-0.14
Support servant-0.14
2 parents 4071f86 + 71ee4b6 commit d206d75

File tree

9 files changed

+68
-40
lines changed

9 files changed

+68
-40
lines changed

.travis.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,18 @@ install:
6464
- BENCH=${BENCH---enable-benchmarks}
6565
- TEST=${TEST---enable-tests}
6666
- HADDOCK=${HADDOCK-true}
67-
- INSTALLED=${INSTALLED-true}
67+
- UNCONSTRAINED=${UNCONSTRAINED-true}
68+
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
6869
- GHCHEAD=${GHCHEAD-false}
6970
- travis_retry cabal update -v
7071
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
7172
- rm -fv cabal.project cabal.project.local
7273
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
7374
- "printf 'packages: \"servant-swagger-ui\" \"servant-swagger-ui-core\" \"servant-swagger-ui-example\" \"servant-swagger-ui-jensoleg\" \"servant-swagger-ui-redoc\"\\n' > cabal.project"
74-
- cat cabal.project
75+
- touch cabal.project.local
76+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
77+
- cat cabal.project || true
78+
- cat cabal.project.local || true
7579
- if [ -f "servant-swagger-ui/configure.ac" ]; then
7680
(cd "servant-swagger-ui" && autoreconf -i);
7781
fi
@@ -106,13 +110,13 @@ script:
106110
- cd ${DISTDIR} || false
107111
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
108112
- "printf 'packages: servant-swagger-ui-*/*.cabal servant-swagger-ui-core-*/*.cabal servant-swagger-ui-example-*/*.cabal servant-swagger-ui-jensoleg-*/*.cabal servant-swagger-ui-redoc-*/*.cabal\\n' > cabal.project"
109-
- cat cabal.project
113+
- touch cabal.project.local
114+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
115+
- cat cabal.project || true
116+
- cat cabal.project.local || true
110117
# this builds all libraries and executables (without tests/benchmarks)
111118
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
112119

113-
# Build with installed constraints for packages in global-db
114-
- 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
115-
116120
# build & run tests, build benchmarks
117121
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
118122

@@ -127,6 +131,12 @@ script:
127131
- rm -rf ./dist-newstyle
128132
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
129133

134+
# Build without installed constraints for packages in global-db
135+
- if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
136+
137+
# Constraint sets
138+
- rm -rf cabal.project.local
139+
130140
# Constraint set servant-0.7
131141
- if [ $HCNUMVER -ge 70800 ] && [ $HCNUMVER -lt 80000 ]; then cabal new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='servant ==0.7.*' all; else echo skipping...; fi
132142

@@ -148,5 +158,9 @@ script:
148158
# Constraint set servant-0.13
149159
- if [ $HCNUMVER -ge 70800 ] && [ $HCNUMVER -lt 80600 ]; then cabal new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='servant ==0.13.*' all; else echo skipping...; fi
150160

161+
# Constraint set servant-0.14
162+
- if [ $HCNUMVER -ge 70800 ] && [ $HCNUMVER -lt 80600 ]; then cabal new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='servant ==0.14.*' all; else echo skipping...; fi
163+
164+
151165
# REGENDATA ["--branch","master","--output",".travis.yml","--config","cabal.project"]
152166
# EOF

cabal.make-travis-yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ constraint-set servant-0.12
2525
constraint-set servant-0.13
2626
ghc: >= 7.8 && <8.6
2727
constraints: servant ==0.13.*
28+
29+
constraint-set servant-0.14
30+
ghc: >= 7.8 && <8.6
31+
constraints: servant ==0.14.*

servant-swagger-ui-core/Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.3.1
2+
3+
- Support `servant-0.14`

servant-swagger-ui-core/servant-swagger-ui-core.cabal

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cabal-version: 1.12
22
name: servant-swagger-ui-core
3-
version: 0.3
4-
x-revision: 1
3+
version: 0.3.1
54

65
synopsis: Servant swagger ui core components
76
category: Web, Servant, Swagger
@@ -11,18 +10,20 @@ description:
1110
See servant-swagger-ui, servant-swagger-ui-jensoleg or
1211
servant-swagger-ui-redoc for "concrete" implementations.
1312

14-
homepage: https://github.com/phadej/servant-swagger-ui
15-
bug-reports: https://github.com/phadej/servant-swagger-ui/issues
13+
homepage: https://github.com/haskell-servant/servant-swagger-ui
14+
bug-reports: https://github.com/haskell-servant/servant-swagger-ui/issues
1615
author: Oleg Grenrus <[email protected]>
17-
maintainer: Oleg Grenrus <[email protected]>
16+
maintainer: [email protected]
1817
license: BSD3
1918
license-file: LICENSE
2019
build-type: Simple
2120
tested-with: GHC ==7.8.4 || ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.3
21+
extra-source-files:
22+
Changelog.md
2223

2324
source-repository head
2425
type: git
25-
location: https://github.com/phadej/servant-swagger-ui
26+
location: https://github.com/haskell-servant/servant-swagger-ui
2627

2728
flag servant-0-5
2829
description: Whether use servant >= 0.5
@@ -39,9 +40,9 @@ library
3940
, blaze-markup >=0.7.0.2 && <0.9
4041
, bytestring >=0.10.4.0 && <0.11
4142
, http-media >=0.6.2 && <0.8
42-
, servant >=0.4.4.5 && <0.14
43+
, servant >=0.4.4.5 && <0.15
4344
, servant-blaze >=0.4.4.5 && <0.9
44-
, servant-server >=0.4.4.5 && <0.14
45+
, servant-server >=0.4.4.5 && <0.15
4546
, swagger2 >=2.0.1 && <2.3
4647
, text >=1.2.0.6 && <1.3
4748
, wai-app-static >=3.0.1.1 && <3.2

servant-swagger-ui-core/src/Servant/Swagger/UI/Core.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,18 @@ type SwaggerSchemaUI' (dir :: Symbol) (api :: *) =
100100
-- to find schema file automatically.
101101
data SwaggerUiHtml (dir :: Symbol) (api :: *) = SwaggerUiHtml T.Text
102102

103-
#if MIN_VERSION_servant(0,10,0)
104-
#define LINK Link
103+
#if MIN_VERSION_servant(0,14,0)
104+
#define LINK Link ~ MkLink api Link
105+
#define LINKPATH uriPath . linkURI
106+
#elif MIN_VERSION_servant(0,10,0)
107+
#define LINK Link ~ MkLink api
105108
#define LINKPATH uriPath . linkURI
106109
#else
107-
#define LINK URI
110+
#define LINK URI ~ MkLink api
108111
#define LINKPATH uriPath
109112
#endif
110113

111-
instance (KnownSymbol dir, HasLink api, LINK ~ MkLink api, IsElem api api)
114+
instance (KnownSymbol dir, HasLink api, LINK, IsElem api api)
112115
=> ToMarkup (SwaggerUiHtml dir api)
113116
where
114117
toMarkup (SwaggerUiHtml template) = preEscapedToMarkup

servant-swagger-ui-example/servant-swagger-ui-example.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ category: Web, Servant, Swagger
77
description:
88
A kind of test-suite of servant-swagger-ui
99

10-
homepage: https://github.com/phadej/servant-swagger-ui
11-
bug-reports: https://github.com/phadej/servant-swagger-ui/issues
10+
homepage: https://github.com/haskell-servant/servant-swagger-ui
11+
bug-reports: https://github.com/haskell-servant/servant-swagger-ui/issues
1212
author: Oleg Grenrus <[email protected]>
13-
maintainer: Oleg Grenrus <[email protected]>
13+
maintainer: [email protected]
1414
license: BSD3
1515
license-file: LICENSE
1616
build-type: Simple
1717
tested-with: GHC ==7.8.4 || ==7.10.3 || ==8.0.2 || ==8.2.2 || ==8.4.3
1818

1919
source-repository head
2020
type: git
21-
location: https://github.com/phadej/servant-swagger-ui
21+
location: https://github.com/haskell-servant/servant-swagger-ui
2222

2323
executable servant-swagger-ui-example
2424
main-is: Main.hs

servant-swagger-ui-jensoleg/servant-swagger-ui-jensoleg.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cabal-version: 1.12
22
name: servant-swagger-ui-jensoleg
33
version: 0.3
4+
x-revision: 1
45

56
synopsis: Servant swagger ui: Jens-Ole Graulund theme
67
category: Web, Servant, Swagger
@@ -9,10 +10,10 @@ description:
910
.
1011
Jsn-Ole Graulund theme https://github.com/jensoleg/swagger-org
1112

12-
homepage: https://github.com/phadej/servant-swagger-ui
13-
bug-reports: https://github.com/phadej/servant-swagger-ui/issues
13+
homepage: https://github.com/haskell-servant/servant-swagger-ui
14+
bug-reports: https://github.com/haskell-servant/servant-swagger-ui/issues
1415
author: Oleg Grenrus <[email protected]>
15-
maintainer: Oleg Grenrus <[email protected]>
16+
maintainer: [email protected]
1617
license: BSD3
1718
license-file: LICENSE
1819
build-type: Simple
@@ -71,7 +72,7 @@ extra-source-files:
7172

7273
source-repository head
7374
type: git
74-
location: https://github.com/phadej/servant-swagger-ui
75+
location: https://github.com/haskell-servant/servant-swagger-ui
7576

7677
library
7778
hs-source-dirs:
@@ -85,8 +86,8 @@ library
8586
base >=4.7 && <4.12
8687
, bytestring >=0.10.4.0 && <0.11
8788
, file-embed-lzma >=0 && <0.1
88-
, servant >=0.4.4.5 && <0.14
89-
, servant-server >=0.4.4.5 && <0.14
89+
, servant >=0.4.4.5 && <0.15
90+
, servant-server >=0.4.4.5 && <0.15
9091
, swagger2 >=2.0.1 && <2.3
9192
, text >=1.2.0.6 && <1.3
9293
exposed-modules:

servant-swagger-ui-redoc/servant-swagger-ui-redoc.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cabal-version: 1.12
22
name: servant-swagger-ui-redoc
33
version: 0.3.0.1.21.2
4+
x-revision: 1
45

56
synopsis: Servant swagger ui: ReDoc theme
67
category: Web, Servant, Swagger
@@ -9,10 +10,10 @@ description:
910
.
1011
ReDoc theme: https://github.com/Rebilly/ReDoc
1112

12-
homepage: https://github.com/phadej/servant-swagger-ui
13-
bug-reports: https://github.com/phadej/servant-swagger-ui/issues
13+
homepage: https://github.com/haskell-servant/servant-swagger-ui
14+
bug-reports: https://github.com/haskell-servant/servant-swagger-ui/issues
1415
author: Oleg Grenrus <[email protected]>
15-
maintainer: Oleg Grenrus <[email protected]>
16+
maintainer: [email protected]
1617
license: BSD3
1718
license-file: LICENSE
1819
build-type: Simple
@@ -24,7 +25,7 @@ extra-source-files:
2425

2526
source-repository head
2627
type: git
27-
location: https://github.com/phadej/servant-swagger-ui
28+
location: https://github.com/haskell-servant/servant-swagger-ui
2829

2930
library
3031
hs-source-dirs:
@@ -38,8 +39,8 @@ library
3839
base >=4.7 && <4.12
3940
, bytestring >=0.10.4.0 && <0.11
4041
, file-embed-lzma >=0 && <0.1
41-
, servant >=0.4.4.5 && <0.14
42-
, servant-server >=0.4.4.5 && <0.14
42+
, servant >=0.4.4.5 && <0.15
43+
, servant-server >=0.4.4.5 && <0.15
4344
, swagger2 >=2.0.1 && <2.3
4445
, text >=1.2.0.6 && <1.3
4546
exposed-modules:

servant-swagger-ui/servant-swagger-ui.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
cabal-version: 1.12
22
name: servant-swagger-ui
33
version: 0.3.0.3.13.2
4+
x-revision: 1
45

56
synopsis: Servant swagger ui
67
category: Web, Servant, Swagger
78
description: Provide embedded swagger UI for servant and swagger (i.e. servant-swagger)
89

9-
homepage: https://github.com/phadej/servant-swagger-ui
10-
bug-reports: https://github.com/phadej/servant-swagger-ui/issues
10+
homepage: https://github.com/haskell-servant/servant-swagger-ui
11+
bug-reports: https://github.com/haskell-servant/servant-swagger-ui/issues
1112
author: Oleg Grenrus <[email protected]>
12-
maintainer: Oleg Grenrus <[email protected]>
13+
maintainer: [email protected]
1314
license: BSD3
1415
license-file: LICENSE
1516
build-type: Simple
@@ -28,7 +29,7 @@ extra-source-files:
2829

2930
source-repository head
3031
type: git
31-
location: https://github.com/phadej/servant-swagger-ui
32+
location: https://github.com/haskell-servant/servant-swagger-ui
3233

3334
library
3435
hs-source-dirs:
@@ -42,8 +43,8 @@ library
4243
base >=4.7 && <4.12
4344
, bytestring >=0.10.4.0 && <0.11
4445
, file-embed-lzma >=0 && <0.1
45-
, servant >=0.4.4.5 && <0.14
46-
, servant-server >=0.4.4.5 && <0.14
46+
, servant >=0.4.4.5 && <0.15
47+
, servant-server >=0.4.4.5 && <0.15
4748
, swagger2 >=2.0.1 && <2.3
4849
, text >=1.2.0.6 && <1.3
4950
exposed-modules:

0 commit comments

Comments
 (0)