Skip to content

Commit cfd3ec2

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 88e8f1c commit cfd3ec2

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: 57 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: 18f92037a7863d121ac45e847f7dc6177adf0ebc7951dfa1588340f86e64456b
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,41 +9,68 @@ bug-reports: https://github.com/Avi-D-coder/implicit-hie/issues
169
author: Avi Dessauer
1710
maintainer: [email protected]
1811
copyright: 2020
19-
license: BSD3
12+
license: BSD-3-Clause
2013
license-file: LICENSE
2114
build-type: Simple
2215
extra-source-files:
2316
README.md
2417
ChangeLog.md
18+
test/testdata/cabal-helper/**/*.hs
19+
test/testdata/cabal-helper/**/*.cabal
20+
test/testdata/cabal-helper/**/*.project
2521

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

26+
flag cabalHelper
27+
Description: Enable Cabal-Helper dependencies
28+
Default: True
29+
Manual: True
30+
31+
common cabal-helper
32+
if flag(cabalHelper)
33+
cpp-options: -DCABAL_HELPER_SUPPORT
34+
3035
library
36+
import: cabal-helper
3137
exposed-modules:
3238
Hie.Cabal.Parser
3339
Hie.Locate
40+
Hie.Logger
3441
Hie.Yaml
42+
43+
if flag(cabalHelper)
44+
exposed-modules:
45+
Hie.CabalHelper
46+
build-depends:
47+
cabal-helper >= 1.1 && <1.2
48+
3549
other-modules:
3650
Paths_implicit_hie
3751
autogen-modules:
3852
Paths_implicit_hie
3953
hs-source-dirs:
4054
src
41-
ghc-options: -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns -fno-warn-unused-imports -fno-warn-unused-binds -fno-warn-name-shadowing -fwarn-redundant-constraints
55+
ghc-options: -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns -fwarn-unused-imports -fwarn-unused-binds -fwarn-name-shadowing -fwarn-redundant-constraints
4256
build-depends:
43-
attoparsec >= 0.13
57+
aeson
58+
, attoparsec >= 0.13
4459
, base >=4.7 && <5
60+
, containers
4561
, directory >= 1.3
4662
, filepath >= 1.4
4763
, filepattern >= 0.1
64+
, hie-bios >=0.5 && <0.6
65+
, hslogger
4866
, text >= 1.2
4967
, transformers >= 0.5
68+
, process
5069
, yaml >= 0.5
5170
default-language: Haskell2010
5271

5372
executable gen-hie
73+
import: cabal-helper
5474
main-is: Main.hs
5575
other-modules:
5676
Paths_implicit_hie
@@ -66,12 +86,14 @@ executable gen-hie
6686
, filepath
6787
, filepattern
6888
, implicit-hie
89+
, optparse-applicative
6990
, text
7091
, transformers
7192
, yaml
7293
default-language: Haskell2010
7394

7495
test-suite implicit-hie-test
96+
import: cabal-helper
7597
type: exitcode-stdio-1.0
7698
main-is: Spec.hs
7799
other-modules:
@@ -94,3 +116,27 @@ test-suite implicit-hie-test
94116
, transformers
95117
, yaml
96118
default-language: Haskell2010
119+
120+
test-suite unit-tests
121+
import: cabal-helper
122+
type: exitcode-stdio-1.0
123+
main-is: Spec.hs
124+
other-modules:
125+
Paths_implicit_hie, TestUtils
126+
if flag(cabalHelper)
127+
other-modules:
128+
CabalHelperSpec
129+
hs-source-dirs:
130+
test/unit, test/utils
131+
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
132+
build-depends:
133+
aeson
134+
, base
135+
, directory
136+
, filepath
137+
, hie-bios
138+
, hspec
139+
, implicit-hie
140+
, text
141+
, yaml
142+
default-language: Haskell2010

0 commit comments

Comments
 (0)