git.iko.soy/typeable/hjsonpointer
on master help sign in
1.3.0. Enable GHC 8.2.1.
e2be2c7Ian Grant Jeffries
.travis.yml+67−56
@@ -1,84 +1,95 @@
1+# This Travis job script has been generated by a script via
2+#
3+# make_travis_yml_2.hs 'hjsonpointer.cabal'
4+#
1−# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
5+# For more information, see https://github.com/hvr/multi-ghc-travis
2#
6#
3−# Manually modified to remove cabal check. I don't want a description field.
4−
5language: c
7language: c
6sudo: false
8sudo: false
7
9
10+git:
11+ submodules: false # whether to recursively clone submodules
12+
8cache:
13cache:
9 directories:
14 directories:
10− - $HOME/.cabsnap
11 - $HOME/.cabal/packages
15 - $HOME/.cabal/packages
16+ - $HOME/.cabal/store
12
17
13before_cache:
18before_cache:
14 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
19 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
20+ # remove files that are regenerated by 'cabal update'
15− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
21+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
22+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
23+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
24+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
25+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
16
26
17matrix:
27matrix:
18 include:
28 include:
19− - env: CABALVER=1.18 GHCVER=7.8.4
29+ - compiler: "ghc-7.10.3"
20− compiler: ": #GHC 7.8.4"
30+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
21− addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
31+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
22− - env: CABALVER=1.22 GHCVER=7.10.2
32+ - compiler: "ghc-8.0.1"
23− compiler: ": #GHC 7.10.2"
33+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
24− addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
34+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.1], sources: [hvr-ghc]}}
25− - env: CABALVER=1.24 GHCVER=8.0.1
35+ - compiler: "ghc-8.2.1"
26− compiler: ": #GHC 8.0.1"
36+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
27− addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
37+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
28
38
29before_install:
39before_install:
40+ - HC=${CC}
41+ - HCPKG=${HC/ghc/ghc-pkg}
30 - unset CC
42 - unset CC
31− - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
43+ - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
44+ - PKGNAME='hjsonpointer'
32
45
33install:
46install:
34 - cabal --version
47 - cabal --version
35− - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
48+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
36− - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
49+ - BENCH=${BENCH---enable-benchmarks}
37− then
50+ - TEST=${TEST---enable-tests}
38− zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
51+ - HADDOCK=${HADDOCK-true}
39− $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
52+ - INSTALLED=${INSTALLED-true}
40− fi
41 - travis_retry cabal update -v
53 - travis_retry cabal update -v
42− - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
54+ - sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
43− - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
55+ - rm -fv cabal.project.local
44− - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
56+ - "echo 'packages: .' > cabal.project"
45−
57+ - rm -f cabal.project.freeze
46−# check whether current requested install-plan matches cached package-db snapshot
58+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
47− - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
59+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
48− then
49− echo "cabal build-cache HIT";
50− rm -rfv .ghc;
51− cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
52− cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
53− else
54− echo "cabal build-cache MISS";
55− rm -rf $HOME/.cabsnap;
56− mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
57− cabal install --only-dependencies --enable-tests --enable-benchmarks;
58− fi
59−
60−# snapshot package-db on cache miss
61− - if [ ! -d $HOME/.cabsnap ];
62− then
63− echo "snapshotting package-db to build-cache";
64− mkdir $HOME/.cabsnap;
65− cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
66− cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
67− fi
68
60
69# Here starts the actual work to be performed for the package under test;
61# Here starts the actual work to be performed for the package under test;
70# any command which exits with a non-zero exit code causes the build to fail.
62# any command which exits with a non-zero exit code causes the build to fail.
71script:
63script:
72 - if [ -f configure.ac ]; then autoreconf -i; fi
64 - if [ -f configure.ac ]; then autoreconf -i; fi
73− - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
65+ - rm -rf .ghc.environment.* dist/
74− - cabal build # this builds all libraries and executables (including tests/benchmarks)
75− - cabal test
76− - cabal sdist # tests that a source-distribution can be generated
66+ - cabal sdist # test that a source-distribution can be generated
67+ - cd dist/
68+ - SRCTAR=(${PKGNAME}-*.tar.gz)
69+ - SRC_BASENAME="${SRCTAR/%.tar.gz}"
70+ - tar -xvf "./$SRC_BASENAME.tar.gz"
71+ - cd "$SRC_BASENAME/"
72+## from here on, CWD is inside the extracted source-tarball
73+ - rm -fv cabal.project.local
74+ - "echo 'packages: .' > cabal.project"
75+ # this builds all libraries and executables (without tests/benchmarks)
76+ - rm -f cabal.project.freeze
77+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
78+ # this builds all libraries and executables (including tests/benchmarks)
79+ # - rm -rf ./dist-newstyle
80+
81+ # Build with installed constraints for packages in global-db
82+ - if $INSTALLED; then
83+ 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;
84+ else echo "Not building with installed constraints"; fi
85+
86+ # build & run tests, build benchmarks
87+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
88+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
77
89
78−# Check that the resulting source distribution can be built & installed.
90+ # haddock
79−# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
91+ - rm -rf ./dist-newstyle
80−# `cabal install --force-reinstalls dist/*-*.tar.gz`
92+ - if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
81− - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
82− (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
83
93
94+# REGENDATA ["hjsonpointer.cabal"]
84# EOF
95# EOF
changelog.md+4
@@ -1,3 +1,7 @@
1+# 1.3.0
2+
3++ Test with GHC 8.2. Drop GHC 7.8.
4+
1# 1.2.0
5# 1.2.0
2
6
3+ Track upper bounds in a Hackage revision instead of source code.
7+ Track upper bounds in a Hackage revision instead of source code.
hjsonpointer.cabal+4−6
@@ -1,5 +1,5 @@
1name: hjsonpointer
1name: hjsonpointer
2−version: 1.2.0
2+version: 1.3.0
3synopsis: JSON Pointer library
3synopsis: JSON Pointer library
4homepage: https://github.com/seagreen/hjsonpointer
4homepage: https://github.com/seagreen/hjsonpointer
5license: MIT
5license: MIT
@@ -9,6 +9,8 @@ maintainer: ian@housejeffries.com
9category: Data
9category: Data
10build-type: Simple
10build-type: Simple
11cabal-version: >=1.10
11cabal-version: >=1.10
12+-- Rerun multi-ghc-travis (executable make-travis-yml-2) after changing:
13+Tested-With: GHC == 7.10.3, GHC == 8.0.1, GHC == 8.2.1
12extra-source-files:
14extra-source-files:
13 changelog.md
15 changelog.md
14 README.md
16 README.md
@@ -22,7 +24,7 @@ library
22 exposed-modules:
24 exposed-modules:
23 JSONPointer
25 JSONPointer
24 build-depends:
26 build-depends:
25− base >= 4.6 && < 4.10
27+ base >= 4.6 && < 4.11
26 , aeson >= 0.7
28 , aeson >= 0.7
27 , hashable >= 1.2
29 , hashable >= 1.2
28 , QuickCheck >= 2.8
30 , QuickCheck >= 2.8
@@ -54,7 +56,3 @@ test-suite unit
54 , unordered-containers
56 , unordered-containers
55 , text
57 , text
56 , vector
58 , vector
57−
58−source-repository head
59− type: git
60− location: git://github.com/seagreen/hjsonpointer.git
shell.nix+1
@@ -1,3 +1,4 @@
1+{ghc}:
1with (import <nixpkgs> {});
2with (import <nixpkgs> {});
2
3
3haskell.lib.buildStackProject {
4haskell.lib.buildStackProject {
src/JSONPointer.hs+1−6
@@ -16,11 +16,6 @@ import GHC.Generics (Generic)
16import Test.QuickCheck
16import Test.QuickCheck
17import Text.Read (readMaybe)
17import Text.Read (readMaybe)
18
18
19−-- For GHCs before 7.10:
20−import Control.Applicative
21−import Data.Monoid
22−import Data.Traversable
23−
24--------------------------------------------------
19--------------------------------------------------
25-- * Resolution
20-- * Resolution
26--------------------------------------------------
21--------------------------------------------------
@@ -112,7 +107,7 @@ unescape txt =
112--------------------------------------------------
107--------------------------------------------------
113-- * Wrapper Types
108-- * Wrapper Types
114--
109--
115−-- These aren't used by the rest of the library
110+-- $ These aren't used by the rest of the library
116-- (as explained in the docs for 'Token').
111-- (as explained in the docs for 'Token').
117--
112--
118-- However, they might be useful if you need to distinguish JSON Pointer
113-- However, they might be useful if you need to distinguish JSON Pointer
stack.yaml+1−6
@@ -1,7 +1,2 @@
1−resolver: lts-8.20
1+resolver: nightly-2017-09-18
2−extra-deps:
3− - QuickCheck-2.10.0.1
4pvp-bounds: upper-revision
2pvp-bounds: upper-revision
5−nix:
6− enable: true
7− shell-file: shell.nix
test/Unit.hs+4−7
@@ -1,11 +1,13 @@
1
1
2module Main where
2module Main where
3
3
4−import Control.Arrow
5import Data.Aeson
4import Data.Aeson
5+import Data.Bifunctor (first)
6+import Data.Foldable
7+import Data.Monoid
6import Data.Text (Text)
8import Data.Text (Text)
7import qualified Data.Text as T
9import qualified Data.Text as T
8−import Data.Text.Encoding
10+import Data.Text.Encoding (decodeUtf8, encodeUtf8)
9import qualified Data.Vector as V
11import qualified Data.Vector as V
10import qualified JSONPointer as JP
12import qualified JSONPointer as JP
11import Network.HTTP.Types.URI (urlDecode)
13import Network.HTTP.Types.URI (urlDecode)
@@ -13,11 +15,6 @@ import Network.HTTP.Types.URI (urlDecode)
13import Test.Hspec
15import Test.Hspec
14import Test.QuickCheck (property)
16import Test.QuickCheck (property)
15
17
16−-- For GHCs before 7.10:
17−import Control.Applicative
18−import Data.Foldable
19−import Data.Monoid
20−
21import qualified Example
18import qualified Example
22
19
23main :: IO ()
20main :: IO ()