From a8516ec538cc2bc728ddb4e00953a6a0b6193525 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 29 Mar 2016 11:48:29 -0700 Subject: [PATCH] Add variable to control parallel compilation --- makefile.shade | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/makefile.shade b/makefile.shade index de4df662ad..f2692b78d7 100644 --- a/makefile.shade +++ b/makefile.shade @@ -150,9 +150,10 @@ var buildTarget = "compile" var commits = new ConcurrentDictionary(); + var threads = int.Parse(Environment.GetEnvironmentVariable("UNIVERSE_THREADS") ?? "4"); foreach (var batch in batchedRepos) { - Parallel.ForEach(batch.ToArray(), new ParallelOptions { MaxDegreeOfParallelism = 4 }, repo => + Parallel.ForEach(batch.ToArray(), new ParallelOptions { MaxDegreeOfParallelism = threads }, repo => { var blockName = string.Format("Building {0}", repo); @@ -170,7 +171,16 @@ var buildTarget = "compile" CopyFolder(".build", Path.Combine(repo, ".build"), true); } - Exec(CreateBuildWithFlowId(repo), buildTarget, repo); + try + { + Exec(CreateBuildWithFlowId(repo), buildTarget, repo); + } + catch (Exception ex) + { + Log.Error("Building '" + repo + "' failed: " + ex); + throw; + } + var repoArtifacts = Path.Combine(repo, "artifacts"); var repoBuild = Path.Combine(repoArtifacts, "build"); if (Directory.Exists(repoBuild))