Split to multiproject
This commit is contained in:
parent
0266d4b06b
commit
03b4cfb3bf
1
cabal.project
Normal file
1
cabal.project
Normal file
@ -0,0 +1 @@
|
|||||||
|
packages: */*
|
@ -12,8 +12,9 @@
|
|||||||
{
|
{
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
haskellPackages = prev.haskellPackages.override ( old: {
|
haskellPackages = prev.haskellPackages.override ( old: {
|
||||||
overrides = final.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: {
|
overrides = final.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: rec {
|
||||||
reddit-pub = f.callPackage ./. {};
|
reddit-pub = f.callPackage ./reddit_pub {};
|
||||||
|
reddit-lib = f.callPackage ./reddit_lib {};
|
||||||
});
|
});
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
5
reddit_lib/CHANGELOG.md
Normal file
5
reddit_lib/CHANGELOG.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Revision history for reddit-lib
|
||||||
|
|
||||||
|
## 0.1.0.0 -- YYYY-mm-dd
|
||||||
|
|
||||||
|
* First version. Released on an unsuspecting world.
|
10
reddit_lib/default.nix
Normal file
10
reddit_lib/default.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ mkDerivation, base, lib }:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "reddit-lib";
|
||||||
|
version = "0.1.0.0";
|
||||||
|
src = ./.;
|
||||||
|
libraryHaskellDepends = [ base ];
|
||||||
|
testHaskellDepends = [ base ];
|
||||||
|
license = "unknown";
|
||||||
|
hydraPlatforms = lib.platforms.none;
|
||||||
|
}
|
38
reddit_lib/reddit-lib.cabal
Normal file
38
reddit_lib/reddit-lib.cabal
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
cabal-version: 3.0
|
||||||
|
name: reddit-lib
|
||||||
|
version: 0.1.0.0
|
||||||
|
synopsis:
|
||||||
|
|
||||||
|
-- A longer description of the package.
|
||||||
|
-- description:
|
||||||
|
homepage:
|
||||||
|
|
||||||
|
-- A URL where users can report bugs.
|
||||||
|
-- bug-reports:
|
||||||
|
license: NONE
|
||||||
|
author: Mats Rauhala
|
||||||
|
maintainer: mats.rauhala@iki.fi
|
||||||
|
|
||||||
|
-- A copyright notice.
|
||||||
|
-- copyright:
|
||||||
|
category: Web
|
||||||
|
extra-source-files: CHANGELOG.md
|
||||||
|
|
||||||
|
library
|
||||||
|
exposed-modules: Reddit.Publish
|
||||||
|
|
||||||
|
-- Modules included in this library but not exported.
|
||||||
|
-- other-modules:
|
||||||
|
|
||||||
|
-- LANGUAGE extensions used by modules in this package.
|
||||||
|
-- other-extensions:
|
||||||
|
build-depends: base ^>=4.15.1.0
|
||||||
|
hs-source-dirs: src
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
test-suite reddit-lib-test
|
||||||
|
default-language: Haskell2010
|
||||||
|
type: exitcode-stdio-1.0
|
||||||
|
hs-source-dirs: test
|
||||||
|
main-is: MyLibTest.hs
|
||||||
|
build-depends: base ^>=4.15.1.0
|
@ -1,5 +1,5 @@
|
|||||||
{-# LANGUAGE DerivingVia #-}
|
{-# LANGUAGE DerivingVia #-}
|
||||||
module Publish where
|
module Reddit.Publish where
|
||||||
|
|
||||||
import Data.Functor.Contravariant
|
import Data.Functor.Contravariant
|
||||||
import Data.Monoid (Ap(..))
|
import Data.Monoid (Ap(..))
|
4
reddit_lib/test/MyLibTest.hs
Normal file
4
reddit_lib/test/MyLibTest.hs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module Main (main) where
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = putStrLn "Test suite not yet implemented."
|
@ -1,6 +1,6 @@
|
|||||||
{ mkDerivation, aeson, amqp, base, bytestring, containers, dhall
|
{ mkDerivation, aeson, amqp, base, bytestring, containers, dhall
|
||||||
, hedgehog, hspec, hspec-hedgehog, lens, lens-aeson, lib, mtl
|
, hedgehog, hspec, hspec-hedgehog, lens, lens-aeson, lib, mtl
|
||||||
, pipes, sqlite-simple, text, wreq
|
, pipes, reddit-lib, sqlite-simple, text, wreq
|
||||||
}:
|
}:
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
pname = "reddit-pub";
|
pname = "reddit-pub";
|
||||||
@ -8,9 +8,10 @@ mkDerivation {
|
|||||||
src = ./.;
|
src = ./.;
|
||||||
isLibrary = true;
|
isLibrary = true;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
|
enableSeparateDataOutput = true;
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
aeson amqp base bytestring containers dhall lens lens-aeson mtl
|
aeson amqp base bytestring containers dhall lens lens-aeson mtl
|
||||||
pipes sqlite-simple text wreq
|
pipes reddit-lib sqlite-simple text wreq
|
||||||
];
|
];
|
||||||
executableHaskellDepends = [ base ];
|
executableHaskellDepends = [ base ];
|
||||||
testHaskellDepends = [
|
testHaskellDepends = [
|
@ -32,7 +32,6 @@ library
|
|||||||
Data.Deriving.Aeson
|
Data.Deriving.Aeson
|
||||||
Network.Reddit
|
Network.Reddit
|
||||||
Data.SubReddit
|
Data.SubReddit
|
||||||
Publish
|
|
||||||
Membership
|
Membership
|
||||||
|
|
||||||
-- Modules included in this library but not exported.
|
-- Modules included in this library but not exported.
|
||||||
@ -53,6 +52,7 @@ library
|
|||||||
, pipes
|
, pipes
|
||||||
, containers
|
, containers
|
||||||
, sqlite-simple
|
, sqlite-simple
|
||||||
|
, reddit-lib
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
@ -43,7 +43,7 @@ import Network.AMQP
|
|||||||
)
|
)
|
||||||
import Network.Reddit (RedditId(RedditId), publishEntries)
|
import Network.Reddit (RedditId(RedditId), publishEntries)
|
||||||
import Network.Wreq.Session (newSession)
|
import Network.Wreq.Session (newSession)
|
||||||
import Publish (Publish(..))
|
import Reddit.Publish (Publish(..))
|
||||||
import Text.Printf (printf)
|
import Text.Printf (printf)
|
||||||
import Data.ByteString.Lazy (ByteString)
|
import Data.ByteString.Lazy (ByteString)
|
||||||
|
|
@ -14,7 +14,7 @@ import Network.Wreq hiding (getWith)
|
|||||||
import Network.Wreq.Session (Session, getWith)
|
import Network.Wreq.Session (Session, getWith)
|
||||||
import Pipes (Producer, (>->), for, runEffect)
|
import Pipes (Producer, (>->), for, runEffect)
|
||||||
import qualified Pipes.Prelude as P
|
import qualified Pipes.Prelude as P
|
||||||
import Publish
|
import Reddit.Publish
|
||||||
import Data.Maybe (maybeToList)
|
import Data.Maybe (maybeToList)
|
||||||
import Control.Monad.Trans (liftIO)
|
import Control.Monad.Trans (liftIO)
|
||||||
import Database.SQLite.Simple.ToField (ToField)
|
import Database.SQLite.Simple.ToField (ToField)
|
0
reddit_pub/src/RedditPub/Publisher.hs
Normal file
0
reddit_pub/src/RedditPub/Publisher.hs
Normal file
Loading…
Reference in New Issue
Block a user