aboutsummaryrefslogtreecommitdiff
path: root/tests/multipkg/gen.sh
blob: 670b94e66cf50b6dd5b21b4dc8a0f1b9d4693c00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

printf '' > package-paths.list

while read -r path name deps; do
    mkdir -p "$path"
    printf '%s\n' "$path" >> package-paths.list
    cat > "$path/$name.cabal" <<EOF
name:                ${name}
version:             0
build-type:          Simple
cabal-version:       >=1.10

library
  exposed-modules:   Lib
  build-depends:     base, filepath, directory ${deps}
  default-language:  Haskell2010

executable ${name}-exe
  main-is:           Exe.hs
  build-depends:     base, ${name} ${deps}
  default-language:  Haskell2010

test-suite ${name}-test
  type:              exitcode-stdio-1.0
  main-is:           Exe.hs
  build-depends:     base, ${name} ${deps}

benchmark ${name}-bench
  type:              exitcode-stdio-1.0
  main-is:           Exe.hs
  build-depends:     base, ${name} ${deps}
EOF
done <<EOF
proj/       proj     ,pkg-a,pkg-b,pkg-oot
proj/pkg-a  pkg-a
proj/pkg-b  pkg-b
pkg-oot/    pkg-oot
EOF