aspnetcore/makefile.shade

49 lines
2.2 KiB
Plaintext

use namespace="System.IO"
default BASE_DIR_LOCAL='${Directory.GetCurrentDirectory()}'
default BUILD_DIR_LOCAL='${Path.Combine(BASE_DIR_LOCAL, "artifacts", "build")}'
var VERSION='0.1'
var FULL_VERSION='0.1'
var AUTHORS='Microsoft Open Technologies, Inc.'
-BuildQuality = "preview4";
use-standard-lifecycle
k-standard-goals
#xunit-test
@{
foreach (var project in Files.Include("test/*/project.json"))
{
var projectDir = Path.GetDirectoryName(project);
var projectName = Path.GetFileName(projectDir);
var targetDir = Path.Combine(projectDir, "bin", E("Configuration"), "netcoreapp1.0");
var depsFile = Path.Combine(targetDir, projectName + ".deps.json");
var configFile = Path.Combine(targetDir, projectName + ".runtimeconfig.json");
var assembly = Path.Combine(targetDir, projectName + ".dll");
var home = Environment.GetEnvironmentVariable("USERPROFILE") ?? Environment.GetEnvironmentVariable("HOME");
var packageCache = Environment.GetEnvironmentVariable("NUGET_PACKAGES") ?? Path.Combine(home, ".nuget/packages");
Exec(".build/.dotnet/dotnet", "exec --depsfile \"" + depsFile + "\""
+ " --runtimeconfig \"" + configFile + "\" "
+ "\"" + Path.Combine(packageCache, "dotnet-test-xunit/2.2.0-preview2-build1029/lib/netcoreapp1.0/dotnet-test-xunit.dll") + "\" "
+ "\"" + assembly+ "\" ");
}
}
#build-pack .build-compile target='compile'
@{
if (Directory.Exists("src") && !IsLinux)
{
Directory.CreateDirectory(BUILD_DIR_LOCAL);
Dotnet("run -p tools/NuGetPackager -- -c " + E("Configuration") +
" -o artifacts/build/ "+
"-n src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.nuspec " +
"-n src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.nuspec " +
"-n src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.nuspec ");
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR_LOCAL, "*/" + E("Configuration") + "/*.nupkg")))
{
File.Copy(nupkg, Path.Combine(BUILD_DIR_LOCAL, Path.GetFileName(nupkg)), true);
}
}
}