39 lines
1012 B
Plaintext
39 lines
1012 B
Plaintext
@{/*
|
|
|
|
dotnet-publish
|
|
Builds package from project.
|
|
|
|
projectFile=''
|
|
Required. Path to the project.json to build.
|
|
|
|
outputFolder=''
|
|
Optional. The output folder.
|
|
|
|
configuration=''
|
|
Optional. The configuration to build in. Defaults to 'Debug'.
|
|
|
|
framework=''
|
|
Optional. The framework to publish
|
|
*/}
|
|
|
|
default configuration = 'Debug'
|
|
|
|
@{
|
|
var projectFolder=Path.GetDirectoryName(projectFile);
|
|
var projectName=Path.GetFileName(projectFolder);
|
|
var projectBin=Path.Combine(projectFolder, "bin", configuration);
|
|
|
|
var outputArg = string.IsNullOrEmpty(outputFolder) ? "" : "--output " + outputFolder;
|
|
var frameworkArg = "";
|
|
if (!string.IsNullOrEmpty(framework))
|
|
{
|
|
frameworkArg = "--framework " + framework;
|
|
projectBin = Path.Combine(projectBin, framework);
|
|
}
|
|
|
|
DeleteFolder(projectBin);
|
|
|
|
var dotnetArgs = string.Format("publish --configuration {0} {1} {2} {3}", configuration, frameworkArg, outputArg, projectFolder);
|
|
Dotnet(dotnetArgs);
|
|
}
|
|
|