Skip to content

Commit dce5b4d

Browse files
committed
Add Cabal Helper cradle and tests
Vastly copied from https://github.com/haskell/haskell-ide-engine/ Also, add a cabal flag to hide the cabal-helper dependency
1 parent 5637343 commit dce5b4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1396
-12
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ tags
2323
TAGS
2424
codex.tags
2525
.vim
26+
27+
28+
## test specific ignores
29+
test/testdata/**/stack.yaml

hie.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ cradle:
88

99
- path: "test"
1010
component: "implicit-hie:test:implicit-hie-test"
11+
12+
- path: test/utils
13+
component: "implicit-hie:test:unit-tests"
14+
15+
- path: test/unit
16+
component: "implicit-hie:test:unit-tests"

implicit-hie.cabal

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
cabal-version: 2.0
2-
3-
-- This file has been generated from package.yaml by hpack version 0.33.0.
4-
--
5-
-- see: https://github.com/sol/hpack
6-
--
7-
-- hash: b2b829a658e33ea328c725dea732391089d03ffd2a216d413a75d88aefa7c181
8-
1+
cabal-version: 2.4
92
name: implicit-hie
103
version: 0.1.0.0
114
description: Auto generate a stack or cabal multi component hie.yaml file
@@ -16,42 +9,70 @@ bug-reports: https://github.com/Avi-D-coder/implicit-hie/issues
169
author: Avi Dessauer
1710
maintainer: avi.the.coder@gmail.com
1811
copyright: 2020
19-
license: BSD3
12+
license: BSD-3-Clause
2013
license-file: LICENSE
2114
tested-with: GHC==8.8.3
2215
build-type: Simple
2316
extra-source-files:
2417
README.md
2518
ChangeLog.md
19+
test/testdata/cabal-helper/**/*.hs
20+
test/testdata/cabal-helper/**/*.cabal
21+
test/testdata/cabal-helper/**/*.project
2622

2723
source-repository head
2824
type: git
2925
location: https://github.com/Avi-D-coder/implicit-hie
3026

27+
flag cabalHelper
28+
Description: Enable Cabal-Helper dependencies
29+
Default: True
30+
Manual: True
31+
32+
common cabal-helper
33+
if flag(cabalHelper)
34+
cpp-options: -DCABAL_HELPER_SUPPORT
35+
3136
library
37+
import: cabal-helper
3238
exposed-modules:
3339
Hie.Cabal.Parser
3440
Hie.Locate
41+
Hie.Logger
3542
Hie.Yaml
43+
3644
other-modules:
3745
Paths_implicit_hie
3846
autogen-modules:
3947
Paths_implicit_hie
4048
hs-source-dirs:
4149
src
42-
ghc-options: -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns -fno-warn-unused-imports -fno-warn-unused-binds -fno-warn-name-shadowing -fwarn-redundant-constraints
50+
ghc-options: -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns -fwarn-unused-imports -fwarn-unused-binds -fwarn-name-shadowing -fwarn-redundant-constraints
4351
build-depends:
44-
attoparsec >= 0.13
52+
aeson
53+
, attoparsec >= 0.13
4554
, base >=4.7 && <5
4655
, directory >= 1.3
4756
, filepath >= 1.4
4857
, filepattern >= 0.1
58+
, hie-bios >=0.5 && <0.6
59+
, hslogger
4960
, text >= 1.2
5061
, transformers >= 0.5
5162
, yaml >= 0.5
63+
64+
if flag(cabalHelper)
65+
exposed-modules:
66+
Hie.CabalHelper
67+
build-depends:
68+
cabal-helper >= 1.1 && <1.2
69+
, containers
70+
, process
71+
5272
default-language: Haskell2010
5373

5474
executable gen-hie
75+
import: cabal-helper
5576
main-is: Main.hs
5677
other-modules:
5778
Paths_implicit_hie
@@ -67,12 +88,14 @@ executable gen-hie
6788
, filepath
6889
, filepattern
6990
, implicit-hie
91+
, optparse-applicative
7092
, text
7193
, transformers
7294
, yaml
7395
default-language: Haskell2010
7496

7597
test-suite implicit-hie-test
98+
import: cabal-helper
7699
type: exitcode-stdio-1.0
77100
main-is: Spec.hs
78101
other-modules:
@@ -95,3 +118,27 @@ test-suite implicit-hie-test
95118
, transformers
96119
, yaml
97120
default-language: Haskell2010
121+
122+
test-suite unit-tests
123+
import: cabal-helper
124+
type: exitcode-stdio-1.0
125+
main-is: Spec.hs
126+
other-modules:
127+
Paths_implicit_hie, TestUtils
128+
if flag(cabalHelper)
129+
other-modules:
130+
CabalHelperSpec
131+
hs-source-dirs:
132+
test/unit, test/utils
133+
ghc-options: -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns -fno-warn-unused-imports -fno-warn-unused-binds -fno-warn-name-shadowing -fwarn-redundant-constraints -threaded -rtsopts -with-rtsopts=-N
134+
build-depends:
135+
aeson
136+
, base
137+
, directory
138+
, filepath
139+
, hie-bios
140+
, hspec
141+
, implicit-hie
142+
, text
143+
, yaml
144+
default-language: Haskell2010

0 commit comments

Comments
 (0)