Updating makefile to remove duplication in repo name usage
This commit is contained in:
parent
c27ba5f00f
commit
04b29ed629
108
makefile.shade
108
makefile.shade
|
|
@ -14,34 +14,33 @@ default TARGET_DIR='${Path.Combine(BASE_DIR, "artifacts", "build")}'
|
||||||
|
|
||||||
var useHttps='${UseHttps(BASE_DIR)}'
|
var useHttps='${UseHttps(BASE_DIR)}'
|
||||||
var gitHubUriPrefix='${useHttps ? "https://github.com/aspnet/" : "git@github.com:aspnet/"}'
|
var gitHubUriPrefix='${useHttps ? "https://github.com/aspnet/" : "git@github.com:aspnet/"}'
|
||||||
var repos='${new Dictionary<string,string> {
|
var repos='${new[] {
|
||||||
/* {"KRuntime", gitHubUriPrefix + "KRuntime.git"}, */ // Let's not build the sdk :)
|
"Configuration",
|
||||||
{"Configuration", gitHubUriPrefix + "Configuration.git"},
|
"DataCommon",
|
||||||
{"DataCommon", gitHubUriPrefix + "DataCommon.git"},
|
"DataCommon.SQLite",
|
||||||
{"DataCommon.SQLite", gitHubUriPrefix + "DataCommon.SQLite.git"},
|
"DataProtection",
|
||||||
{"DataProtection", gitHubUriPrefix + "DataProtection.git"},
|
"DependencyInjection",
|
||||||
{"DependencyInjection", gitHubUriPrefix + "DependencyInjection.git"},
|
"Diagnostics",
|
||||||
{"Options", gitHubUriPrefix + "Options.git"},
|
"EntityFramework",
|
||||||
{"Logging", gitHubUriPrefix + "Logging.git"},
|
"Entropy",
|
||||||
{"Testing", gitHubUriPrefix + "Testing.git"},
|
"FileSystem",
|
||||||
{"Diagnostics", gitHubUriPrefix + "Diagnostics.git"},
|
"Helios",
|
||||||
{"EntityFramework", gitHubUriPrefix + "EntityFramework.git"},
|
"Hosting",
|
||||||
{"FileSystem", gitHubUriPrefix + "FileSystem.git"},
|
"HttpAbstractions",
|
||||||
{"WebSocketAbstractions", gitHubUriPrefix + "WebSocketAbstractions.git"},
|
"Identity",
|
||||||
{"HttpAbstractions", gitHubUriPrefix + "HttpAbstractions.git"},
|
"KestrelHttpServer",
|
||||||
{"Hosting", gitHubUriPrefix + "Hosting.git"},
|
"Logging",
|
||||||
{"Helios", gitHubUriPrefix + "Helios.git"},
|
"Mvc",
|
||||||
{"Identity", gitHubUriPrefix + "Identity.git"},
|
"Options",
|
||||||
{"Razor", gitHubUriPrefix + "Razor.git"},
|
"Razor",
|
||||||
{"Routing", gitHubUriPrefix + "Routing.git"},
|
"Routing",
|
||||||
{"Mvc", gitHubUriPrefix + "Mvc.git"},
|
"Security",
|
||||||
{"Security", gitHubUriPrefix + "Security.git"},
|
"SignalR-Server",
|
||||||
{"SignalR-Server", gitHubUriPrefix + "SignalR-Server.git"},
|
"StaticFiles",
|
||||||
{"StaticFiles", gitHubUriPrefix + "StaticFiles.git"},
|
"Testing",
|
||||||
{"WebListener", gitHubUriPrefix + "WebListener.git"},
|
"WebListener",
|
||||||
{"KestrelHttpServer", gitHubUriPrefix + "KestrelHttpServer.git"},
|
"WebSocketAbstractions",
|
||||||
{"WebSockets", gitHubUriPrefix + "WebSockets.git"},
|
"WebSockets"
|
||||||
{"Entropy", gitHubUriPrefix + "Entropy.git"},
|
|
||||||
}}'
|
}}'
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
|
@ -73,31 +72,32 @@ var repos='${new Dictionary<string,string> {
|
||||||
@{
|
@{
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repos)
|
||||||
{
|
{
|
||||||
if(Directory.Exists(repo.Key))
|
var repoUrl = gitHubUriPrefix + repo + ".git";
|
||||||
|
if(Directory.Exists(repo))
|
||||||
{
|
{
|
||||||
GitPull(repo.Value, "dev", repo.Key);
|
GitPull(repoUrl, "dev", repo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsHttpsUrl(repo.Value) &&
|
if (useHttps &&
|
||||||
!IsAccessible(repo.Key))
|
!IsAccessible(repo))
|
||||||
{
|
{
|
||||||
Log.Warn(string.Format("The repo at '{0}' is not accessible. If you do not have access to this repository, skip the git prompt" +
|
Log.Warn(string.Format("The repo at '{0}' is not accessible. If you do not have access to this repository, skip the git prompt" +
|
||||||
" for credentials to skip cloning this repository. To avoid this prompt, re-clone the Universe repository over ssh.",
|
" for credentials to skip cloning this repository. To avoid this prompt, re-clone the Universe repository over ssh.",
|
||||||
repo.Value));
|
repoUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GitClone(repo.Value, "dev");
|
GitClone(repoUrl, "dev");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Warn(string.Format("Unable to clone repository at '{0}': {1}", repo.Value, ex.Message));
|
Log.Warn(string.Format("Unable to clone repository at '{0}': {1}", repoUrl, ex.Message));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
GitConfig("bugtraq.url", "http://github.com/aspnet/" + repo.Key + "/issues/%BUGID%", repo.Key);
|
GitConfig("bugtraq.url", "http://github.com/aspnet/" + repo + "/issues/%BUGID%", repo);
|
||||||
GitConfig("bugtraq.logregex", @"#(\d+)", repo.Key);
|
GitConfig("bugtraq.logregex", @"#(\d+)", repo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -111,7 +111,7 @@ var repos='${new Dictionary<string,string> {
|
||||||
{
|
{
|
||||||
foreach (string fileName in templateFiles)
|
foreach (string fileName in templateFiles)
|
||||||
{
|
{
|
||||||
var targetFile = Path.Combine(Directory.GetCurrentDirectory(), repo.Key, fileName);
|
var targetFile = Path.Combine(Directory.GetCurrentDirectory(), repo, fileName);
|
||||||
var sourceFile = Path.Combine(Directory.GetCurrentDirectory(), templatePath, fileName);
|
var sourceFile = Path.Combine(Directory.GetCurrentDirectory(), templatePath, fileName);
|
||||||
|
|
||||||
// Don't update the makefile
|
// Don't update the makefile
|
||||||
|
|
@ -123,7 +123,7 @@ var repos='${new Dictionary<string,string> {
|
||||||
if(!File.Exists(sourceFile) ||
|
if(!File.Exists(sourceFile) ||
|
||||||
(File.ReadAllText(sourceFile) != File.ReadAllText(targetFile)))
|
(File.ReadAllText(sourceFile) != File.ReadAllText(targetFile)))
|
||||||
{
|
{
|
||||||
Log.Info("Updating " + fileName + " to " + repo.Key);
|
Log.Info("Updating " + fileName + " to " + repo);
|
||||||
File.Copy(sourceFile, targetFile, true);
|
File.Copy(sourceFile, targetFile, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -134,9 +134,9 @@ var repos='${new Dictionary<string,string> {
|
||||||
var templatePath = '${Path.Combine(BASE_DIR, "build-template")}'
|
var templatePath = '${Path.Combine(BASE_DIR, "build-template")}'
|
||||||
var fileName = 'NuGet.Config'
|
var fileName = 'NuGet.Config'
|
||||||
for each='var repo in repos'
|
for each='var repo in repos'
|
||||||
var targetFile = '${Path.Combine(Directory.GetCurrentDirectory(), repo.Key, fileName)}'
|
var targetFile = '${Path.Combine(Directory.GetCurrentDirectory(), repo, fileName)}'
|
||||||
var sourceFile = '${Path.Combine(Directory.GetCurrentDirectory(), templatePath, fileName)}'
|
var sourceFile = '${Path.Combine(Directory.GetCurrentDirectory(), templatePath, fileName)}'
|
||||||
var gitFolder = '${repo.Key}'
|
var gitFolder = '${repo}'
|
||||||
|
|
||||||
-// get latest dev and create new release
|
-// get latest dev and create new release
|
||||||
git gitCommand='checkout dev'
|
git gitCommand='checkout dev'
|
||||||
|
|
@ -164,33 +164,33 @@ var repos='${new Dictionary<string,string> {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Info(string.Format("Building {0}", repo.Key));
|
Log.Info(string.Format("Building {0}", repo));
|
||||||
if (IsMono)
|
if (IsMono)
|
||||||
{
|
{
|
||||||
Exec("build.sh", "compile", repo.Key);
|
Exec("build.sh", "compile", repo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Exec("build.cmd", "compile", repo.Key);
|
Exec("build.cmd", "compile", repo);
|
||||||
}
|
}
|
||||||
Log.Info(string.Format("Build {0} succeeded", repo.Key));
|
Log.Info(string.Format("Build {0} succeeded", repo));
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
Log.Warn(string.Format("Build {0} failed: {1}", repo.Key, ex.Message));
|
Log.Warn(string.Format("Build {0} failed: {1}", repo, ex.Message));
|
||||||
failed[repo.Key] = ex;
|
failed[repo] = ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repos)
|
||||||
{
|
{
|
||||||
Exception ex;
|
Exception ex;
|
||||||
if (failed.TryGetValue(repo.Key, out ex))
|
if (failed.TryGetValue(repo, out ex))
|
||||||
{
|
{
|
||||||
Log.Warn(string.Format("Build {0} failed: {1}", repo.Key, ex.Message));
|
Log.Warn(string.Format("Build {0} failed: {1}", repo, ex.Message));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log.Info(string.Format("Build {0} succeeded", repo.Key));
|
Log.Info(string.Format("Build {0} succeeded", repo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -201,11 +201,11 @@ var repos='${new Dictionary<string,string> {
|
||||||
{
|
{
|
||||||
if (IsMono)
|
if (IsMono)
|
||||||
{
|
{
|
||||||
Exec("build.sh", "install", repo.Key);
|
Exec("build.sh", "install", repo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Exec("build.cmd", "install", repo.Key);
|
Exec("build.cmd", "install", repo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +223,7 @@ var repos='${new Dictionary<string,string> {
|
||||||
@{
|
@{
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repos)
|
||||||
{
|
{
|
||||||
GitStatus(repo.Key);
|
GitStatus(repo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -238,7 +238,7 @@ var repos='${new Dictionary<string,string> {
|
||||||
}
|
}
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repos)
|
||||||
{
|
{
|
||||||
GitClean(repo.Key);
|
GitClean(repo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue