on master help sign in
Merge pull request #629 from maxsnew/cabal
0cd3ea1Evan Czaplicki
.travis.yml+31−3
@@ -1,3 +1,31 @@
1+# Based on https://github.com/hvr/multi-ghc-travis and https://github.com/ekmett/lens/blob/master/.travis.yml
2+
1−language: haskell
3+# NB: don't set `language: haskell` here
2−ghc:
4+
3− - 7.6
5+# The following enables several GHC versions to be tested; often it's enough to test only against the last release in a major GHC version. Feel free to omit lines listings versions you don't need/want testing for.
6+env:
7+ - GHCVER=7.6.3
8+ - GHCVER=7.8.2
9+
10+# Note: the distinction between `before_install` and `install` is not important.
11+before_install:
12+ - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
13+ - travis_retry sudo apt-get update
14+ - travis_retry sudo apt-get install cabal-install-1.18 ghc-$GHCVER happy alex # see note about happy/alex
15+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.18/bin:$PATH
16+ - cabal update
17+ # Update happy when building with GHC 7.8 or head
18+ - |
19+ if [ $GHCVER = "head" ] || [ $GHCVER = "7.8.2" ]; then
20+ cabal install happy alex
21+ export PATH=$HOME/.cabal/bin:$PATH
22+ fi
23+
24+install:
25+ - cabal install --only-dependencies --enable-tests --enable-benchmarks
26+
27+# 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.
28+script:
29+ - cabal configure --enable-tests
30+ - cabal build
31+ - cabal test
Elm.cabal+8−4
@@ -115,7 +115,8 @@ Library
115 text,
115 text,
116 transformers >= 0.2,
116 transformers >= 0.2,
117 union-find,
117 union-find,
118− unordered-containers
118+ unordered-containers,
119+ yaml
119
120
120Executable elm
121Executable elm
121 Main-is: Compiler.hs
122 Main-is: Compiler.hs
@@ -199,7 +200,8 @@ Executable elm
199 text,
200 text,
200 transformers >= 0.2,
201 transformers >= 0.2,
201 union-find,
202 union-find,
202− unordered-containers
203+ unordered-containers,
204+ yaml
203
205
204Executable elm-doc
206Executable elm-doc
205 Main-is: Docs.hs
207 Main-is: Docs.hs
@@ -239,7 +241,8 @@ Executable elm-doc
239 parsec >= 3.1.1,
241 parsec >= 3.1.1,
240 pretty,
242 pretty,
241 text,
243 text,
242− union-find
244+ union-find,
245+ yaml
243
246
244Test-Suite compiler-tests
247Test-Suite compiler-tests
245 Type: exitcode-stdio-1.0
248 Type: exitcode-stdio-1.0
@@ -279,7 +282,8 @@ Test-Suite compiler-tests
279 text,
282 text,
280 transformers >= 0.2,
283 transformers >= 0.2,
281 union-find,
284 union-find,
282− unordered-containers
285+ unordered-containers,
286+ yaml
283
287
284Test-Suite library-tests
288Test-Suite library-tests
285 Type: exitcode-stdio-1.0
289 Type: exitcode-stdio-1.0
compiler/Build/Dependencies.hs+4−1
@@ -62,7 +62,10 @@ getDependencies =
62
62
63nativeFiles :: [FilePath] -> ErrorT String IO [FilePath]
63nativeFiles :: [FilePath] -> ErrorT String IO [FilePath]
64nativeFiles directories =
64nativeFiles directories =
65+ do exists <- liftIO $ doesFileExist Path.dependencyFile
66+ if not exists
67+ then return []
65− concat `fmap` mapM getNativeFiles directories
68+ else concat `fmap` mapM getNativeFiles directories
66 where
69 where
67 getNativeFiles dir =
70 getNativeFiles dir =
68 Deps.withDeps (dir </> Path.dependencyFile) $ \deps ->
71 Deps.withDeps (dir </> Path.dependencyFile) $ \deps ->