diff options
Diffstat (limited to 'Omni/Bild.hs')
| -rw-r--r-- | Omni/Bild.hs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Omni/Bild.hs b/Omni/Bild.hs index 15e359f..4bb62a5 100644 --- a/Omni/Bild.hs +++ b/Omni/Bild.hs @@ -555,11 +555,11 @@ analyzeAll :: [Namespace] -> IO Analysis analyzeAll nss = do LogC.withLineManager nss <| \lineMgr -> do LogC.initializeLines lineMgr - targets <- mapConcurrentlyBounded 8 (analyzeOne lineMgr) nss + targets <- mapConcurrentlyBounded 8 analyzeOne nss pure <| Map.fromList <| catMaybes <| zipWith (\ns mt -> (ns,) </ mt) nss targets where - analyzeOne :: LogC.LineManager -> Namespace -> IO (Maybe Target) - analyzeOne _lineMgr namespace@(Namespace parts ext) = do + analyzeOne :: Namespace -> IO (Maybe Target) + analyzeOne namespace@(Namespace parts ext) = do let path = Namespace.toPath namespace root <- Env.getEnv "CODEROOT" let abspath = root </> path @@ -1147,10 +1147,18 @@ build andTest loud jobs cpus analysis = do root <- Env.getEnv "CODEROOT" let targets = Map.elems analysis let namespaces = map (\Target {..} -> namespace) targets - LogC.withLineManager namespaces <| \lineMgr -> do - LogC.initializeLines lineMgr - results <- mapConcurrentlyBounded jobs (buildTarget root) targets - pure (map fst results) + -- Use adaptive concurrent UI unless --loud is set + if loud + then do + -- Loud mode: simple output, no concurrent UI + results <- mapConcurrentlyBounded jobs (buildTarget root) targets + pure (map fst results) + else -- Adaptive UI based on terminal width + + LogC.withLineManager namespaces <| \lineMgr -> do + LogC.initializeLines lineMgr + results <- mapConcurrentlyBounded jobs (buildTarget root) targets + pure (map fst results) where buildTarget :: FilePath -> Target -> IO (Exit.ExitCode, ByteString) buildTarget root target@Target {..} = do |
