Skip to content

Commit 0d87da9

Browse files
committed
haskell-ci can work with cabal.project
1 parent 19fcd04 commit 0d87da9

File tree

2 files changed

+16
-33
lines changed

2 files changed

+16
-33
lines changed

.travis.yml

Lines changed: 12 additions & 33 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-
# runghc make_travis_yml_2.hs '--ghc-head' 'fgl.cabal'
3+
# runghc make_travis_yml_2.hs '--ghc-head' '--output' '.travis.yml' 'cabal.project'
44
#
55
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
@@ -106,32 +106,34 @@ install:
106106
cabal new-update head.hackage -v
107107
fi
108108
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
109-
- "printf 'packages: \".\"\\n' > cabal.project"
109+
- "printf 'packages: \".\" \"fgl-arbitrary\"\\n' > cabal.project"
110110
- touch cabal.project.local
111-
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- fgl | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
111+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- fgl | grep -vw -- fgl-arbitrary | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
112112
- cat cabal.project || true
113113
- cat cabal.project.local || true
114114
- if [ -f "./configure.ac" ]; then
115115
(cd "." && autoreconf -i);
116116
fi
117+
- if [ -f "fgl-arbitrary/configure.ac" ]; then
118+
(cd "fgl-arbitrary" && autoreconf -i);
119+
fi
117120
- rm -f cabal.project.freeze
118121
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
119122
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
120-
- rm -rf .ghc.environment.* "."/dist
123+
- rm -rf .ghc.environment.* "."/dist "fgl-arbitrary"/dist
121124
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
122-
- DISTDIRARB=$(mktemp -d /tmp/dist-test.XXXX)
123125

124126
# Here starts the actual work to be performed for the package under test;
125127
# any command which exits with a non-zero exit code causes the build to fail.
126128
script:
127129
# test that source-distributions can be generated
128130
- cabal new-sdist all
129131
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
130-
- pushd ${DISTDIR} || false
132+
- cd ${DISTDIR} || false
131133
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
132-
- "printf 'packages: fgl-*/*.cabal\\n' > cabal.project"
134+
- "printf 'packages: fgl-*/*.cabal fgl-arbitrary-*/*.cabal\\n' > cabal.project"
133135
- touch cabal.project.local
134-
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- fgl | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
136+
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- fgl | grep -vw -- fgl-arbitrary | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
135137
- cat cabal.project || true
136138
- cat cabal.project.local || true
137139
# this builds all libraries and executables (without tests/benchmarks)
@@ -143,36 +145,13 @@ script:
143145

144146
# cabal check
145147
- (cd fgl-* && cabal check)
148+
- (cd fgl-arbitrary-* && cabal check)
146149

147150
# haddock
148151
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
149152

150153
# Build without installed constraints for packages in global-db
151154
- 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
152155

153-
- popd
154-
155-
# Check the fgl-arbitrary sub-package
156-
- cd fgl-arbitrary
157-
# Relying upon fgl being installed above when testing sdist, and that
158-
# it doesn't require any other dependencies not used by fgl.
159-
160-
# test that source-distributions can be generated
161-
- cabal new-sdist all
162-
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIRARB}/
163-
- cd ${DISTDIRARB} || false
164-
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
165-
- "printf 'packages: fgl-arbitrary-*/*.cabal\\n' > cabal.project"
166-
- touch cabal.project.local
167-
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- fgl | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
168-
- cat cabal.project || true
169-
- cat cabal.project.local || true
170-
# this builds all libraries and executables (without tests/benchmarks)
171-
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
172-
173-
# build & run tests, build benchmarks
174-
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
175-
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
176-
177-
# REGENDATA ["--ghc-head","fgl.cabal"]
156+
# REGENDATA ["--ghc-head","--output",".travis.yml","cabal.project"]
178157
# EOF

fgl-arbitrary/fgl-arbitrary.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ build-type: Simple
1818
cabal-version: >=1.10
1919
extra-source-files: ChangeLog
2020

21+
tested-with: GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3,
22+
GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1, GHC == 8.2.2,
23+
GHC == 8.4.3, GHC == 8.6.2
24+
2125
source-repository head
2226
type: git
2327
location: git://github.com/haskell/fgl.git

0 commit comments

Comments
 (0)