97 lines
2.6 KiB
Plaintext
97 lines
2.6 KiB
Plaintext
|
|
var PROJECT='AspNet'
|
|
var VERSION='0.1.0'
|
|
|
|
use namespace='System'
|
|
use namespace='System.IO'
|
|
use namespace='System.Collections.Generic'
|
|
|
|
var repos='${new Dictionary<string,string> {
|
|
{"HttpAbstractions", "git@github.com:aspnet/HttpAbstractions.git"},
|
|
{"DependencyInjection", "git@github.com:aspnet/DependencyInjection.git"},
|
|
{"FileSystem", "git@github.com:aspnet/FileSystem.git"},
|
|
{"Logging", "git@github.com:aspnet/Logging.git"},
|
|
{"Data", "git@github.com:aspnet/Data.git"},
|
|
{"Razor", "git@github.com:aspnet/Razor.git"},
|
|
{"Mvc", "git@github.com:aspnet/Mvc.git"},
|
|
}}'
|
|
|
|
default BASE_DIR='${Directory.GetCurrentDirectory()}'
|
|
default TARGET_DIR='${Path.Combine(BASE_DIR, "artifacts")}'
|
|
|
|
#default .compile
|
|
|
|
#pull
|
|
#compile .pull
|
|
#install .pull
|
|
|
|
#pack
|
|
directory create='${TARGET_DIR}'
|
|
nuget-pack nuspecFile='${Path.Combine(BASE_DIR, "KoreBuild.nuspec")}' packageVersion='${VERSION}' outputDir='${TARGET_DIR}'
|
|
|
|
#pack-install .pack
|
|
nuget-local-publish sourcePackagesDir='${TARGET_DIR}'
|
|
|
|
#git-pull target='pull'
|
|
@{
|
|
foreach(var repo in repos)
|
|
{
|
|
if(Directory.Exists(repo.Key))
|
|
{
|
|
GitPull(repo.Value, "dev", repo.Key);
|
|
}
|
|
else
|
|
{
|
|
GitClone(repo.Value, "dev");
|
|
}
|
|
}
|
|
}
|
|
|
|
#only-compile target='compile'
|
|
@{
|
|
var failed = new Dictionary<string,Exception>();
|
|
foreach(var repo in repos)
|
|
{
|
|
try
|
|
{
|
|
Log.Info(string.Format("Building {0}", repo.Key));
|
|
Exec("build.cmd", "compile", repo.Key);
|
|
Log.Info(string.Format("Build {0} succeeded", repo.Key));
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
Log.Warn(string.Format("Build {0} failed: {1}", repo.Key, ex.Message));
|
|
failed[repo.Key] = ex;
|
|
}
|
|
}
|
|
foreach(var repo in repos)
|
|
{
|
|
Exception ex;
|
|
if (failed.TryGetValue(repo.Key, out ex))
|
|
{
|
|
Log.Warn(string.Format("Build {0} failed: {1}", repo.Key, ex.Message));
|
|
}
|
|
else
|
|
{
|
|
Log.Info(string.Format("Build {0} succeeded", repo.Key));
|
|
}
|
|
}
|
|
}
|
|
|
|
#only-install target='install'
|
|
@{
|
|
foreach(var repo in repos)
|
|
{
|
|
Exec("build.cmd", "install", repo.Key);
|
|
}
|
|
}
|
|
|
|
macro name='GitPull' gitUri='string' gitBranch='string' gitFolder='string'
|
|
git-pull
|
|
|
|
macro name='GitClone' gitUri='string' gitBranch='string'
|
|
git-clone
|
|
|
|
macro name='Exec' program='string' commandline='string' workingdir='string'
|
|
exec
|