diff options
author | Tom Smeding <tom@tomsmeding.com> | 2021-02-19 12:26:19 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2021-02-19 12:26:19 +0100 |
commit | 317f1e27688a082926f39ec897f5a38d01a07ce7 (patch) | |
tree | 19417d35e7b2a606fb9a831e7ad505113ba7d696 /Main.hs | |
parent | 08f53feceb1edb10f8b3a816021fb580b27e5b4c (diff) |
Rebuild
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -88,6 +88,14 @@ doBuild (BuildOptions mtarget) = do old <- targetCheckOld rootdir tg when old $ targetBuild rootdir tg +doRebuild :: BuildOptions -> IO () +doRebuild (BuildOptions mtarget) = do + (rootdir, targets, targetsForName) <- readCachedTargets (const True) + toBuild <- maybe (return targets) (targetsToBuild targetsForName) mtarget + forM_ toBuild $ useAnyTarget $ \tg -> do + targetRemoveBuildArtifacts rootdir tg + targetBuild rootdir tg + doRun :: RunOptions -> IO () doRun (RunOptions mtarget args) = do (rootdir, targets, targetsForName) <- readCachedTargets (isJust . useAnyTarget targetExecute) @@ -110,4 +118,5 @@ main = do Configure -> doConfigure Clean -> doClean Build opts -> doBuild opts + Rebuild opts -> doRebuild opts Run opts -> doRun opts |