Add deployment-package target
This commit is contained in:
@@ -5,6 +5,31 @@ internal static class Build
|
|||||||
{
|
{
|
||||||
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
|
public static int Main(string[] args) => BuildRunner.Execute(args, build =>
|
||||||
{
|
{
|
||||||
build.AddDotNetTargets();
|
var artifactDirOption = build.AddOption("--artifact-dir <directory>", "Artifact directory", defaultValue: "artifacts");
|
||||||
|
|
||||||
|
var dotNetSettings = new DotNetBuildSettings();
|
||||||
|
|
||||||
|
build.AddDotNetTargets(dotNetSettings);
|
||||||
|
|
||||||
|
build.Target("deployment-package")
|
||||||
|
.DependsOn("test")
|
||||||
|
.Describe("Creates the deployment package")
|
||||||
|
.Does(() =>
|
||||||
|
{
|
||||||
|
var projectPath = Path.Combine("src", "Twain.Web", "Twain.Web.csproj");
|
||||||
|
|
||||||
|
DeleteDirectory(artifactDirOption.Value);
|
||||||
|
|
||||||
|
RunDotNet(new[]
|
||||||
|
{
|
||||||
|
"publish", projectPath,
|
||||||
|
"-c", dotNetSettings.GetConfiguration(),
|
||||||
|
"-o", artifactDirOption.Value,
|
||||||
|
dotNetSettings.GetPlatformArg(),
|
||||||
|
"--no-build",
|
||||||
|
dotNetSettings.GetVerbosityArg(),
|
||||||
|
dotNetSettings.GetMaxCpuCountArg()
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user