From 44d090aa0e0809a9e6aa8ae502c28ea55ae67200 Mon Sep 17 00:00:00 2001 From: kinoru Date: Sat, 5 Dec 2015 06:02:20 +0000 Subject: [PATCH] Restructure files to expose library --- {src => lib}/Data/ByteString/OverheadFree.hs | 0 {src => lib/Unbreak}/Crypto.hs | 2 +- {src => lib/Unbreak}/Format.hs | 2 +- {src => lib/Unbreak}/Run.hs | 6 ++--- src/Main.hs | 2 +- unbreak.cabal | 27 +++++++++++++++----- 6 files changed, 27 insertions(+), 12 deletions(-) rename {src => lib}/Data/ByteString/OverheadFree.hs (100%) rename {src => lib/Unbreak}/Crypto.hs (99%) rename {src => lib/Unbreak}/Format.hs (97%) rename {src => lib/Unbreak}/Run.hs (98%) diff --git a/src/Data/ByteString/OverheadFree.hs b/lib/Data/ByteString/OverheadFree.hs similarity index 100% rename from src/Data/ByteString/OverheadFree.hs rename to lib/Data/ByteString/OverheadFree.hs diff --git a/src/Crypto.hs b/lib/Unbreak/Crypto.hs similarity index 99% rename from src/Crypto.hs rename to lib/Unbreak/Crypto.hs index 1135cae..d27aa0d 100644 --- a/src/Crypto.hs +++ b/lib/Unbreak/Crypto.hs @@ -1,4 +1,4 @@ -module Crypto +module Unbreak.Crypto ( getRandomBytes , scrypt , encrypt diff --git a/src/Format.hs b/lib/Unbreak/Format.hs similarity index 97% rename from src/Format.hs rename to lib/Unbreak/Format.hs index 691676a..429484b 100644 --- a/src/Format.hs +++ b/lib/Unbreak/Format.hs @@ -1,6 +1,6 @@ {-# LANGUAGE DeriveGeneric #-} -module Format +module Unbreak.Format ( FromJSON(..) , dec , EncodeJSON(..) diff --git a/src/Run.hs b/lib/Unbreak/Run.hs similarity index 98% rename from src/Run.hs rename to lib/Unbreak/Run.hs index 6bf10b8..c51c1b7 100644 --- a/src/Run.hs +++ b/lib/Unbreak/Run.hs @@ -1,4 +1,4 @@ -module Run +module Unbreak.Run ( runInit , runOpen ) where @@ -16,8 +16,8 @@ import Data.ByteString (ByteString) import qualified Data.ByteString.OverheadFree as B import qualified Data.Text.Encoding as T -import Crypto -import Format +import Unbreak.Crypto +import Unbreak.Format (++) :: Monoid m => m -> m -> m (++) = mappend diff --git a/src/Main.hs b/src/Main.hs index 86a7b10..142653b 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -4,7 +4,7 @@ import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as B import System.Console.CmdArgs.Explicit -import Run +import Unbreak.Run data Cmd = CmdOpen ByteString diff --git a/unbreak.cabal b/unbreak.cabal index 98289f5..ddb9b2e 100644 --- a/unbreak.cabal +++ b/unbreak.cabal @@ -4,26 +4,41 @@ synopsis: Secure editing of remote documents with unstable connection license: AGPL-3 license-file: LICENSE author: Kinoru +maintainer: xkinoru@gmail.com copyright: Copyright (C) 2015 Kinoru category: Web build-type: Simple cabal-version: >=1.18 -executable u +library + hs-source-dirs: lib + exposed-modules: + Unbreak.Crypto, + Unbreak.Format, + Unbreak.Run, + Data.ByteString.OverheadFree default-extensions: OverloadedStrings, RecordWildCards - main-is: Main.hs - other-modules: Data.ByteString.OverheadFree, Crypto, Format, Run - hs-source-dirs: src + default-language: Haskell2010 build-depends: aeson >= 0.9, aeson-pretty >= 0.7, bytestring >= 0.10, - cmdargs >= 0.10, cryptonite >= 0.9, memory >= 0.10, process == 1.*, text == 1.*, unix == 2.*, base >=4.8 && <4.9 - ghc-options: -Wall -O2 -threaded -static -optl-pthread -optl-static + ghc-options: -Wall -fwarn-incomplete-uni-patterns -O2 -threaded + +executable u + default-extensions: OverloadedStrings, RecordWildCards + main-is: Main.hs + hs-source-dirs: src + build-depends: + bytestring >= 0.10, + cmdargs >= 0.10, + unbreak, + base >=4.8 && <4.9 + ghc-options: -Wall -fwarn-incomplete-uni-patterns -O2 -threaded -static -optl-pthread -optl-static default-language: Haskell2010