From 317f1e27688a082926f39ec897f5a38d01a07ce7 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 19 Feb 2021 12:26:19 +0100 Subject: Rebuild --- Main.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index b696241..463a33b 100644 --- a/Main.hs +++ b/Main.hs @@ -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 -- cgit v1.2.3-70-g09d2