Skip to content

Commit 1d007fb

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 1d007fb

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

+1394
-11
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: 56 additions & 10 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,69 @@ 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:
4452
attoparsec >= 0.13
4553
, base >=4.7 && <5
4654
, directory >= 1.3
4755
, filepath >= 1.4
4856
, filepattern >= 0.1
57+
, hie-bios >=0.5 && <0.6
58+
, hslogger
4959
, text >= 1.2
5060
, transformers >= 0.5
5161
, yaml >= 0.5
62+
63+
if flag(cabalHelper)
64+
exposed-modules:
65+
Hie.CabalHelper
66+
build-depends:
67+
cabal-helper >= 1.1 && <1.2
68+
, containers
69+
, process
70+
5271
default-language: Haskell2010
5372

5473
executable gen-hie
74+
import: cabal-helper
5575
main-is: Main.hs
5676
other-modules:
5777
Paths_implicit_hie
@@ -67,12 +87,14 @@ executable gen-hie
6787
, filepath
6888
, filepattern
6989
, implicit-hie
90+
, optparse-applicative
7091
, text
7192
, transformers
7293
, yaml
7394
default-language: Haskell2010
7495

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

0 commit comments

Comments
 (0)