From 6b1cb5ca7a36dfbd436b539b0d7b4d5b0d01bd74 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Wed, 1 Apr 2015 09:40:50 -0700 Subject: [PATCH] Skip projects that were not cloned --- makefile.shade | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/makefile.shade b/makefile.shade index 6c32f8ea6f..3cf4d07941 100644 --- a/makefile.shade +++ b/makefile.shade @@ -203,16 +203,29 @@ var buildTarget = "compile" #only-compile target='compile' @{ var failed = new Dictionary(); + var skipped = new List(); + foreach(var repo in repos) { + var blockName = string.Format("Building {0}", repo); + if (IsTeamCity) + { + Log.Info(string.Format("##teamcity[blockOpened name='{0}']", FormatForTeamCity(blockName))); + } try { - var blockName = string.Format("Building {0}", repo); - if (IsTeamCity) - { - Log.Info(string.Format("##teamcity[blockOpened name='{0}']", FormatForTeamCity(blockName))); - } Log.Info(blockName); + + if (SKIP_NO_CREDENTIALS) + { + if (!Directory.Exists(repo)) + { + // The directory was not cloned because the credentials were not specified so don't try to build it + skipped.Add(repo); + Log.Warn(string.Format("The repo {0} does not exist locally and it will not be built.", repo)); + continue; + } + } if (IsMono) { @@ -222,18 +235,21 @@ var buildTarget = "compile" { Exec("build.cmd", buildTarget, repo); } + Log.Info(string.Format("Build {0} succeeded", repo)); - - if (IsTeamCity) - { - Log.Info(string.Format("##teamcity[blockClosed name='{0}']", FormatForTeamCity(blockName))); - } } catch(Exception ex) { Log.Warn(string.Format("Build {0} failed: {1}", repo, ex.Message)); failed[repo] = ex; } + finally + { + if (IsTeamCity) + { + Log.Info(string.Format("##teamcity[blockClosed name='{0}']", FormatForTeamCity(blockName))); + } + } } foreach(var repo in repos) @@ -250,6 +266,10 @@ var buildTarget = "compile" } } + else if (skipped.Contains(repo)) + { + Log.Warn(string.Format("Build {0} skipped", repo)); + } else { Log.Info(string.Format("Build {0} succeeded", repo));