diff options
Diffstat (limited to 'Biz/Bild.hs')
-rw-r--r-- | Biz/Bild.hs | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 3334952..35ba7f0 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -139,7 +139,7 @@ type Dep = String type Out = String -data Compiler = Ghc | Ghcjs | Nix +data Compiler = Ghc | Ghcjs | Guile | Nix deriving (Show) data Target = Target @@ -186,7 +186,7 @@ analyze s = do ".nix" -> return Target - { namespace = s, + { namespace = reps root "" path |> List.stripPrefix "/" |> require "namespace", path = path, deps = [], compiler = Nix, @@ -200,10 +200,20 @@ analyze s = do "/.ssh/id_rsa" ] } + ".scm" -> + return + Target + { namespace = reps root "" path |> List.stripPrefix "/" |> require "namespace", + path = path, + deps = [], + compiler = Guile, + out = "", + builder = user <> "@localhost" + } e -> panic <| "bild does not know this extension: " <> Text.pack e build :: Target -> IO () -build Target {..} = do +build target@Target {..} = do root <- Env.getEnv "BIZ_ROOT" case compiler of Ghc -> do @@ -246,18 +256,24 @@ build Target {..} = do "-o", outDir </> out ] + Guile -> do + putText <| "bild: dev: guile: " <> Text.pack namespace + let outDir = root </> "_/bild/dev/bin" + Dir.createDirectoryIfMissing True outDir + putText <| "bild: dev: local: " <> Text.pack builder + putText "bild: guile TODO" + putText <| show target Nix -> do putText <| "bild: nix: " <> Text.pack namespace cwd <- Dir.getCurrentDirectory let outDir = root </> "_/bild/nix" Dir.createDirectoryIfMissing True outDir - let qualifiedTarget = reps root "" cwd </> namespace putText <| "bild: nix: remote: " <> Text.pack builder Process.callProcess "nix-build" [ path, "-o", - outDir </> qualifiedTarget, + outDir </> namespace, -- Set default arguments to nix functions "--arg", "bild", |