Skip to content

Commit 3acc5f0

Browse files
committed
Rewrite Makefile and allow building task-runner
1 parent d182958 commit 3acc5f0

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif
2727
$(target_dir):
2828
mkdir $@
2929

30-
$(exe): $(shell find . unison -type f -name '*.hs') package.yaml stack.yaml
30+
$(exe): $(shell find . unison -type f -name '*.hs') $(shell find . unison -type f -name '*.yaml')
3131
@echo $(exe)
3232
@echo $@
3333
stack build $(STACK_FLAGS) share-api:share-api

share-task-runner/app/Main.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
module Main where
22

3+
import Share.Env (withEnv)
4+
import Share.BackgroundJobs.Monad
5+
import UnliftIO
6+
37
main :: IO ()
48
main = do
9+
withEnv \env -> runBackground env "share-task-runner" task
10+
11+
task :: Background ()
12+
task = do
13+
liftIO $ putStrLn "Hello from the task runner!"
514
pure ()

share-task-runner/package.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ ghc-options:
3434

3535
dependencies:
3636
- base >= 4.7 && < 5
37+
- share-api
38+
- unliftio
3739

3840
default-extensions:
3941
- ApplicativeDo

share-task-runner/share-task-runner.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ library
5757
ghc-options: -Wall -Werror -Wname-shadowing -Wno-type-defaults -Wno-missing-pattern-synonym-signatures -Wincomplete-uni-patterns -Widentities -Wredundant-constraints -Wpartial-fields -fprint-expanded-synonyms -fwrite-ide-info -O2 -funbox-strict-fields
5858
build-depends:
5959
base >=4.7 && <5
60+
, share-api
61+
, unliftio
6062
default-language: Haskell2010
6163

6264
executable share-task-runner
@@ -97,5 +99,7 @@ executable share-task-runner
9799
ghc-options: -Wall -Werror -Wname-shadowing -Wno-type-defaults -Wno-missing-pattern-synonym-signatures -Wincomplete-uni-patterns -Widentities -Wredundant-constraints -Wpartial-fields -fprint-expanded-synonyms -fwrite-ide-info -O2 -funbox-strict-fields -threaded -rtsopts "-with-rtsopts=-N -A32m -qn2 -T"
98100
build-depends:
99101
base >=4.7 && <5
102+
, share-api
100103
, share-task-runner
104+
, unliftio
101105
default-language: Haskell2010

0 commit comments

Comments
 (0)