Add the ability to specify what repos to include/exclude while building
This commit is contained in:
parent
ed9b0f59b5
commit
ef4a0a3ebb
122
makefile.shade
122
makefile.shade
|
|
@ -18,48 +18,10 @@ functions
|
||||||
static string BASE_DIR = Directory.GetCurrentDirectory();
|
static string BASE_DIR = Directory.GetCurrentDirectory();
|
||||||
static string TARGET_DIR = Path.Combine(BASE_DIR, "artifacts", "build");
|
static string TARGET_DIR = Path.Combine(BASE_DIR, "artifacts", "build");
|
||||||
static bool SKIP_NO_CREDENTIALS = Environment.GetEnvironmentVariable("UNIVERSE_SKIP_NO_CREDENTIALS") == "1";
|
static bool SKIP_NO_CREDENTIALS = Environment.GetEnvironmentVariable("UNIVERSE_SKIP_NO_CREDENTIALS") == "1";
|
||||||
string[] repos = new[] {
|
|
||||||
// The repos list is topologically sorted based on build order
|
|
||||||
"Common",
|
|
||||||
"Configuration",
|
|
||||||
"Caching",
|
|
||||||
"DataProtection",
|
|
||||||
"DependencyInjection",
|
|
||||||
"EventNotification",
|
|
||||||
"Options",
|
|
||||||
"Logging",
|
|
||||||
"Testing",
|
|
||||||
"Diagnostics",
|
|
||||||
"Microsoft.Data.Sqlite",
|
|
||||||
"EntityFramework",
|
|
||||||
"FileSystem",
|
|
||||||
"HttpAbstractions",
|
|
||||||
"Hosting",
|
|
||||||
"Helios",
|
|
||||||
"Antiforgery",
|
|
||||||
"Identity",
|
|
||||||
"Localization",
|
|
||||||
"Razor",
|
|
||||||
"RazorTooling",
|
|
||||||
"Routing",
|
|
||||||
"Mvc",
|
|
||||||
"Scaffolding",
|
|
||||||
"Security",
|
|
||||||
"SignalR-Server",
|
|
||||||
"SignalR-SQLServer",
|
|
||||||
"SignalR-Redis",
|
|
||||||
"StaticFiles",
|
|
||||||
"WebListener",
|
|
||||||
"KestrelHttpServer",
|
|
||||||
"WebSockets",
|
|
||||||
"Session",
|
|
||||||
"UserSecrets",
|
|
||||||
"CORS",
|
|
||||||
"Entropy",
|
|
||||||
};
|
|
||||||
|
|
||||||
// Doesn't build on Mono since their contracts don't match
|
// Doesn't build on Mono since their contracts don't match
|
||||||
string[] excludeReposOnMono = new[] { "Helios" };
|
string[] excludeReposOnMono = new[] { "Helios" };
|
||||||
|
IEnumerable<string> repositories = GetRepositoriesToBuild();
|
||||||
|
|
||||||
static bool useHttps = UseHttps(BASE_DIR);
|
static bool useHttps = UseHttps(BASE_DIR);
|
||||||
static string gitHubUriPrefix = useHttps ? "https://github.com/aspnet/" : "git@github.com:aspnet/";
|
static string gitHubUriPrefix = useHttps ? "https://github.com/aspnet/" : "git@github.com:aspnet/";
|
||||||
|
|
@ -68,7 +30,7 @@ functions
|
||||||
var buildTarget = "compile"
|
var buildTarget = "compile"
|
||||||
|
|
||||||
@{
|
@{
|
||||||
var kBuildVersion = Environment.GetEnvironmentVariable("DNX_BUILD_VERSION");
|
var kBuildVersion = Environment.GetEnvironmentVariable("DNX_BUILD_VERSION");
|
||||||
if (!string.IsNullOrEmpty(kBuildVersion))
|
if (!string.IsNullOrEmpty(kBuildVersion))
|
||||||
{
|
{
|
||||||
VERSION += "-" + kBuildVersion;
|
VERSION += "-" + kBuildVersion;
|
||||||
|
|
@ -94,7 +56,7 @@ var buildTarget = "compile"
|
||||||
|
|
||||||
#git-pull target='pull'
|
#git-pull target='pull'
|
||||||
@{
|
@{
|
||||||
Parallel.ForEach(repos, repo =>
|
Parallel.ForEach(repositories, repo =>
|
||||||
{
|
{
|
||||||
CloneOrUpdate(repo);
|
CloneOrUpdate(repo);
|
||||||
});
|
});
|
||||||
|
|
@ -106,10 +68,10 @@ var buildTarget = "compile"
|
||||||
|
|
||||||
#fix-project-json
|
#fix-project-json
|
||||||
@{
|
@{
|
||||||
repos = repos.Except(excludeReposOnMono).ToArray();
|
repositories = repositories.Except(excludeReposOnMono).ToArray();
|
||||||
}
|
}
|
||||||
-// Fix project.json to remove .Net portable references
|
-// Fix project.json to remove .Net portable references
|
||||||
for each='var repo in repos'
|
for each='var repo in repositories'
|
||||||
for each='var file in Files.Include(repo + "/**" + "/project.json")'
|
for each='var file in Files.Include(repo + "/**" + "/project.json")'
|
||||||
update-file updateFile='${file}'
|
update-file updateFile='${file}'
|
||||||
@{
|
@{
|
||||||
|
|
@ -127,7 +89,7 @@ var buildTarget = "compile"
|
||||||
var templatePath = Path.Combine(BASE_DIR, "build-template");
|
var templatePath = Path.Combine(BASE_DIR, "build-template");
|
||||||
var templateFiles = Files.Include(templatePath + Path.DirectorySeparatorChar + "*.*").Select(Path.GetFileName).ToList();
|
var templateFiles = Files.Include(templatePath + Path.DirectorySeparatorChar + "*.*").Select(Path.GetFileName).ToList();
|
||||||
|
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repositories)
|
||||||
{
|
{
|
||||||
foreach (string fileName in templateFiles)
|
foreach (string fileName in templateFiles)
|
||||||
{
|
{
|
||||||
|
|
@ -337,7 +299,7 @@ var buildTarget = "compile"
|
||||||
var failed = new Dictionary<string, Exception>();
|
var failed = new Dictionary<string, Exception>();
|
||||||
var skipped = new List<string>();
|
var skipped = new List<string>();
|
||||||
|
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repositories)
|
||||||
{
|
{
|
||||||
var blockName = string.Format("Building {0}", repo);
|
var blockName = string.Format("Building {0}", repo);
|
||||||
if (IsTeamCity)
|
if (IsTeamCity)
|
||||||
|
|
@ -384,7 +346,7 @@ var buildTarget = "compile"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repositories)
|
||||||
{
|
{
|
||||||
Exception ex;
|
Exception ex;
|
||||||
if (failed.TryGetValue(repo, out ex))
|
if (failed.TryGetValue(repo, out ex))
|
||||||
|
|
@ -416,7 +378,7 @@ var buildTarget = "compile"
|
||||||
|
|
||||||
#only-install target='install'
|
#only-install target='install'
|
||||||
@{
|
@{
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repositories)
|
||||||
{
|
{
|
||||||
if (IsMono)
|
if (IsMono)
|
||||||
{
|
{
|
||||||
|
|
@ -440,7 +402,7 @@ var buildTarget = "compile"
|
||||||
|
|
||||||
#git-status description='Show status of repos known by Universe'
|
#git-status description='Show status of repos known by Universe'
|
||||||
@{
|
@{
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repositories)
|
||||||
{
|
{
|
||||||
GitStatus(repo);
|
GitStatus(repo);
|
||||||
}
|
}
|
||||||
|
|
@ -455,7 +417,7 @@ var buildTarget = "compile"
|
||||||
{
|
{
|
||||||
throw new Exception("git-clean cancelled");
|
throw new Exception("git-clean cancelled");
|
||||||
}
|
}
|
||||||
foreach(var repo in repos)
|
foreach(var repo in repositories)
|
||||||
{
|
{
|
||||||
GitClean(repo);
|
GitClean(repo);
|
||||||
}
|
}
|
||||||
|
|
@ -579,7 +541,7 @@ functions
|
||||||
"dnvm",
|
"dnvm",
|
||||||
};
|
};
|
||||||
|
|
||||||
return Enumerable.Concat(nonDefaultRepos, repos);
|
return Enumerable.Concat(nonDefaultRepos, repositories);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShouldSkipCopyingNugetConfig(string repo)
|
bool ShouldSkipCopyingNugetConfig(string repo)
|
||||||
|
|
@ -699,4 +661,64 @@ functions
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static IEnumerable<string> GetRepositoriesToBuild()
|
||||||
|
{
|
||||||
|
IEnumerable<string> reposToBuild = new HashSet<string>(StringComparer.OrdinalIgnoreCase) {
|
||||||
|
// The repos list is topologically sorted based on build order
|
||||||
|
"Common",
|
||||||
|
"Configuration",
|
||||||
|
"Caching",
|
||||||
|
"DataProtection",
|
||||||
|
"DependencyInjection",
|
||||||
|
"EventNotification",
|
||||||
|
"Options",
|
||||||
|
"Logging",
|
||||||
|
"Testing",
|
||||||
|
"Diagnostics",
|
||||||
|
"Microsoft.Data.Sqlite",
|
||||||
|
"EntityFramework",
|
||||||
|
"FileSystem",
|
||||||
|
"HttpAbstractions",
|
||||||
|
"Hosting",
|
||||||
|
"Helios",
|
||||||
|
"Antiforgery",
|
||||||
|
"Identity",
|
||||||
|
"Localization",
|
||||||
|
"Razor",
|
||||||
|
"RazorTooling",
|
||||||
|
"Routing",
|
||||||
|
"Mvc",
|
||||||
|
"Scaffolding",
|
||||||
|
"Security",
|
||||||
|
"SignalR-Server",
|
||||||
|
"SignalR-SQLServer",
|
||||||
|
"SignalR-Redis",
|
||||||
|
"StaticFiles",
|
||||||
|
"WebListener",
|
||||||
|
"KestrelHttpServer",
|
||||||
|
"WebSockets",
|
||||||
|
"Session",
|
||||||
|
"UserSecrets",
|
||||||
|
"CORS",
|
||||||
|
"Entropy",
|
||||||
|
};
|
||||||
|
|
||||||
|
var repositoryInclude = Environment.GetEnvironmentVariable("KOREBUILD_REPOSITORY_INCLUDE");
|
||||||
|
if (!string.IsNullOrEmpty(repositoryInclude))
|
||||||
|
{
|
||||||
|
reposToBuild = new HashSet<string>(
|
||||||
|
repositoryInclude.Split(new string[] {","}, StringSplitOptions.RemoveEmptyEntries),
|
||||||
|
StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
var repositoryExclude = Environment.GetEnvironmentVariable("KOREBUILD_REPOSITORY_EXCLUDE");
|
||||||
|
if (!string.IsNullOrEmpty(repositoryExclude))
|
||||||
|
{
|
||||||
|
var reposToExclude = repositoryExclude.Split(new string[] {","}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
reposToBuild = reposToBuild.Except(reposToExclude);
|
||||||
|
}
|
||||||
|
|
||||||
|
return reposToBuild.ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue