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>
|
||||
<PropertyGroup>
|
||||
<BundledVersionsIntermediateDirectory>$(IntermediateDirectory)/GeneratedMSBuildImports</BundledVersionsIntermediateDirectory>
|
||||
<BundledVersionsPropsFolder>15.0/Imports/Microsoft.Common.props/ImportBefore</BundledVersionsPropsFolder>
|
||||
<BundledVersionsPropsFileName>Microsoft.NETCoreSdk.BundledVersions.props</BundledVersionsPropsFileName>
|
||||
</PropertyGroup>
|
||||
<Target Name="GenerateMSBuildExtensions"
|
||||
DependsOnTargets="GenerateBundledVersionsProps">
|
||||
|
||||
<Target Name="GenerateBundledVersionsProps"
|
||||
BeforeTargets="PublishMSBuildExtensions">
|
||||
<ItemGroup>
|
||||
<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
|
||||
|
@ -54,14 +59,10 @@ Copyright (c) .NET Foundation. All rights reserved.
|
|||
</BundledVersionsPropsContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<MakeDir Directories="$(BundledVersionsIntermediateDirectory)/$(BundledVersionsPropsFolder)" />
|
||||
<WriteLinesToFile File="$(BundledVersionsIntermediateDirectory)/$(BundledVersionsPropsFolder)/$(BundledVersionsPropsFileName)"
|
||||
<MakeDir Directories="$(GeneratedMSBuildExtensionsDirectory)/$(BundledVersionsPropsFolder)" />
|
||||
<WriteLinesToFile File="$(GeneratedMSBuildExtensionsDirectory)/$(BundledVersionsPropsFolder)/$(BundledVersionsPropsFileName)"
|
||||
Lines="$(BundledVersionsPropsContent)"
|
||||
Overwrite="true" />
|
||||
|
||||
<!-- MSBuildExtensionsContent destination is driven by %(RecursiveDir), which is why we glob here. -->
|
||||
<ItemGroup>
|
||||
<MSBuildExtensionsContent Include="$(BundledVersionsIntermediateDirectory)/**/$(BundledVersionsPropsFileName)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -11,5 +11,6 @@
|
|||
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
|
||||
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
|
||||
<DotnetInOutputDirectory>$(OutputDirectory)/dotnet$(ExeExtension)</DotnetInOutputDirectory>
|
||||
<GeneratedMSBuildExtensionsDirectory>$(IntermediateDirectory)/GeneratedMSBuildExtensions</GeneratedMSBuildExtensionsDirectory>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<!-- Test Sdk MSI Properties -->
|
||||
|
@ -143,6 +146,21 @@
|
|||
'$(SdkInstallerNupkgFile)'" />
|
||||
</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"
|
||||
Inputs="$(SdkInstallerFile)"
|
||||
Outputs="$(SdkMsiTestedSentinel)"
|
||||
|
@ -168,6 +186,7 @@
|
|||
GenerateSdkMsi;
|
||||
GenerateSdkBundle;
|
||||
GenerateSdkNupkg;
|
||||
GenerateSdkMSBuildExtensionsNupkg;
|
||||
TestSdkMsi"
|
||||
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>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="[DOTNET_BUNDLE]" target="[DOTNET_BUNDLE]" />
|
||||
<file src="[DOTNET_BUNDLE]" />
|
||||
</files>
|
||||
</package>
|
|
@ -13,6 +13,6 @@
|
|||
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="[DOTNET_BUNDLE]" target="[DOTNET_BUNDLE]" />
|
||||
<file src="[DOTNET_BUNDLE]" />
|
||||
</files>
|
||||
</package>
|
|
@ -15,7 +15,7 @@ param(
|
|||
$RepoRoot = Convert-Path "$PSScriptRoot\..\..\.."
|
||||
$NuGetDir = Join-Path $RepoRoot ".nuget"
|
||||
$NuGetExe = Join-Path $NuGetDir "nuget.exe"
|
||||
$OutputDirectory = [System.IO.Path]::GetDirectoryName($SdkBundlePath)
|
||||
$OutputDirectory = [System.IO.Path]::GetDirectoryName($NupkgFile)
|
||||
|
||||
function DownloadNugetExe
|
||||
{
|
||||
|
@ -37,10 +37,10 @@ function GenerateNupkg
|
|||
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)
|
||||
$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
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
|
||||
<Import Project="$(RepoRoot)/build/compile/LzmaArchive.targets" />
|
||||
<Import Project="$(RepoRoot)/build/BundledVersions.targets" />
|
||||
<Import Project="$(RepoRoot)/build/MSBuildExtensions.targets" />
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
|
@ -79,6 +79,7 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="PublishMSBuildExtensions"
|
||||
DependsOnTargets="GenerateMSBuildExtensions"
|
||||
AfterTargets="Publish"
|
||||
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
|
||||
|
||||
|
|
|
@ -287,7 +287,7 @@ namespace Microsoft.DotNet.Tests
|
|||
result.Should().Fail();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(Skip = "https://github.com/dotnet/cli/issues/6144")]
|
||||
public void WhenToolAssetsFileIsInUseThenCLIRetriesLaunchingTheCommandForAtLeastOneSecond()
|
||||
{
|
||||
var testInstance = TestAssets.Get("AppWithToolDependency")
|
||||
|
|
Loading…
Add table
Reference in a new issue