mirror of
https://github.com/typeable/hjsonpointer.git
synced 2024-08-16 18:10:22 +03:00
1.3.0. Enable GHC 8.2.1.
Also: + Drop GHC 7.8. + Regenerate .travis.yml using make-travis-yml-2.
This commit is contained in:
parent
f7a0cfb2d2
commit
e2be2c75a3
123
.travis.yml
123
.travis.yml
@ -1,84 +1,95 @@
|
|||||||
# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
|
# This Travis job script has been generated by a script via
|
||||||
|
#
|
||||||
|
# make_travis_yml_2.hs 'hjsonpointer.cabal'
|
||||||
|
#
|
||||||
|
# For more information, see https://github.com/hvr/multi-ghc-travis
|
||||||
#
|
#
|
||||||
# Manually modified to remove cabal check. I don't want a description field.
|
|
||||||
|
|
||||||
language: c
|
language: c
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
git:
|
||||||
|
submodules: false # whether to recursively clone submodules
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.cabsnap
|
|
||||||
- $HOME/.cabal/packages
|
- $HOME/.cabal/packages
|
||||||
|
- $HOME/.cabal/store
|
||||||
|
|
||||||
before_cache:
|
before_cache:
|
||||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
|
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
|
||||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
|
# 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:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- env: CABALVER=1.18 GHCVER=7.8.4
|
- compiler: "ghc-7.10.3"
|
||||||
compiler: ": #GHC 7.8.4"
|
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||||
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=1.22 GHCVER=7.10.2
|
- compiler: "ghc-8.0.1"
|
||||||
compiler: ": #GHC 7.10.2"
|
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||||
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.1], sources: [hvr-ghc]}}
|
||||||
- env: CABALVER=1.24 GHCVER=8.0.1
|
- compiler: "ghc-8.2.1"
|
||||||
compiler: ": #GHC 8.0.1"
|
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
|
- HC=${CC}
|
||||||
|
- HCPKG=${HC/ghc/ghc-pkg}
|
||||||
- unset CC
|
- unset CC
|
||||||
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
|
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
|
||||||
|
- PKGNAME='hjsonpointer'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- cabal --version
|
- cabal --version
|
||||||
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
|
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
|
||||||
- if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
|
- BENCH=${BENCH---enable-benchmarks}
|
||||||
then
|
- TEST=${TEST---enable-tests}
|
||||||
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
|
- HADDOCK=${HADDOCK-true}
|
||||||
$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
|
- INSTALLED=${INSTALLED-true}
|
||||||
fi
|
|
||||||
- travis_retry cabal update -v
|
- travis_retry cabal update -v
|
||||||
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
|
- sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
|
||||||
- cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
|
- rm -fv cabal.project.local
|
||||||
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
|
- "echo 'packages: .' > cabal.project"
|
||||||
|
- rm -f cabal.project.freeze
|
||||||
# check whether current requested install-plan matches cached package-db snapshot
|
- cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
|
||||||
- if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
|
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
|
||||||
then
|
|
||||||
echo "cabal build-cache HIT";
|
|
||||||
rm -rfv .ghc;
|
|
||||||
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
|
|
||||||
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
|
|
||||||
else
|
|
||||||
echo "cabal build-cache MISS";
|
|
||||||
rm -rf $HOME/.cabsnap;
|
|
||||||
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
|
|
||||||
cabal install --only-dependencies --enable-tests --enable-benchmarks;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# snapshot package-db on cache miss
|
|
||||||
- if [ ! -d $HOME/.cabsnap ];
|
|
||||||
then
|
|
||||||
echo "snapshotting package-db to build-cache";
|
|
||||||
mkdir $HOME/.cabsnap;
|
|
||||||
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
|
|
||||||
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Here starts the actual work to be performed for the package under test;
|
# 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.
|
# any command which exits with a non-zero exit code causes the build to fail.
|
||||||
script:
|
script:
|
||||||
- if [ -f configure.ac ]; then autoreconf -i; fi
|
- if [ -f configure.ac ]; then autoreconf -i; fi
|
||||||
- cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
|
- rm -rf .ghc.environment.* dist/
|
||||||
- cabal build # this builds all libraries and executables (including tests/benchmarks)
|
- cabal sdist # test that a source-distribution can be generated
|
||||||
- cabal test
|
- cd dist/
|
||||||
- cabal sdist # tests that a source-distribution can be generated
|
- SRCTAR=(${PKGNAME}-*.tar.gz)
|
||||||
|
- SRC_BASENAME="${SRCTAR/%.tar.gz}"
|
||||||
|
- tar -xvf "./$SRC_BASENAME.tar.gz"
|
||||||
|
- cd "$SRC_BASENAME/"
|
||||||
|
## from here on, CWD is inside the extracted source-tarball
|
||||||
|
- rm -fv cabal.project.local
|
||||||
|
- "echo 'packages: .' > cabal.project"
|
||||||
|
# this builds all libraries and executables (without tests/benchmarks)
|
||||||
|
- rm -f cabal.project.freeze
|
||||||
|
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
|
||||||
|
# this builds all libraries and executables (including tests/benchmarks)
|
||||||
|
# - rm -rf ./dist-newstyle
|
||||||
|
|
||||||
# Check that the resulting source distribution can be built & installed.
|
# Build with installed constraints for packages in global-db
|
||||||
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
|
- if $INSTALLED; then
|
||||||
# `cabal install --force-reinstalls dist/*-*.tar.gz`
|
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;
|
||||||
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
|
else echo "Not building with installed constraints"; fi
|
||||||
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
|
|
||||||
|
|
||||||
|
# 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 ["hjsonpointer.cabal"]
|
||||||
# EOF
|
# EOF
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
# 1.3.0
|
||||||
|
|
||||||
|
+ Test with GHC 8.2. Drop GHC 7.8.
|
||||||
|
|
||||||
# 1.2.0
|
# 1.2.0
|
||||||
|
|
||||||
+ Track upper bounds in a Hackage revision instead of source code.
|
+ Track upper bounds in a Hackage revision instead of source code.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: hjsonpointer
|
name: hjsonpointer
|
||||||
version: 1.2.0
|
version: 1.3.0
|
||||||
synopsis: JSON Pointer library
|
synopsis: JSON Pointer library
|
||||||
homepage: https://github.com/seagreen/hjsonpointer
|
homepage: https://github.com/seagreen/hjsonpointer
|
||||||
license: MIT
|
license: MIT
|
||||||
@ -9,6 +9,8 @@ maintainer: ian@housejeffries.com
|
|||||||
category: Data
|
category: Data
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
|
-- Rerun multi-ghc-travis (executable make-travis-yml-2) after changing:
|
||||||
|
Tested-With: GHC == 7.10.3, GHC == 8.0.1, GHC == 8.2.1
|
||||||
extra-source-files:
|
extra-source-files:
|
||||||
changelog.md
|
changelog.md
|
||||||
README.md
|
README.md
|
||||||
@ -22,7 +24,7 @@ library
|
|||||||
exposed-modules:
|
exposed-modules:
|
||||||
JSONPointer
|
JSONPointer
|
||||||
build-depends:
|
build-depends:
|
||||||
base >= 4.6 && < 4.10
|
base >= 4.6 && < 4.11
|
||||||
, aeson >= 0.7
|
, aeson >= 0.7
|
||||||
, hashable >= 1.2
|
, hashable >= 1.2
|
||||||
, QuickCheck >= 2.8
|
, QuickCheck >= 2.8
|
||||||
@ -54,7 +56,3 @@ test-suite unit
|
|||||||
, unordered-containers
|
, unordered-containers
|
||||||
, text
|
, text
|
||||||
, vector
|
, vector
|
||||||
|
|
||||||
source-repository head
|
|
||||||
type: git
|
|
||||||
location: git://github.com/seagreen/hjsonpointer.git
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{ghc}:
|
||||||
with (import <nixpkgs> {});
|
with (import <nixpkgs> {});
|
||||||
|
|
||||||
haskell.lib.buildStackProject {
|
haskell.lib.buildStackProject {
|
||||||
|
@ -16,11 +16,6 @@ import GHC.Generics (Generic)
|
|||||||
import Test.QuickCheck
|
import Test.QuickCheck
|
||||||
import Text.Read (readMaybe)
|
import Text.Read (readMaybe)
|
||||||
|
|
||||||
-- For GHCs before 7.10:
|
|
||||||
import Control.Applicative
|
|
||||||
import Data.Monoid
|
|
||||||
import Data.Traversable
|
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- * Resolution
|
-- * Resolution
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
@ -112,7 +107,7 @@ unescape txt =
|
|||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- * Wrapper Types
|
-- * Wrapper Types
|
||||||
--
|
--
|
||||||
-- These aren't used by the rest of the library
|
-- $ These aren't used by the rest of the library
|
||||||
-- (as explained in the docs for 'Token').
|
-- (as explained in the docs for 'Token').
|
||||||
--
|
--
|
||||||
-- However, they might be useful if you need to distinguish JSON Pointer
|
-- However, they might be useful if you need to distinguish JSON Pointer
|
||||||
|
@ -1,7 +1,2 @@
|
|||||||
resolver: lts-8.20
|
resolver: nightly-2017-09-18
|
||||||
extra-deps:
|
|
||||||
- QuickCheck-2.10.0.1
|
|
||||||
pvp-bounds: upper-revision
|
pvp-bounds: upper-revision
|
||||||
nix:
|
|
||||||
enable: true
|
|
||||||
shell-file: shell.nix
|
|
||||||
|
11
test/Unit.hs
11
test/Unit.hs
@ -1,11 +1,13 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Control.Arrow
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
|
import Data.Bifunctor (first)
|
||||||
|
import Data.Foldable
|
||||||
|
import Data.Monoid
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import Data.Text.Encoding
|
import Data.Text.Encoding (decodeUtf8, encodeUtf8)
|
||||||
import qualified Data.Vector as V
|
import qualified Data.Vector as V
|
||||||
import qualified JSONPointer as JP
|
import qualified JSONPointer as JP
|
||||||
import Network.HTTP.Types.URI (urlDecode)
|
import Network.HTTP.Types.URI (urlDecode)
|
||||||
@ -13,11 +15,6 @@ import Network.HTTP.Types.URI (urlDecode)
|
|||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.QuickCheck (property)
|
import Test.QuickCheck (property)
|
||||||
|
|
||||||
-- For GHCs before 7.10:
|
|
||||||
import Control.Applicative
|
|
||||||
import Data.Foldable
|
|
||||||
import Data.Monoid
|
|
||||||
|
|
||||||
import qualified Example
|
import qualified Example
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
Loading…
Reference in New Issue
Block a user