Installer updates (Merge to SDK Changeset) (#17959)

This commit is contained in:
Michael Yanni 2024-04-06 11:13:05 -07:00 committed by GitHub
commit 899cd0fdb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
209 changed files with 986 additions and 1713 deletions

View file

@ -41,7 +41,7 @@ dotnet_style_qualification_for_event = false:suggestion
# only use var when it's obvious what the variable type is
csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = false:none
csharp_style_var_elsewhere = false:suggestion
csharp_style_var_elsewhere = false:none
# use language keywords instead of BCL types
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion

22
.gitattributes vendored
View file

@ -1,13 +1,13 @@
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.doc binary
*.DOC binary
*.docx binary
*.DOCX binary
*.dot binary
*.DOT binary
*.pdf binary
*.PDF binary
*.rtf binary
*.RTF binary
*.jpg binary
*.png binary
@ -52,4 +52,4 @@
*.fsproj text=auto
*.dbproj text=auto
*.xlf text=auto
*.sln text=auto eol=crlf
*.sln text=auto eol=crlf

View file

@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<PropertyGroup Condition="'$(CopyrightNetFoundation)' != ''">
<Copyright>$(CopyrightNetFoundation)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<!-- Platform needs to be set with TreatAsLocalProperty since it is a global property and cannot be overridden otherwise. -->
<Project TreatAsLocalProperty="Platform">
<PropertyGroup>
<BuildArchitecture Condition="'$(BuildArchitecture)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</BuildArchitecture>
@ -14,7 +9,24 @@
<Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 'ppc64le'">$(BuildArchitecture)</Architecture>
<Architecture Condition="'$(Architecture)' == '' AND '$(BuildArchitecture)' == 'loongarch64'">$(BuildArchitecture)</Architecture>
<Architecture Condition="'$(Architecture)' == ''">x64</Architecture>
<!--
The finalizer project needs to have Platform set to build for the correct architecture.
Platform needs to be set prior to calling the Arcade SDK, which sets PlatformName in RepoDefaults.props and modifies the OutputPath in ProjectLayout.props to include a PlatformName folder in the path.
Currently, build.cmd calls run-build.ps1, which always sets the Architecture.
However, if you wanted to build the finalizer project directly, the Architecture will use the logic above to be set properly, and thus maintain the correct OutputPath.
Note: The redist project does use Architecture. The Arcade SDK does not use either BuildArchitecture or Architecture.
-->
<Platform Condition="'$(SetPlatformFromArchitecture)' == 'true' And ('$(Platform)' == '' Or '$(Platform)' == 'AnyCPU')">$(Architecture)</Platform>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<PropertyGroup Condition="'$(CopyrightNetFoundation)' != ''">
<Copyright>$(CopyrightNetFoundation)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<PropertyGroup Condition="'$(PgoInstrument)' == 'true'">
<SkipBuildingInstallers>true</SkipBuildingInstallers>
<PgoTerm>-pgo</PgoTerm>

View file

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28603.18
# Visual Studio Version 17
VisualStudioVersion = 17.8.34112.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}"
EndProject
@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "core-sdk-tasks", "src\core-
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Tools.Tests.Utilities", "test\Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{78E15EC1-7732-41E3-8591-934E9F583254}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdkResolver", "src\SdkResolver\SdkResolver.csproj", "{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Dotnet.Sdk.Internal", "src\Microsoft.Dotnet.Sdk.Internal\Microsoft.Dotnet.Sdk.Internal.csproj", "{73F07908-981B-41BB-B9BD-F3420274A6F7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdkTests", "test\SdkTests\SdkTests.csproj", "{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}"
@ -45,10 +43,6 @@ Global
{78E15EC1-7732-41E3-8591-934E9F583254}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78E15EC1-7732-41E3-8591-934E9F583254}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78E15EC1-7732-41E3-8591-934E9F583254}.Release|Any CPU.Build.0 = Release|Any CPU
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0}.Release|Any CPU.Build.0 = Release|Any CPU
{73F07908-981B-41BB-B9BD-F3420274A6F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73F07908-981B-41BB-B9BD-F3420274A6F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73F07908-981B-41BB-B9BD-F3420274A6F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -70,7 +64,6 @@ Global
{1BFF54F9-4E35-49DB-893C-AF2047722FC6} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{53AF2D01-B69F-4CD0-86A7-8FD95967D23C} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{78E15EC1-7732-41E3-8591-934E9F583254} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{658EF9BE-452C-4D31-AA24-B9E2235799A8} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
EndGlobalSection

View file

@ -1,48 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28603.18
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "finalizer_shim", "src\finalizer_shim\finalizer_shim.csproj", "{688E2883-C5A9-4D66-A207-772C9160989C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Debug|x64 = Debug|x64
Debug|arm64 = Debug|arm64
Debug|arm = Debug|arm
Release|x86 = Release|x86
Release|x64 = Release|x64
Release|arm64 = Release|arm64
Release|arm = Release|arm
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|x86.ActiveCfg = Debug|x86
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|x86.Build.0 = Debug|x86
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|x64.ActiveCfg = Debug|x64
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|x64.Build.0 = Debug|x64
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|arm64.ActiveCfg = Debug|arm64
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|arm64.Build.0 = Debug|arm64
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|arm.ActiveCfg = Debug|arm
{688E2883-C5A9-4D66-A207-772C9160989C}.Debug|arm.Build.0 = Debug|arm
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|x86.ActiveCfg = Release|x86
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|x86.Build.0 = Release|x86
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|x64.ActiveCfg = Release|x64
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|x64.Build.0 = Release|x64
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|arm64.ActiveCfg = Release|arm64
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|arm64.Build.0 = Release|arm64
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|arm.ActiveCfg = Release|arm
{688E2883-C5A9-4D66-A207-772C9160989C}.Release|arm.Build.0 = Release|arm
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{688E2883-C5A9-4D66-A207-772C9160989C} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {18FCFCA3-D1A8-4D3A-9763-6A658D0D726F}
EndGlobalSection
EndGlobal

View file

@ -1,12 +1,10 @@
<Project>
<Project>
<PropertyGroup>
<_SuppressSdkImports>false</_SuppressSdkImports>
</PropertyGroup>
<Target Name="PopulateGenerateChecksumItems"
AfterTargets="Build"
BeforeTargets="GenerateChecksums" >
<Target Name="PopulateGenerateChecksumItems" AfterTargets="Build" BeforeTargets="GenerateChecksums">
<ItemGroup>
<InstallerFiles Include="$(ArtifactsShippingPackagesDir)**\*.msi" />
<InstallerFiles Include="$(ArtifactsShippingPackagesDir)**\*.exe" />
@ -14,11 +12,12 @@
<InstallerFiles Include="$(ArtifactsShippingPackagesDir)**\*.tar.gz" />
<InstallerFiles Include="$(ArtifactsShippingPackagesDir)**\*.deb" />
<InstallerFiles Include="$(ArtifactsShippingPackagesDir)**\*.rpm" />
<GenerateChecksumItems Include="%(InstallerFiles.Identity)" >
<GenerateChecksumItems Include="%(InstallerFiles.Identity)">
<DestinationPath>%(FullPath).sha512</DestinationPath>
</GenerateChecksumItems>
</ItemGroup>
</Target>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
</Project>

View file

@ -12,9 +12,8 @@
<!-- Regular build -->
<ItemGroup>
<ProjectToBuild Include="$(RepoRoot)Microsoft.DotNet.Cli.sln" />
<ProjectToBuild Condition="'$(OS)' == 'Windows_NT' And ('$(Architecture)' == 'x86' Or '$(Architecture)' == 'x64' Or '$(Architecture)' == 'arm64' Or '$(Architecture)' == 'arm')"
Include="$(RepoRoot)eng\version.csproj;
$(RepoRoot)eng\native.proj" />
<ProjectToBuild Condition="'$(OS)' == 'Windows_NT' And ('$(Architecture)' == 'x86' Or '$(Architecture)' == 'x64' Or '$(Architecture)' == 'arm64')"
Include="$(RepoRoot)src\finalizer\finalizer-build.csproj" />
</ItemGroup>
</Otherwise>
</Choose>

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<!-- The following properties (unlike those in version.props) are maintained manually. So
when there is a merge conflict, the highest version should generally be chosen, rather
than keeping what's in the branch, which is the usual strategy with version.props merge
conflicts.
Basically: In this file, choose the highest version when resolving merge conflicts.
<!--
The following properties (unlike those in version.props) are maintained manually. So
when there is a merge conflict, the highest version should generally be chosen, rather
than keeping what's in the branch, which is the usual strategy with version.props merge
conflicts.
Basically: In this file, choose the highest version when resolving merge conflicts.
-->
<PropertyGroup>
<MicrosoftWindowsSDKNETRef10_0_17763PackageVersion>10.0.17763.31</MicrosoftWindowsSDKNETRef10_0_17763PackageVersion>
@ -16,4 +16,5 @@
<MicrosoftWindowsSDKNETRef10_0_22000PackageVersion>10.0.22000.31</MicrosoftWindowsSDKNETRef10_0_22000PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_22621PackageVersion>10.0.22621.31</MicrosoftWindowsSDKNETRef10_0_22621PackageVersion>
</PropertyGroup>
</Project>

View file

@ -85,18 +85,15 @@
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)productCommit-*.txt.sha512" Condition=" '$(PublishBinariesAndBadge)' == 'false'" />
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)productVersion.txt.sha512" Condition=" '$(OS)' != 'Windows_NT' or '$(Architecture)' != 'x64'" />
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)sdk-productVersion.txt.sha512" Condition=" '$(OS)' != 'Windows_NT' or '$(Architecture)' != 'x64'" />
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.zip.sha512" Condition=" '$(PublishBinariesAndBadge)' == 'false' "/>
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.tar.gz.sha512" Condition=" '$(PublishBinariesAndBadge)' == 'false' "/>
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.zip.sha512" Condition=" '$(PublishBinariesAndBadge)' == 'false' " />
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.tar.gz.sha512" Condition=" '$(PublishBinariesAndBadge)' == 'false' " />
</ItemGroup>
<Target Name="PublishSdkAssetsAndChecksums"
BeforeTargets="Publish"
Condition="$(DotNetPublishUsingPipelines)">
<ReadLinesFromFile File="$(ArtifactsTmpDir)FullNugetVersion.version">
<Output
TaskParameter="Lines"
PropertyName="FullNugetVersion"/>
<Output TaskParameter="Lines" PropertyName="FullNugetVersion" />
</ReadLinesFromFile>
<ItemGroup>

View file

@ -5,6 +5,7 @@
custom publishing target. And should not be picked up by arcade's default publishing logic. -->
<ItemsToSignPostBuild Remove="*.wixpack.zip" />
</ItemGroup>
<ItemGroup Condition="'$(PostBuildSign)' != 'true'">
<ItemsToSign Remove="@(ItemsToSign)" />
<ItemsToSign Include="$(ArtifactsPackagesDir)**\*.exe" />
@ -17,10 +18,7 @@
<ExternalCertificateId Condition="'$(ExternalCertificateId)' == ''">3PartySHA2</ExternalCertificateId>
<InternalCertificateId Condition="'$(InternalCertificateId)' == ''">MicrosoftDotNet500</InternalCertificateId>
<!--
Signing of shipping artifacts (layout, msi, bundle) are handled separately.
It is therefore expected that <ItemsToSign> could be an empty set.
-->
<!-- Signing of shipping artifacts (layout, msi, bundle) are handled separately. It is therefore expected that <ItemsToSign> could be an empty set. -->
<AllowEmptySignList>true</AllowEmptySignList>
<AllowEmptySignPostBuildList>true</AllowEmptySignPostBuildList>
@ -33,6 +31,7 @@
<FileSignInfo Include="MessagePack.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="Nerdbank.Streams.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="Valleysoft.DockerCredsProvider.dll" CertificateName="$(ExternalCertificateId)" />
<!-- Files in the layout that should not be signed -->
<FileSignInfo Include="apphost.exe" CertificateName="None" />

View file

@ -71,9 +71,9 @@
<MicrosoftAspNetCoreAppRefInternalPackageVersion>9.0.0-preview.4.24205.2</MicrosoftAspNetCoreAppRefInternalPackageVersion>
<MicrosoftAspNetCoreAppRuntimewinx64PackageVersion>9.0.0-preview.4.24205.2</MicrosoftAspNetCoreAppRuntimewinx64PackageVersion>
<VSRedistCommonAspNetCoreSharedFrameworkx6490PackageVersion>9.0.0-preview.4.24205.2</VSRedistCommonAspNetCoreSharedFrameworkx6490PackageVersion>
<dotnetdevcertsPackageVersion>9.0.0-preview.4.24205.2</dotnetdevcertsPackageVersion>
<dotnetuserjwtsPackageVersion>9.0.0-preview.4.24205.2</dotnetuserjwtsPackageVersion>
<dotnetusersecretsPackageVersion>9.0.0-preview.4.24205.2</dotnetusersecretsPackageVersion>
<DotnetDevCertsPackageVersion>9.0.0-preview.4.24205.2</DotnetDevCertsPackageVersion>
<DotnetUserJwtsPackageVersion>9.0.0-preview.4.24205.2</DotnetUserJwtsPackageVersion>
<DotnetUserSecretsPackageVersion>9.0.0-preview.4.24205.2</DotnetUserSecretsPackageVersion>
</PropertyGroup>
<PropertyGroup>
<MicroBuildCorePackageVersion>0.2.0</MicroBuildCorePackageVersion>
@ -112,8 +112,7 @@
<MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion>9.0.0-preview.4.24204.1</MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Runtime and Apphost pack versions are the same for all RIDs. We flow the x64 -->
<!-- version above and create aliases without the winx64 here for clarity elsewhere. -->
<!-- Runtime and Apphost pack versions are the same for all RIDs. We flow the x64 version above and create aliases without the winx64 here for clarity elsewhere. -->
<MicrosoftNETCoreAppHostPackageVersion>$(MicrosoftNETCoreAppHostwinx64PackageVersion)</MicrosoftNETCoreAppHostPackageVersion>
<MicrosoftNETCoreAppRuntimePackageVersion>$(MicrosoftNETCoreAppRuntimewinx64PackageVersion)</MicrosoftNETCoreAppRuntimePackageVersion>
<MicrosoftAspNetCoreAppRuntimePackageVersion>$(MicrosoftAspNetCoreAppRuntimewinx64PackageVersion)</MicrosoftAspNetCoreAppRuntimePackageVersion>

View file

@ -1,16 +0,0 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<PropertyGroup>
<Platform Condition="'$(Platform)'=='' Or $(Platform)=='AnyCPU'">$(Architecture)</Platform>
</PropertyGroup>
<Target Name="Build">
<MSBuild Projects="$(RepoRoot)Native.sln" Properties="Platform=$(Platform)" Targets="Restore;Build" />
</Target>
<Target Name="Test" />
<Target Name="Pack" />
<Target Name="Rebuild" />
<Target Name="IntegrationTest" />
<Target Name="PerformanceTest" />
</Project>

View file

@ -1,8 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
<NativeVersionFile>$(ArtifactsObjDir)sdk_version.h</NativeVersionFile>
</PropertyGroup>
<Target Name="GenerateSdkVersionFile" BeforeTargets="CoreCompile" DependsOnTargets="GenerateNativeVersionFile" />
</Project>

View file

@ -12,6 +12,6 @@
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24203.1",
"Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24203.1"
}
"Microsoft.DotNet.CMake.Sdk": "9.0.0-beta.24203.1",
"Microsoft.Build.NoTargets": "3.7.0" }
}

View file

@ -24,9 +24,6 @@ if ($PgoInstrument) {
if ($Sign) {
$Parameters = "$Parameters -sign /p:SignCoreSdk=true"
# Workaround https://github.com/dotnet/arcade/issues/1776
$WarnAsError = $false
}
$Parameters = "$Parameters -WarnAsError `$$WarnAsError"

View file

@ -82,12 +82,12 @@ src/fsharp/setup/resources/eula/*.rtf
# False positive
src/installer/src/core-sdk-tasks/BuildFPMToolPreReqs.cs|json
src/installer/src/redist/targets/packaging/osx/clisdk/resources/en.lproj/welcome.html|cecill-c
src/installer/src/redist/packaging/osx/resources/en.lproj/welcome.html|cecill-c
src/installer/THIRD-PARTY-NOTICES|proprietary-license
# Configuration, doesn't apply to source directly
src/installer/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt
src/installer/src/redist/targets/packaging/**/*.json
src/installer/src/redist/packaging/**/*.json
#
# msbuild

View file

@ -26,16 +26,9 @@ namespace Microsoft.DotNet.Cli.Build
{
var resultItem = new TaskItem(item);
item.CopyMetadataTo(resultItem);
if (File.Exists(resultItem.GetMetadata("FullPath")) &&
HasMetadata(resultItem.GetMetadata("FullPath")))
{
resultItem.SetMetadata("IsPE", "True");
}
else
{
resultItem.SetMetadata("IsPE", "False");
}
var isPe = File.Exists(resultItem.GetMetadata("FullPath")) && HasMetadata(resultItem.GetMetadata("FullPath"));
resultItem.SetMetadata("IsPE", isPe.ToString());
resultItemsList.Add(resultItem);
}

View file

@ -27,7 +27,6 @@ namespace Microsoft.DotNet.Cli.Build
private const string s_dotnetBlobContainerName = "dotnet";
private string _connectionString { get; set; }
private string _containerName { get; set; }
private CloudBlobContainer _blobContainer { get; set; }
@ -41,14 +40,7 @@ namespace Microsoft.DotNet.Cli.Build
{
var storageCredentials = new StorageCredentials(accountName, accountKey);
var storageAccount = new CloudStorageAccount(storageCredentials, true);
return GetDotnetBlobContainer(storageAccount, containerName);
}
private CloudBlobContainer GetDotnetBlobContainer(CloudStorageAccount storageAccount, string containerName)
{
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
return blobClient.GetContainerReference(containerName);
return storageAccount.CreateCloudBlobClient().GetContainerReference(containerName);
}
public string UploadFile(string file, Product product, string version)
@ -105,11 +97,7 @@ namespace Microsoft.DotNet.Cli.Build
}
}
public IEnumerable<string> ListBlobs(Product product, string version)
{
string virtualDirectory = $"{product}/{version}";
return ListBlobs(virtualDirectory);
}
public IEnumerable<string> ListBlobs(Product product, string version) => ListBlobs($"{product}/{version}");
public IEnumerable<string> ListBlobs(string virtualDirectory)
{
@ -120,10 +108,7 @@ namespace Microsoft.DotNet.Cli.Build
return blobFiles.Results.Select(bf => bf.Uri.PathAndQuery.Replace($"/{_containerName}/", string.Empty));
}
public string AcquireLeaseOnBlob(
string blob,
TimeSpan? maxWaitDefault = null,
TimeSpan? delayDefault = null)
public string AcquireLeaseOnBlob(string blob, TimeSpan? maxWaitDefault = null, TimeSpan? delayDefault = null)
{
TimeSpan maxWait = maxWaitDefault ?? TimeSpan.FromSeconds(120);
TimeSpan delay = delayDefault ?? TimeSpan.FromMilliseconds(500);
@ -194,26 +179,18 @@ namespace Microsoft.DotNet.Cli.Build
try
{
DeleteBlob(path);
return true;
}
catch (Exception e)
{
Console.WriteLine($"Deleting blob {path} failed with \r\n{e.Message}");
return false;
}
}
private void DeleteBlob(string path)
{
_blobContainer.GetBlockBlobReference(path).DeleteAsync().Wait();
}
private void DeleteBlob(string path) => _blobContainer.GetBlockBlobReference(path).DeleteAsync().Wait();
private static string CalculateRelativePathForFile(string file, Product product, string version)
{
return $"{product}/{version}/{Path.GetFileName(file)}";
}
private static string CalculateRelativePathForFile(string file, Product product, string version) => $"{product}/{version}/{Path.GetFileName(file)}";
}
}
#endif

View file

@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
using System.IO;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
@ -116,32 +115,29 @@ namespace Microsoft.DotNet.Build.Tasks
// --verbose : Set verbose output for FPM tool --Static
// <All folder mappings> : Add all the folder mappings for package_root, docs, man pages --Static
var parameters = new List<string>();
parameters.Add("-s dir");
parameters.Add("-t rpm");
parameters.Add(string.Concat("-n ", configJson.Package_Name));
parameters.Add(string.Concat("-v ", package_version));
parameters.Add(string.Concat("-a ", configJson.Control.Architecture));
var parameters = new List<string>
{
"-s dir",
"-t rpm",
string.Concat("-n ", configJson.Package_Name),
string.Concat("-v ", package_version),
string.Concat("-a ", configJson.Control.Architecture)
};
// Build the list of dependencies as -d <dep1> -d <dep2>
if (configJson.Rpm_Dependencies != null)
{
foreach (RpmDependency rpmdep in configJson.Rpm_Dependencies)
{
string dependency = "";
if (rpmdep.Package_Name != "")
{
// If no version is specified then the dependency is just the package without >= check
if (rpmdep.Package_Version == "")
{
dependency = rpmdep.Package_Name;
}
else
{
dependency = string.Concat(rpmdep.Package_Name, " >= ", rpmdep.Package_Version);
}
string dependency = rpmdep.Package_Version != "" ?
string.Concat(rpmdep.Package_Name, " >= ", rpmdep.Package_Version) :
rpmdep.Package_Name;
parameters.Add(string.Concat("-d ", EscapeArg(dependency)));
}
if (dependency != "") parameters.Add(string.Concat("-d ", EscapeArg(dependency)));
}
}
@ -183,14 +179,11 @@ namespace Microsoft.DotNet.Build.Tasks
// Map all the payload directories as they need to install on the system
if (configJson.Install_Root != null)
parameters.Add(string.Concat(Path.Combine(InputDir, "package_root/="),
configJson.Install_Root)); // Package Files
parameters.Add(string.Concat(Path.Combine(InputDir, "package_root/="), configJson.Install_Root)); // Package Files
if (configJson.Install_Man != null)
parameters.Add(string.Concat(Path.Combine(InputDir, "docs", "host/="),
configJson.Install_Man)); // Man Pages
parameters.Add(string.Concat(Path.Combine(InputDir, "docs", "host/="), configJson.Install_Man)); // Man Pages
if (configJson.Install_Doc != null)
parameters.Add(string.Concat(Path.Combine(InputDir, "templates", "copyright="),
configJson.Install_Doc)); // CopyRight File
parameters.Add(string.Concat(Path.Combine(InputDir, "templates", "copyright="), configJson.Install_Doc)); // CopyRight File
return string.Join(" ", parameters);
}
@ -220,14 +213,12 @@ namespace Microsoft.DotNet.Build.Tasks
{
sb.Append('\\', 2 * backslashCount);
}
// Escape any preceding backslashes and the quote
else if (arg[i] == '"')
{
sb.Append('\\', (2 * backslashCount) + 1);
sb.Append('"');
}
// Output any consumed backslashes and the character
else
{
@ -255,6 +246,7 @@ namespace Microsoft.DotNet.Build.Tasks
{
return true;
}
return false;
}
}

View file

@ -28,7 +28,6 @@ namespace Microsoft.DotNet.Cli.Build
[Required]
public int CombinedBuildNumberAndRevision { get; set; }
// Should be the BundledTemplates with BundledTemplateInstallPath metadata set to the value calculated for that group
[Output]
public ITaskItem [] BundledTemplatesWithInstallPaths { get; set; }
@ -39,11 +38,10 @@ namespace Microsoft.DotNet.Cli.Build
// TemplatesMajorMinorVersion: 6.0 (from BundledTemplateMajorMinorVersion from group)
// InstallerUpgradeCode: Guid generated using GenerateGuidFromName, combining TemplateBaseFilename, FullNugetVersion, ProductMonikerRid, and InstallerExtension
// MSIVersion: Result of calling GenerateMsiVersionFromFullVersion logic with CombinedBuildNumberAndRevision and BundledTemplateMajorMinorPatchVersion from template group
[Output]
public ITaskItem [] TemplatesComponents { get; set; }
private const int _patchVersionResetOffset = 1;
private const int PatchVersionResetOffset = 1;
public override bool Execute()
{
@ -62,20 +60,20 @@ namespace Microsoft.DotNet.Cli.Build
BundledTemplatesWithInstallPaths = BundledTemplates.Select(t =>
{
var templateWithInstallPath = new TaskItem(t);
templateWithInstallPath.SetMetadata("BundledTemplateInstallPath", groups[t.GetMetadata("TemplateFrameworkVersion")].BundledTemplateInstallPath);
templateWithInstallPath.SetMetadata("BundledTemplateInstallPath", groups[t.GetMetadata("TemplateFrameworkVersion")].InstallPath);
return templateWithInstallPath;
}).ToArray();
TemplatesComponents = groups.Select(g =>
{
string majorMinorWithoutDots = g.Value.BundledTemplateMajorMinorVersion.Replace(".", "");
string majorMinorWithoutDots = g.Value.MajorMinorVersion.Replace(".", "");
var componentItem = new TaskItem($"NetCore{majorMinorWithoutDots}Templates");
var templateBaseFilename = $"dotnet-{majorMinorWithoutDots}templates";
componentItem.SetMetadata("TemplateBaseFilename", templateBaseFilename);
componentItem.SetMetadata("TemplatesMajorMinorVersion", g.Value.BundledTemplateMajorMinorVersion);
componentItem.SetMetadata("TemplatesMajorMinorVersion", g.Value.MajorMinorVersion);
var installerUpgradeCode = GenerateGuidFromName.GenerateGuid(string.Join("-", templateBaseFilename, FullNugetVersion, ProductMonikerRid) + InstallerExtension).ToString().ToUpper();
componentItem.SetMetadata("InstallerUpgradeCode", installerUpgradeCode);
componentItem.SetMetadata("MSIVersion", GenerateMsiVersionFromFullVersion.GenerateMsiVersion(CombinedBuildNumberAndRevision, g.Value.BundledTemplateMajorMinorPatchVersion));
componentItem.SetMetadata("MSIVersion", GenerateMsiVersionFromFullVersion.GenerateMsiVersion(CombinedBuildNumberAndRevision, g.Value.MajorMinorPatchVersion));
var brandName = System.Version.Parse(g.Key).Major >= 5 ?
$"Microsoft .NET {g.Key} Templates" :
@ -89,24 +87,20 @@ namespace Microsoft.DotNet.Cli.Build
return true;
}
public static
(string BundledTemplateInstallPath,
string BundledTemplateMajorMinorVersion,
string BundledTemplateMajorMinorPatchVersion)
Calculate(string aspNetCorePackageVersionTemplate)
public static BundledTemplate Calculate(string aspNetCorePackageVersionTemplate)
{
var aspNetCoreTemplate = NuGetVersion.Parse(aspNetCorePackageVersionTemplate);
NuGetVersion baseMajorMinorPatch = GetBaseMajorMinorPatch(aspNetCoreTemplate);
string bundledTemplateInstallPath = aspNetCoreTemplate.IsPrerelease
? $"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}-{aspNetCoreTemplate.Release}"
: $"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}";
return (
bundledTemplateInstallPath,
$"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}",
$"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}");
return new BundledTemplate
{
InstallPath = bundledTemplateInstallPath,
MajorMinorVersion = $"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}",
MajorMinorPatchVersion = $"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}"
};
}
private static NuGetVersion GetBaseMajorMinorPatch(NuGetVersion aspNetCoreTemplate)
@ -116,15 +110,17 @@ namespace Microsoft.DotNet.Cli.Build
// more in the above bug's detail.
// There is no non-deterministic existing ComponentId under Major version 5.
// so only apply the patch bump when below 5
int basePatch =
aspNetCoreTemplate.Major < 5
? aspNetCoreTemplate.Patch + _patchVersionResetOffset
: aspNetCoreTemplate.Patch;
var baseMajorMinorPatch = new NuGetVersion(aspNetCoreTemplate.Major, aspNetCoreTemplate.Minor,
basePatch);
return baseMajorMinorPatch;
int basePatch = aspNetCoreTemplate.Major < 5 ?
aspNetCoreTemplate.Patch + PatchVersionResetOffset :
aspNetCoreTemplate.Patch;
return new NuGetVersion(aspNetCoreTemplate.Major, aspNetCoreTemplate.Minor, basePatch);
}
}
public class BundledTemplate
{
public string InstallPath { get; set; }
public string MajorMinorVersion { get; set; }
public string MajorMinorPatchVersion { get; set; }
}
}

View file

@ -16,44 +16,18 @@ namespace Microsoft.DotNet.Cli.Build
public bool Recursive { get; set; }
protected override string ToolName
{
get { return "chmod"; }
}
protected override string ToolName => "chmod";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{
return "chmod";
}
protected override string GenerateFullPathToTool() => "chmod";
protected override string GenerateCommandLineCommands()
{
return $"{GetRecursive()} {GetMode()} {GetGlob()}";
}
protected override string GenerateCommandLineCommands() => $"{GetRecursive()} {GetMode()} {GetGlob()}";
private string GetGlob()
{
return Glob;
}
private string GetGlob() => Glob;
private string GetMode()
{
return Mode;
}
private string GetMode() => Mode;
private string GetRecursive()
{
if(Recursive)
{
return "--recursive";
}
return null;
}
private string GetRecursive() => Recursive ? "--recursive" : null;
}
}

View file

@ -1,10 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

View file

@ -1,13 +0,0 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Cli.Build.Framework
{
public static class Constants
{
//public static readonly string ProjectFileName = "project.json";
public static readonly string ExeSuffix = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : string.Empty;
}
}

View file

@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.Build.Framework;
@ -63,12 +61,12 @@ namespace Microsoft.DotNet.Build.Tasks
if (toolResult)
{
var files = System.IO.Directory.GetFiles(Path.GetDirectoryName(TempOutputPath));
var dest = Path.GetDirectoryName(DestinationPath);
var files = Directory.GetFiles(Path.GetDirectoryName(TempOutputPath));
var destination = Path.GetDirectoryName(DestinationPath);
// Copy both dll and pdb files to the destination folder
foreach(var file in files)
{
File.Copy(file, Path.Combine(dest, Path.GetFileName(file)), overwrite: true);
File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), overwrite: true);
// Delete file in temp
File.Delete(file);
}
@ -83,22 +81,13 @@ namespace Microsoft.DotNet.Build.Tasks
return toolResult;
}
protected override string ToolName
{
get { return "crossgen2"; }
}
protected override string ToolName => "crossgen2";
protected override MessageImportance StandardOutputLoggingImportance
{
// Default is low, but we want to see output at normal verbosity.
get { return MessageImportance.Normal; }
}
// Default is low, but we want to see output at normal verbosity.
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.Normal;
protected override MessageImportance StandardErrorLoggingImportance
{
// This turns stderr messages into msbuild errors below.
get { return MessageImportance.High; }
}
// This turns stderr messages into msbuild errors below.
protected override MessageImportance StandardErrorLoggingImportance => MessageImportance.High;
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
@ -124,56 +113,21 @@ namespace Microsoft.DotNet.Build.Tasks
}
}
protected override string GenerateFullPathToTool()
{
if (CrossgenPath != null)
{
return CrossgenPath;
}
protected override string GenerateFullPathToTool() => CrossgenPath ?? "crossgen2";
return "crossgen2";
}
protected override string GenerateCommandLineCommands() => $"{GetInPath()} {GetOutPath()} {GetArchitecture()} {GetPlatformAssemblyPaths()} {GetCreateSymbols()}";
protected override string GenerateCommandLineCommands()
{
return $"{GetInPath()} {GetOutPath()} {GetArchitecture()} {GetPlatformAssemblyPaths()} {GetCreateSymbols()}";
}
private string GetArchitecture() => $"--targetarch {Architecture}";
private string GetArchitecture()
{
return $"--targetarch {Architecture}";
}
private string GetCreateSymbols() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "--pdb" : "--perfmap";
private string GetCreateSymbols()
{
var option = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "--pdb" : "--perfmap";
return $"{option}";
}
private string GetInPath() => $"\"{SourceAssembly}\"";
private string GetReadyToRun()
{
if (ReadyToRun)
{
return "-readytorun";
}
return null;
}
private string GetInPath()
{
return $"\"{SourceAssembly}\"";
}
private string GetOutPath()
{
return $"-o \"{TempOutputPath}\"";
}
private string GetOutPath() => $"-o \"{TempOutputPath}\"";
private string GetPlatformAssemblyPaths()
{
var platformAssemblyPaths = String.Empty;
var platformAssemblyPaths = string.Empty;
if (PlatformAssemblyPaths != null)
{
foreach (var excludeTaskItem in PlatformAssemblyPaths)
@ -184,15 +138,7 @@ namespace Microsoft.DotNet.Build.Tasks
return platformAssemblyPaths;
}
private string GetMissingDependenciesOk()
{
return "-MissingDependenciesOK";
}
protected override void LogToolCommand(string message)
{
base.LogToolCommand($"{base.GetWorkingDirectory()}> {message}");
}
protected override void LogToolCommand(string message) => base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
}
}

View file

@ -25,50 +25,30 @@ namespace Microsoft.DotNet.Cli.Build
protected override string ToolName => "package_tool.sh";
private string GetInputDir()
{
return $"-i {InputDirectory}";
}
private string GetInputDir() => $"-i {InputDirectory}";
private string GetOutputFile()
{
return $"-o {OutputDirectory}";
}
private string GetOutputFile() => $"-o {OutputDirectory}";
private string GetPackageName()
{
return $"-n {PackageName}";
}
private string GetPackageName() => $"-n {PackageName}";
private string GetPackageVersion()
{
return $"-v {PackageVersion}";
}
private string GetPackageVersion() => $"-v {PackageVersion}";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{
string path = ToolPath;
// if ToolPath was not provided by the MSBuild script
if (string.IsNullOrEmpty(path))
if (string.IsNullOrEmpty(ToolPath))
{
Log.LogError($"Could not find the Path to {ToolName}");
return string.Empty;
}
return path;
return ToolPath;
}
protected override string GetWorkingDirectory()
{
return WorkingDirectory ?? base.GetWorkingDirectory();
}
protected override string GetWorkingDirectory() => WorkingDirectory ?? base.GetWorkingDirectory();
protected override string GenerateCommandLineCommands()
{
@ -79,26 +59,13 @@ namespace Microsoft.DotNet.Cli.Build
return commandLineCommands;
}
protected override void LogToolCommand(string message)
{
base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
}
protected override void LogToolCommand(string message) => base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
Log.LogMessage(messageImportance, singleLine, null);
}
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance) => Log.LogMessage(messageImportance, singleLine, null);
protected override ProcessStartInfo GetProcessStartInfo(
string pathToTool,
string commandLineCommands,
string responseFileSwitch)
protected override ProcessStartInfo GetProcessStartInfo(string pathToTool, string commandLineCommands, string responseFileSwitch)
{
var psi = base.GetProcessStartInfo(
pathToTool,
commandLineCommands,
responseFileSwitch);
var psi = base.GetProcessStartInfo(pathToTool, commandLineCommands, responseFileSwitch);
foreach (var environmentVariableName in new EnvironmentFilter().GetEnvironmentVariableNamesToRemove())
{
psi.Environment.Remove(environmentVariableName);

View file

@ -1,10 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Diagnostics;
using System.Runtime.InteropServices;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.Cli.Build.Framework;
namespace Microsoft.DotNet.Cli.Build
@ -19,16 +18,9 @@ namespace Microsoft.DotNet.Cli.Build
protected abstract string Args { get; }
protected override ProcessStartInfo GetProcessStartInfo(
string pathToTool,
string commandLineCommands,
string responseFileSwitch)
protected override ProcessStartInfo GetProcessStartInfo(string pathToTool, string commandLineCommands, string responseFileSwitch)
{
var psi = base.GetProcessStartInfo(
pathToTool,
commandLineCommands,
responseFileSwitch);
var psi = base.GetProcessStartInfo(pathToTool, commandLineCommands, responseFileSwitch);
foreach (var environmentVariableName in new EnvironmentFilter().GetEnvironmentVariableNamesToRemove())
{
psi.Environment.Remove(environmentVariableName);
@ -39,35 +31,24 @@ namespace Microsoft.DotNet.Cli.Build
public string WorkingDirectory { get; set; }
protected override string ToolName
{
get { return $"dotnet{Constants.ExeSuffix}"; }
}
protected override string ToolName => $"dotnet{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : string.Empty)}";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{
string path = ToolPath;
// if ToolPath was not provided by the MSBuild script
if (string.IsNullOrEmpty(path))
// if ToolPath was not provided by the MSBuild script
if (string.IsNullOrEmpty(ToolPath))
{
Log.LogError($"Could not find the Path to {ToolName}");
return string.Empty;
}
return path;
return ToolPath;
}
protected override string GetWorkingDirectory()
{
return WorkingDirectory ?? base.GetWorkingDirectory();
}
protected override string GetWorkingDirectory() => WorkingDirectory ?? base.GetWorkingDirectory();
protected override string GenerateCommandLineCommands()
{
@ -78,9 +59,6 @@ namespace Microsoft.DotNet.Cli.Build
return commandLineCommands;
}
protected override void LogToolCommand(string message)
{
base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
}
protected override void LogToolCommand(string message) => base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
}
}

View file

@ -9,15 +9,15 @@ namespace Microsoft.DotNet.Cli.Build
{
public class EnvironmentFilter
{
private const string _MSBuildEnvironmentVariablePrefix = "MSBuild";
private const string _DotNetEnvironmentVariablePrefix = "DOTNET";
private const string _NugetEnvironmentVariablePrefix = "NUGET";
private const string MSBuildEnvironmentVariablePrefix = "MSBuild";
private const string DotNetEnvironmentVariablePrefix = "DOTNET";
private const string NugetEnvironmentVariablePrefix = "NUGET";
private IEnumerable<string> _prefixesOfEnvironmentVariablesToRemove = new string []
{
_MSBuildEnvironmentVariablePrefix,
_DotNetEnvironmentVariablePrefix,
_NugetEnvironmentVariablePrefix
MSBuildEnvironmentVariablePrefix,
DotNetEnvironmentVariablePrefix,
NugetEnvironmentVariablePrefix
};
private IEnumerable<string> _environmentVariablesToRemove = new string []
@ -36,7 +36,7 @@ namespace Microsoft.DotNet.Cli.Build
public IEnumerable<string> GetEnvironmentVariableNamesToRemove()
{
var allEnvironmentVariableNames = (IEnumerable<string>)Environment
var allEnvironmentVariableNames = Environment
.GetEnvironmentVariables()
.Keys
.Cast<string>();

View file

@ -47,13 +47,10 @@ namespace Microsoft.DotNet.Build.Tasks
var retVal = true;
if (Directory.Exists(DestinationDirectory))
if (Directory.Exists(DestinationDirectory) && CleanDestination == true)
{
if (CleanDestination == true)
{
Log.LogMessage(MessageImportance.Low, "'{0}' already exists, trying to delete before unzipping...", DestinationDirectory);
Directory.Delete(DestinationDirectory, recursive: true);
}
Log.LogMessage(MessageImportance.Low, "'{0}' already exists, trying to delete before unzipping...", DestinationDirectory);
Directory.Delete(DestinationDirectory, recursive: true);
}
if (!File.Exists(SourceArchive))
@ -178,35 +175,14 @@ namespace Microsoft.DotNet.Build.Tasks
return retVal;
}
private bool ShouldExtractItem(string path)
{
if (DirectoriesToCopy != null)
{
return DirectoriesToCopy.Any(p => path.StartsWith(p.ItemSpec));
private bool ShouldExtractItem(string path) => DirectoriesToCopy?.Any(p => path.StartsWith(p.ItemSpec)) ?? false;
}
protected override string ToolName => "tar";
return false;
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string ToolName
{
get { return "tar"; }
}
protected override string GenerateFullPathToTool() => "tar";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override string GenerateFullPathToTool()
{
return "tar";
}
protected override string GenerateCommandLineCommands()
{
return $"xf {SourceArchive} -C {DestinationDirectory}";
}
protected override string GenerateCommandLineCommands() => $"xf {SourceArchive} -C {DestinationDirectory}";
}
}

View file

@ -19,21 +19,14 @@ namespace Microsoft.DotNet.Cli.Build
{
if (NuGetVersion.TryParse(RuntimePackVersion, out var version))
{
if (version.IsPrerelease && version.Patch == 0)
{
DefaultRuntimeFrameworkVersion = RuntimePackVersion;
}
else
{
DefaultRuntimeFrameworkVersion = new NuGetVersion(version.Major, version.Minor, 0).ToFullString();
}
DefaultRuntimeFrameworkVersion = version.IsPrerelease && version.Patch == 0 ?
RuntimePackVersion :
new NuGetVersion(version.Major, version.Minor, 0).ToFullString();
return true;
}
else
{
return false;
}
return false;
}
}
}

View file

@ -3,8 +3,6 @@
using System;
using System.Security.Cryptography;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Microsoft.DotNet.Cli.Build
{

View file

@ -1,11 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NuGet.RuntimeModel;

View file

@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Microsoft.Build.Framework;
@ -49,6 +48,7 @@ namespace Microsoft.DotNet.Cli.Build
{
Log.LogWarning($"GetComponentCommit failed for VersionDetailsXmlFile={VersionDetailsXmlFile}, DependencyName={DependencyName}: {ex}");
}
return true;
}
}

View file

@ -1,14 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.Cli.Build
{

View file

@ -1,11 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Newtonsoft.Json.Linq;
@ -27,6 +24,7 @@ namespace Microsoft.DotNet.Cli.Build
var runtimeJsonRoot = JObject.Parse(runtimeJsonContents);
string [] runtimeIdentifiers = ((JObject)runtimeJsonRoot["runtimes"]).Properties().Select(p => p.Name).ToArray();
AvailableRuntimePackRuntimeIdentifiers = runtimeIdentifiers.Select(rid => new TaskItem(rid)).ToArray();
return true;
}
}

View file

@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
@ -88,39 +87,22 @@ namespace Microsoft.DotNet.Build.Tasks
return retVal;
}
public override bool Execute()
{
return base.Execute();
}
public override bool Execute() => base.Execute();
protected override string ToolName
{
get { return "tar"; }
}
protected override string ToolName => "tar";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{
return "tar";
}
protected override string GenerateFullPathToTool() => "tar";
protected override string GenerateCommandLineCommands()
{
return $"{GetDestinationArchive()} {GetSourceSpecification()}";
}
protected override string GenerateCommandLineCommands() => $"{GetDestinationArchive()} {GetSourceSpecification()}";
private string GetSourceSpecification()
{
if (IncludeBaseDirectory)
{
var parentDirectory = Directory.GetParent(SourceDirectory).Parent.FullName;
var sourceDirectoryName = Path.GetFileName(Path.GetDirectoryName(SourceDirectory));
return $"--directory {parentDirectory} {sourceDirectoryName} {GetExcludes()}";
}
else
@ -129,14 +111,11 @@ namespace Microsoft.DotNet.Build.Tasks
}
}
private string GetDestinationArchive()
{
return $"-czf {DestinationArchive}";
}
private string GetDestinationArchive() => $"-czf {DestinationArchive}";
private string GetExcludes()
{
var excludes = String.Empty;
var excludes = string.Empty;
if (ExcludePatterns != null)
{
@ -148,10 +127,7 @@ namespace Microsoft.DotNet.Build.Tasks
return excludes;
}
protected override void LogToolCommand(string message)
{
base.LogToolCommand($"{base.GetWorkingDirectory()}> {message}");
}
protected override void LogToolCommand(string message) => base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
}
}

View file

@ -1,10 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Newtonsoft.Json.Linq;

View file

@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.20)
# Create project named finalizer, this will
# will generate Finalizer.vcxproj
# Create project named finalizer, this will generate Finalizer.vcxproj
project(Finalizer)
set(CMAKE_MACOSX_RPATH 1)
@ -10,12 +9,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:wmainCRTStartup")
# The WiX SDK is extracted from a NuGet package using an SDK .csproj (finalizer_shim)
# that copies the "lib" and "inc" folders to a stable location.
include_directories(../../artifacts/WixSdk/inc)
include_directories(../../artifacts/obj)
link_directories(../../artifacts/WixSdk/lib/${Platform})
# The WiX SDK is extracted from a NuGet package using an SDK .csproj (finalizer-build) that copies the "lib" and "inc" folders to a stable location.
# The defines below (values in ${}) are set in the finalizer.nativeproj.
# See: https://github.com/dotnet/arcade/tree/main/src/Microsoft.DotNet.CMake.Sdk#common-items
# Note: The directory paths use forward slashes because backslashes are escape characters.
include_directories(${ArtifactsDir}WixSdk/inc)
include_directories(${ArtifactsDir}obj)
link_directories(${ArtifactsDir}WixSdk/lib/${Platform})
add_compile_options(/MT)
@ -48,9 +48,7 @@ add_executable(Finalizer
native.rc
)
# These are normally part of a .vcxproj in Visual Studio, but
# appears to be missing when CMAKE generates a .vcxproj
# for arm64.
# These are normally part of a .vcxproj in Visual Studio, but appears to be missing when CMAKE generates a .vcxproj for arm64.
target_link_libraries(Finalizer shell32.lib)
target_link_libraries(Finalizer advapi32.lib)
target_link_libraries(Finalizer version.lib)

View file

@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<SetPlatformFromArchitecture>true</SetPlatformFromArchitecture>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />
</Project>

View file

@ -1,14 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
This is a shim project to restore the WiX library and copy out the *.lib and *.h files so
we can build the finalizer.
-->
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<Platform Condition="'$(Platform)' == 'AnyCPU' Or '$(Platform)' == ''">$(Architecture)</Platform>
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<NativeVersionFile>$(ArtifactsObjDir)sdk_version.h</NativeVersionFile>
</PropertyGroup>
<ItemGroup>
@ -17,20 +14,26 @@
</ItemGroup>
<ItemGroup>
<NativeProjectReference Include="$(RepoRoot)src\finalizer\CMakeLists.txt" CMakeProject="$(RepoRoot)src\finalizer\finalizer.proj" BuildNative="true"/>
<!-- See: https://github.com/dotnet/arcade/tree/main/src/Microsoft.DotNet.CMake.Sdk#referencing-native-assets-with-nativeprojectreference -->
<NativeProjectReference Include="CMakeLists.txt" CMakeProject="finalizer.nativeproj" BuildNative="true" />
</ItemGroup>
<Target Name="GenerateSdkVersionFile" BeforeTargets="CoreCompile" DependsOnTargets="GenerateNativeVersionFile" />
<!-- This target needs to run before the native project reference is built. -->
<Target Name="CopySdk" AfterTargets="Restore" BeforeTargets="Build">
<Target Name="CopyWixSdk" AfterTargets="Restore" BeforeTargets="Build">
<ItemGroup>
<WixLib Include="$(WixSdkPath)vs2017\lib\**\*.*" />
<WixInclude Include="$(WixSdkPath)inc\**\*.*" />
</ItemGroup>
<!-- Copy all the lib files for x86, x64, and arm64 -->
<!-- Copy all the lib files for x86, x64, and arm64. -->
<Copy SourceFiles="@(WixLib)" DestinationFiles="@(WixLib->'$(ArtifactsDir)WixSdk\lib\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(WixInclude)" DestinationFolder="$(ArtifactsDir)WixSdk\inc" SkipUnchangedFiles="true" />
</Target>
<!-- This imports the CMake SDK and because BuildNative is true, it builds the native project. -->
<!-- See: https://github.com/dotnet/arcade/tree/main/src/Microsoft.DotNet.CMake.Sdk#referencing-native-assets-with-nativeprojectreference -->
<Import Project="ProjectReference.targets" Sdk="Microsoft.DotNet.CMake.Sdk" />
</Project>
</Project>

View file

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.DotNet.CMake.Sdk">
<PropertyGroup>
<!-- We use forward slashes in the ArtifactsDir path because backslashes in the CMakeLists.txt are escape characters. -->
<ArtifactsDirForCMake>$([System.String]::Copy($(ArtifactsDir)).Replace('\','/'))</ArtifactsDirForCMake>
<CMakeLists>CMakeLists.txt</CMakeLists>
</PropertyGroup>
<!-- This will be passed through -D and referenced by the CMakeLists.txt to correctly resolve the platform specific libs. -->
<ItemGroup>
<CMakeDefines Include="Platform" Value="$(Platform)" />
<CMakeDefines Include="ArtifactsDir" Value="$(ArtifactsDirForCMake)" />
<!-- Include this item below to create a binlog for the native build. -->
<!-- <CMakeNativeToolArguments Include="/bl:$(ArtifactsDirForCMake)native.binlog" /> -->
</ItemGroup>
</Project>

View file

@ -1,14 +0,0 @@
<Project Sdk="Microsoft.DotNet.CMake.Sdk">
<PropertyGroup>
<CMakeLists>CMakeLists.txt</CMakeLists>
</PropertyGroup>
<!--
This will be passed through -D and referenced by the CMakeLists.txt to correctly resolve
the platform specific libs
-->
<ItemGroup>
<CMakeDefines Include="Platform" Value="$(Platform)" />
<!-- <CMakeNativeToolArguments Include="/bl:$(ArtifactsDir)native.binlog" /> -->
</ItemGroup>
</Project>

View file

@ -1,34 +1,34 @@
{
"maintainer_name":"Microsoft",
"maintainer_email": "dotnetcore@microsoft.com",
"maintainer_email": "dotnetcore@microsoft.com",
"package_name": "dotnet-sdk-%SDK_NUGET_VERSION%",
"install_root": "/usr/share/dotnet",
"short_description": "%CLI_SDK_BRAND_NAME%",
"long_description": ".NET is a development platform that you can use to build command-line applications, microservices and modern websites. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/dotnet/core). We happily accept issues and PRs.",
"long_description": ".NET is a development platform that you can use to build command-line applications, microservices and modern websites. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/dotnet/core). We happily accept issues and PRs.",
"homepage": "https://github.com/dotnet/core",
"release":{
"package_version":"0.0.0.0",
"package_revision":"1",
"urgency" : "low",
"changelog_message" : "Bootstrap loop package"
"release": {
"package_version":"0.0.0.0",
"package_revision":"1",
"urgency" : "low",
"changelog_message" : "Bootstrap loop package"
},
"control": {
"priority":"standard",
"section":"devel",
"architecture":"any"
"control": {
"priority":"standard",
"section":"devel",
"architecture":"any"
},
"copyright": ".NET Foundation and contributors",
"license": {
"type": "MIT",
"license": {
"type": "MIT",
"full_text": "The MIT License (MIT)\nCopyright (c) .NET Foundation and Contributors\n\nAll rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
},
"debian_dependencies":{
"debian_dependencies": {
"%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%": { "package_version": "%SHARED_FRAMEWORK_DEBIAN_PACKAGE_VERSION%" }%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%,
"%NETCOREAPP_TARGETING_PACK_DEBIAN_PACKAGE_NAME%": { "package_version": "%NETCOREAPP_TARGETING_PACK_DEBIAN_PACKAGE_VERSION%" },
"%NETCORE_APPHOST_PACK_DEBIAN_PACKAGE_NAME%": { "package_version": "%SHARED_FRAMEWORK_DEBIAN_PACKAGE_VERSION%" },

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LCX SchemaVersion="6.0" Name="D:\a\_work\1\s\src\redist\targets\packaging\osx\clisdk\resources\conclusion.html" PsrId="22" FileType="1" SrcCul="en-US" Desc="Commenting file created by LCXAdmin. For more information, please visit http://localizability/longhorn/LcxAdmin.asp" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<LCX SchemaVersion="6.0" Name="D:\a\_work\1\s\src\redist\packaging\osx\resources\conclusion.html" PsrId="22" FileType="1" SrcCul="en-US" Desc="Commenting file created by LCXAdmin. For more information, please visit http://localizability/longhorn/LcxAdmin.asp" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<OwnedComments>
<Cmt Name="LcxAdmin" />
</OwnedComments>

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LCX SchemaVersion="6.0" Name="D:\a\_work\1\s\src\redist\targets\packaging\osx\clisdk\resources\welcome.html" PsrId="22" FileType="1" SrcCul="en-US" Desc="Commenting file created by LCXAdmin. For more information, please visit http://localizability/longhorn/LcxAdmin.asp" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<LCX SchemaVersion="6.0" Name="D:\a\_work\1\s\src\redist\packaging\osx\resources\welcome.html" PsrId="22" FileType="1" SrcCul="en-US" Desc="Commenting file created by LCXAdmin. For more information, please visit http://localizability/longhorn/LcxAdmin.asp" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<OwnedComments>
<Cmt Name="LcxAdmin" />
</OwnedComments>

Some files were not shown because too many files have changed in this diff Show more