-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3430 from commercialhaskell/sub-foreign-libraries
Support for Cabal 2.0 sub and foreign libraries
- Loading branch information
Showing
14 changed files
with
172 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import StackTest | ||
|
||
main :: IO () | ||
main = stack ["build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
29 changes: 29 additions & 0 deletions
29
test/integration/tests/internal-libraries/files/files.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: files | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
cabal-version: >=2.0 | ||
|
||
library | ||
hs-source-dirs: src | ||
exposed-modules: Files | ||
build-depends: base | ||
default-language: Haskell2010 | ||
|
||
library foo | ||
hs-source-dirs: src-foo | ||
exposed-modules: Foo | ||
build-depends: base, files, stm | ||
default-language: Haskell2010 | ||
|
||
executable bar | ||
hs-source-dirs: src-bar | ||
main-is: Main.hs | ||
build-depends: base, files, foo | ||
default-language: Haskell2010 | ||
|
||
foreign-library baz | ||
type: native-shared | ||
other-modules: Baz | ||
build-depends: base, files, foo, mtl | ||
hs-source-dirs: src-baz | ||
default-language: Haskell2010 |
11 changes: 11 additions & 0 deletions
11
test/integration/tests/internal-libraries/files/src-bar/Main.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Main where | ||
|
||
import Files | ||
import Foo | ||
|
||
main :: IO () | ||
main = do | ||
putStrLn "files:" | ||
print files | ||
putStrLn "foo" | ||
foo >>= print |
12 changes: 12 additions & 0 deletions
12
test/integration/tests/internal-libraries/files/src-baz/Baz.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Baz where | ||
|
||
import Files | ||
import Foo | ||
import Control.Monad.Reader | ||
|
||
baz :: IO () | ||
baz = flip runReaderT () $ lift $ do | ||
putStrLn "files:" | ||
print files | ||
putStrLn "foo" | ||
foo >>= print |
7 changes: 7 additions & 0 deletions
7
test/integration/tests/internal-libraries/files/src-foo/Foo.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Foo where | ||
|
||
import Control.Monad.STM | ||
import Files | ||
|
||
foo :: IO String | ||
foo = atomically $ return $ "foo using " ++ files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Files where | ||
|
||
files :: String | ||
files = "files" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resolver: ghc-8.2.1 | ||
extra-deps: | ||
- stm-2.4.4.1 | ||
- mtl-2.2.1 |