Merge pull request #6136 from nguerrera/vs-version-props
Package bundled version props in to a VS insertion nupkg
This commit is contained in:
commit
fcd3c149f8
9 changed files with 60 additions and 20 deletions
|
@ -1,12 +1,17 @@
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<Target Name="GenerateMSBuildExtensions"
|
||||||
<BundledVersionsIntermediateDirectory>$(IntermediateDirectory)/GeneratedMSBuildImports</BundledVersionsIntermediateDirectory>
|
DependsOnTargets="GenerateBundledVersionsProps">
|
||||||
<BundledVersionsPropsFolder>15.0/Imports/Microsoft.Common.props/ImportBefore</BundledVersionsPropsFolder>
|
|
||||||
<BundledVersionsPropsFileName>Microsoft.NETCoreSdk.BundledVersions.props</BundledVersionsPropsFileName>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Target Name="GenerateBundledVersionsProps"
|
<ItemGroup>
|
||||||
BeforeTargets="PublishMSBuildExtensions">
|
<MSBuildExtensionsContent Include="$(GeneratedMSBuildExtensionsDirectory)/**/*" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="GenerateBundledVersionsProps">
|
||||||
|
<PropertyGroup>
|
||||||
|
<BundledVersionsPropsFolder>15.0/Imports/Microsoft.Common.props/ImportBefore</BundledVersionsPropsFolder>
|
||||||
|
<BundledVersionsPropsFileName>Microsoft.NETCoreSdk.BundledVersions.props</BundledVersionsPropsFileName>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The bundled version of Microsoft.NETCore.App is determined statically from DependencyVersions.props whereas the bundled version
|
The bundled version of Microsoft.NETCore.App is determined statically from DependencyVersions.props whereas the bundled version
|
||||||
|
@ -54,14 +59,10 @@ Copyright (c) .NET Foundation. All rights reserved.
|
||||||
</BundledVersionsPropsContent>
|
</BundledVersionsPropsContent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<MakeDir Directories="$(BundledVersionsIntermediateDirectory)/$(BundledVersionsPropsFolder)" />
|
<MakeDir Directories="$(GeneratedMSBuildExtensionsDirectory)/$(BundledVersionsPropsFolder)" />
|
||||||
<WriteLinesToFile File="$(BundledVersionsIntermediateDirectory)/$(BundledVersionsPropsFolder)/$(BundledVersionsPropsFileName)"
|
<WriteLinesToFile File="$(GeneratedMSBuildExtensionsDirectory)/$(BundledVersionsPropsFolder)/$(BundledVersionsPropsFileName)"
|
||||||
Lines="$(BundledVersionsPropsContent)"
|
Lines="$(BundledVersionsPropsContent)"
|
||||||
Overwrite="true" />
|
Overwrite="true" />
|
||||||
|
|
||||||
<!-- MSBuildExtensionsContent destination is driven by %(RecursiveDir), which is why we glob here. -->
|
|
||||||
<ItemGroup>
|
|
||||||
<MSBuildExtensionsContent Include="$(BundledVersionsIntermediateDirectory)/**/$(BundledVersionsPropsFileName)" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
|
@ -11,5 +11,6 @@
|
||||||
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
|
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
|
||||||
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
|
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
|
||||||
<DotnetInOutputDirectory>$(OutputDirectory)/dotnet$(ExeExtension)</DotnetInOutputDirectory>
|
<DotnetInOutputDirectory>$(OutputDirectory)/dotnet$(ExeExtension)</DotnetInOutputDirectory>
|
||||||
|
<GeneratedMSBuildExtensionsDirectory>$(IntermediateDirectory)/GeneratedMSBuildExtensions</GeneratedMSBuildExtensionsDirectory>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
|
|
||||||
<SdkInstallerNuspecFile>$(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec</SdkInstallerNuspecFile>
|
<SdkInstallerNuspecFile>$(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec</SdkInstallerNuspecFile>
|
||||||
<SdkInstallerNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg</SdkInstallerNupkgFile>
|
<SdkInstallerNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg</SdkInstallerNupkgFile>
|
||||||
|
|
||||||
|
<SdkMSBuildExtensionsNuspecFile>$(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.nuspec</SdkMSBuildExtensionsNuspecFile>
|
||||||
|
<SdkMSBuildExtensionsNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.$(FullNugetVersion).nupkg</SdkMSBuildExtensionsNupkgFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Test Sdk MSI Properties -->
|
<!-- Test Sdk MSI Properties -->
|
||||||
|
@ -143,6 +146,21 @@
|
||||||
'$(SdkInstallerNupkgFile)'" />
|
'$(SdkInstallerNupkgFile)'" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="GenerateSdkMSBuildExtensionsNupkg"
|
||||||
|
DependsOnTargets="Init;Layout;MsiTargetsSetupInputOutputs;GenerateSdkBundle"
|
||||||
|
Condition=" '$(OS)' == 'Windows_NT'"
|
||||||
|
Inputs="$(GeneratedMSBuildExtensionsDirectory)/**/*;
|
||||||
|
$(SdkInstallerNuspecFile);
|
||||||
|
$(SdkGenerateNupkgPowershellScript)"
|
||||||
|
Outputs="$(SdkInstallerNupkgFile)">
|
||||||
|
|
||||||
|
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateNupkgPowershellScript)
|
||||||
|
'$(GeneratedMSBuildExtensionsDirectory)'
|
||||||
|
'$(FullNugetVersion)'
|
||||||
|
'$(SdkMSBuildExtensionsNuspecFile)'
|
||||||
|
'$(SdkMSBuildExtensionsNupkgFile)'" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
<Target Name="TestSdkMsi"
|
<Target Name="TestSdkMsi"
|
||||||
Inputs="$(SdkInstallerFile)"
|
Inputs="$(SdkInstallerFile)"
|
||||||
Outputs="$(SdkMsiTestedSentinel)"
|
Outputs="$(SdkMsiTestedSentinel)"
|
||||||
|
@ -168,6 +186,7 @@
|
||||||
GenerateSdkMsi;
|
GenerateSdkMsi;
|
||||||
GenerateSdkBundle;
|
GenerateSdkBundle;
|
||||||
GenerateSdkNupkg;
|
GenerateSdkNupkg;
|
||||||
|
GenerateSdkMSBuildExtensionsNupkg;
|
||||||
TestSdkMsi"
|
TestSdkMsi"
|
||||||
Condition=" '$(OS)' == 'Windows_NT'" />
|
Condition=" '$(OS)' == 'Windows_NT'" />
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>VS.Redist.Common.Net.Core.SDK.MSBuildExtensions</id>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<title>VS.Redist.Common.Net.Core.SDK.MSBuildExtensions</title>
|
||||||
|
<authors>Microsoft</authors>
|
||||||
|
<owners>Microsoft</owners>
|
||||||
|
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>
|
||||||
|
<projectUrl>https://github.com/dotnet/cli</projectUrl>
|
||||||
|
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||||
|
<description>MSBuild extensions bundled with .NET Core SDK insertions to VS</description>
|
||||||
|
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="[DOTNET_BUNDLE]\**\*" />
|
||||||
|
</files>
|
||||||
|
</package>
|
|
@ -13,6 +13,6 @@
|
||||||
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="[DOTNET_BUNDLE]" target="[DOTNET_BUNDLE]" />
|
<file src="[DOTNET_BUNDLE]" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
|
@ -13,6 +13,6 @@
|
||||||
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="[DOTNET_BUNDLE]" target="[DOTNET_BUNDLE]" />
|
<file src="[DOTNET_BUNDLE]" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
|
@ -15,7 +15,7 @@ param(
|
||||||
$RepoRoot = Convert-Path "$PSScriptRoot\..\..\.."
|
$RepoRoot = Convert-Path "$PSScriptRoot\..\..\.."
|
||||||
$NuGetDir = Join-Path $RepoRoot ".nuget"
|
$NuGetDir = Join-Path $RepoRoot ".nuget"
|
||||||
$NuGetExe = Join-Path $NuGetDir "nuget.exe"
|
$NuGetExe = Join-Path $NuGetDir "nuget.exe"
|
||||||
$OutputDirectory = [System.IO.Path]::GetDirectoryName($SdkBundlePath)
|
$OutputDirectory = [System.IO.Path]::GetDirectoryName($NupkgFile)
|
||||||
|
|
||||||
function DownloadNugetExe
|
function DownloadNugetExe
|
||||||
{
|
{
|
||||||
|
@ -37,10 +37,10 @@ function GenerateNupkg
|
||||||
Write-Host 'Error nuspec not found - $NuspecFile'
|
Write-Host 'Error nuspec not found - $NuspecFile'
|
||||||
}
|
}
|
||||||
|
|
||||||
$SdkBundleName = [System.IO.Path]::GetFileName($SdkBundlePath)
|
$SdkBundlePath = [System.IO.Path]::GetFullPath($SdkBundlePath)
|
||||||
$NuspecFileName = [System.IO.Path]::GetFileName($NuspecFile)
|
$NuspecFileName = [System.IO.Path]::GetFileName($NuspecFile)
|
||||||
$TempNuspecFile = [System.IO.Path]::Combine($OutputDirectory, $NuspecFileName)
|
$TempNuspecFile = [System.IO.Path]::Combine($OutputDirectory, $NuspecFileName)
|
||||||
(Get-Content $NuspecFile) -replace '\[DOTNET_BUNDLE\]', $SdkBundleName | Set-Content $TempNuspecFile
|
(Get-Content $NuspecFile) -replace '\[DOTNET_BUNDLE\]', $SdkBundlePath | Set-Content $TempNuspecFile
|
||||||
& $NuGetExe pack $TempNuspecFile -Version $NugetVersion -OutputDirectory $OutputDirectory
|
& $NuGetExe pack $TempNuspecFile -Version $NugetVersion -OutputDirectory $OutputDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
|
||||||
<Import Project="$(RepoRoot)/build/compile/LzmaArchive.targets" />
|
<Import Project="$(RepoRoot)/build/compile/LzmaArchive.targets" />
|
||||||
<Import Project="$(RepoRoot)/build/BundledVersions.targets" />
|
<Import Project="$(RepoRoot)/build/MSBuildExtensions.targets" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||||
|
@ -79,6 +79,7 @@
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishMSBuildExtensions"
|
<Target Name="PublishMSBuildExtensions"
|
||||||
|
DependsOnTargets="GenerateMSBuildExtensions"
|
||||||
AfterTargets="Publish"
|
AfterTargets="Publish"
|
||||||
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
|
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,7 @@ namespace Microsoft.DotNet.Tests
|
||||||
result.Should().Fail();
|
result.Should().Fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact(Skip = "https://github.com/dotnet/cli/issues/6144")]
|
||||||
public void WhenToolAssetsFileIsInUseThenCLIRetriesLaunchingTheCommandForAtLeastOneSecond()
|
public void WhenToolAssetsFileIsInUseThenCLIRetriesLaunchingTheCommandForAtLeastOneSecond()
|
||||||
{
|
{
|
||||||
var testInstance = TestAssets.Get("AppWithToolDependency")
|
var testInstance = TestAssets.Get("AppWithToolDependency")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue