Expose Core Tools as a .NET Core Tool. Resolves #2071

This commit is contained in:
Katy Shimizu 2020-08-21 14:34:03 -07:00 коммит произвёл Katy Shimizu
Родитель 24842e88b5
Коммит b4e66eb337
4 изменённых файлов: 23 добавлений и 20 удалений

Просмотреть файл

@ -20,4 +20,6 @@ artifacts:
- path: artifacts\Azure.Functions.*.zip
name: Release
- path: artifacts\Azure.Functions.*.sha2
name: Release
- path: artifacts\Azure.Functions.*.nupkg
name: Release

Просмотреть файл

@ -118,6 +118,16 @@ namespace Build
}
}
public static void DotnetPack()
{
var outputPath = Path.Combine(Settings.OutputDir);
Shell.Run("dotnet", $"pack {Settings.ProjectFile} " +
$"/p:BuildNumber=\"{Settings.BuildNumber}\" " +
$"/p:NoWorkers=\"true\" " +
$"/p:CommitHash=\"{Settings.CommitId}\" " +
(string.IsNullOrEmpty(Settings.IntegrationBuildNumber) ? string.Empty : $"/p:IntegrationBuildNumber=\"{Settings.IntegrationBuildNumber}\" ") +
$"-o {outputPath} -c Release ");
}
public static void DotnetPublish()
{
foreach (var runtime in Settings.TargetRuntimes)
@ -126,15 +136,11 @@ namespace Build
var rid = GetRuntimeId(runtime);
Shell.Run("dotnet", $"publish {Settings.ProjectFile} " +
$"/p:BuildNumber=\"{Settings.BuildNumber}\" " +
(runtime.StartsWith(Settings.MinifiedVersionPrefix) ? "/p:NoWorkers=\"true\"": string.Empty) +
$"/p:CommitHash=\"{Settings.CommitId}\" " +
(string.IsNullOrEmpty(Settings.IntegrationBuildNumber) ? string.Empty : $"/p:IntegrationBuildNumber=\"{Settings.IntegrationBuildNumber}\" ") +
$"-o {outputPath} -c Release " +
(string.IsNullOrEmpty(rid) ? string.Empty : $" -r {rid}"));
if (runtime.StartsWith(Settings.MinifiedVersionPrefix))
{
RemoveLanguageWorkers(outputPath);
}
}
if (!string.IsNullOrEmpty(Settings.IntegrationBuildNumber) && (_manifest != null))
@ -224,18 +230,6 @@ namespace Build
}
}
private static void RemoveLanguageWorkers(string outputPath)
{
foreach (var languageWorker in Settings.LanguageWorkers)
{
var path = Path.Combine(outputPath, "workers", languageWorker);
if (Directory.Exists(path))
{
Directory.Delete(path, recursive: true);
}
}
}
public static void AddDistLib()
{
var distLibDir = Path.Combine(Settings.OutputDir, "distlib");

Просмотреть файл

@ -30,6 +30,7 @@ namespace Build
.Then(CopyBinariesToSign, skip: !args.Contains("--ci") || !args.Contains("--integrationTests"))
.Then(Test, skip: args.Contains("--integrationTests"))
.Then(Zip)
.Then(DotnetPack)
.Then(CreateIntegrationTestsBuildManifest, skip: !args.Contains("--integrationTests"))
.Run();
}

Просмотреть файл

@ -24,6 +24,10 @@
<RepositoryType>git</RepositoryType>
<ApplicationIcon>AzureFunctions-CLI.ico</ApplicationIcon>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<PackAsTool>true</PackAsTool>
<ToolCommandName>func</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'win-x64' OR '$(RuntimeIdentifier)' == 'win-x86'">
<PublishReadyToRun>true</PublishReadyToRun>
@ -132,14 +136,16 @@
<PackageReference Include="DotNetZip" Version="1.13.3" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="2.2.0" />
<PackageReference Include="Microsoft.Azure.DurableTask.AzureStorage.Internal" Version="1.4.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.WebHost" Version="3.0.15149" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="YamlDotNet" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(NoWorkers)' != 'true'">
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.8.0" />
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="2.0.6" />
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS6" Version="3.0.557" />
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7" Version="3.0.560" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.WebHost" Version="3.0.15149" />
<PackageReference Include="Microsoft.Azure.Functions.PythonWorker" Version="3.1.1.10" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="YamlDotNet" Version="6.0.0" />
</ItemGroup>
<Target Name="ExcludeWorkersFromReadyToRun">