Skip projects that were not cloned
This commit is contained in:
parent
c354f0a8ba
commit
6b1cb5ca7a
|
|
@ -203,16 +203,29 @@ var buildTarget = "compile"
|
|||
#only-compile target='compile'
|
||||
@{
|
||||
var failed = new Dictionary<string, Exception>();
|
||||
var skipped = new List<string>();
|
||||
|
||||
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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue