Add build task to create dotnet tools for SQL Tools and Kusto services. (#1582)

This commit is contained in:
Cory Rivera
2022-07-18 12:49:21 -07:00
committed by GitHub
parent 1bcb0c211e
commit 8f9e3fe999
5 changed files with 28 additions and 2 deletions

View File

@@ -108,7 +108,14 @@ steps:
inputs:
filename: build.cmd
arguments: '-target=dotnetpackpublished -mono'
continueOnError: true
- task: BatchScript@1
displayName: "Build and Package service tool projects"
env:
BUILD_DOTNET_TOOL: "true"
inputs:
filename: build.cmd
arguments: "-target=dotnetpackservicetools -mono"
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP Code Signing - Nuget Package'

View File

@@ -52,6 +52,7 @@ public class BuildPlan
public string[] PackageProjects { get; set; }
// The set of projects that we want to call dotnet pack on which require publishing being done first
public string[] PackagePublishedProjects { get; set; }
public string[] DotnetToolProjects { get; set; }
}
var buildPlan = JsonConvert.DeserializeObject<BuildPlan>(
@@ -273,7 +274,19 @@ Task("DotnetPackPublished")
}
});
/// <summary>
/// Packages dotnet tool projects specified in DotnetToolProjects.
/// </summary>
Task("DotnetPackServiceTools")
.Does(() =>
{
foreach (var project in buildPlan.DotnetToolProjects)
{
var outputFolder = System.IO.Path.Combine(nugetPackageFolder);
var projectFolder = System.IO.Path.Combine(sourceFolder, project);
DotnetPack(outputFolder, projectFolder, project);
}
});
/// <summary>
/// Run all tests for .NET Desktop and .NET Core

View File

@@ -46,5 +46,9 @@
"runtime.ubuntu.16.04-x64.native.Microsoft.SqlToolsService",
"runtime.win-x64.native.Microsoft.SqlToolsService",
"runtime.osx-arm64.native.Microsoft.SqlToolsService"
],
"DotnetToolProjects": [
"Microsoft.SqlTools.ServiceLayer",
"Microsoft.Kusto.ServiceLayer"
]
}

View File

@@ -21,6 +21,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(BUILD_DOTNET_TOOL)' == 'true'">
<PackageDescription>.NET client Kusto Service application, usable as a dotnet tool. This package is intended to be used by internal applications only and should not be referenced directly.</PackageDescription>
<PackAsTool>true</PackAsTool>
<ToolCommandName>$(AssemblyName)</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>

View File

@@ -22,6 +22,7 @@
<Choose>
<When Condition="'$(BUILD_DOTNET_TOOL)' == 'true'">
<PropertyGroup>
<PackageDescription>.NET client SQL Tools Service application, usable as a dotnet tool. This package is intended to be used by internal applications only and should not be referenced directly.</PackageDescription>
<PackAsTool>true</PackAsTool>
<ToolCommandName>$(AssemblyName)</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>