Skip to content

Commit

Permalink
cabal build the project as library
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelong Cong committed Feb 25, 2015
1 parent 1ee18c2 commit 340796f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Enigma.hs → Crypto/Enigma.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

module Enigma where
module Crypto.Enigma where

import Helper
import Crypto.Enigma.Helper

type State = [Char] -- state of the enigma machine
data Direction = Fwd | Bwd deriving (Show, Eq)
Expand Down
2 changes: 1 addition & 1 deletion src/Helper.hs → Crypto/Enigma/Helper.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

module Helper where
module Crypto.Enigma.Helper where

import Data.Char (ord, chr, isAsciiUpper)
import Data.Maybe (fromMaybe)
Expand Down
21 changes: 16 additions & 5 deletions enigma-hs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,32 @@ build-type: Simple
extra-source-files: README
cabal-version: >=1.10

library
ghc-options: -Wall
exposed-modules: Crypto.Enigma, Crypto.Enigma.Helper
exposed: True
-- other-modules:
-- other-extensions:
build-depends: base >=4.6
default-language: Haskell2010

executable enigma-hs
ghc-options: -Wall
main-is: Main.hs
-- other-modules:
-- other-extensions:
build-depends: base >=4.6
hs-source-dirs: src
build-depends: base >=4.6,
enigma-hs
hs-source-dirs: tests
default-language: Haskell2010

test-suite enigma-test
test-suite tests
ghc-options: -Wall
type: exitcode-stdio-1.0
main-is: Test.hs
hs-source-dirs: src
build-depends: base >=4.6
hs-source-dirs: tests
build-depends: base >=4.6,
enigma-hs
default-language: Haskell2010


2 changes: 1 addition & 1 deletion src/Main.hs → tests/Main.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import Enigma
import Crypto.Enigma

confs :: (Conf, State)
confs = intToSettingDefault 0
Expand Down
2 changes: 1 addition & 1 deletion src/Test.hs → tests/Test.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import Enigma
import Crypto.Enigma
import System.Exit (exitFailure, exitSuccess)

-- general tests --------------------------------------------------------------
Expand Down

0 comments on commit 340796f

Please sign in to comment.