提交 e4d67164 编写于 作者: D Davis Goodin 提交者: GitHub

Use IsShipping=false to keep VS insertion nupkgs unique (dotnet/core-setup#8105)

* Use IsShipping=false, keep insertion nupkgs unique

* Fix MNA_VERSION test variable

* Add missing IsStableBuild arg to publish task


Commit migrated from https://github.com/dotnet/core-setup/commit/c81ee019bbb2ef59231f153e1329c57d47c08fd0
上级 e0aebc15
......@@ -200,6 +200,10 @@
</RemoveDuplicates>
</Target>
<Target Name="ReturnProductVersion"
DependsOnTargets="GetProductVersions"
Returns="$(ProductVersion)" />
<!--
By default, shared frameworks are generated based on the package. This can be overridden by the
project, and in the future, the runtime pack is likely to be used to assemble the sfx.
......
......@@ -295,20 +295,35 @@
<Target Name="GenerateVSInsertionNupkg"
DependsOnTargets="
GetInstallerGenerationFlags;
GenerateVSInsertionNupkgCore" />
EnsureMsiBuilt">
<!--
Run the nupkg creation code with IsShipping=false to use prerelease versions: this package
must not be stable to avoid mutation conflicts, even though the project itself may be shipping
and therefore stabilized.
Also pass in the path to the MSI file to pack up because its file name is based on
stabilization status.
-->
<MSBuild
Condition="'$(GenerateMSI)' == 'true'"
Projects="$(MSBuildProjectFullPath)"
Targets="GenerateVSInsertionNupkgCore"
Properties="
IsShipping=false;
ComponentMsiFile=$(OutInstallerFile)" />
</Target>
<!--
When using the CreateVSInsertionNupkg entry point target, we have to make sure this project's
MSI was created first.
-->
<Target Name="EnsureMsiBuilt">
<Target Name="EnsureMsiBuilt"
Condition="'$(GenerateMSI)' == 'true'">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Build" />
</Target>
<Target Name="GenerateVSInsertionNupkgCore"
Condition="'$(GenerateMSI)' == 'true'"
DependsOnTargets="
EnsureMsiBuilt;
AcquireNuGetExe;
GetInstallerProperties;
GetWixBuildConfiguration">
......@@ -321,7 +336,7 @@
<ProjectUrlForVS>https://github.com/dotnet/core-setup</ProjectUrlForVS>
<PackProperties />
<PackProperties>$(PackProperties)COMPONENT_MSI=$(OutInstallerFile);</PackProperties>
<PackProperties>$(PackProperties)COMPONENT_MSI=$(ComponentMsiFile);</PackProperties>
<PackProperties>$(PackProperties)ARCH=$(MsiArch);</PackProperties>
<PackProperties>$(PackProperties)COMPONENT_NAME=$(VSInsertionComponentName);</PackProperties>
<PackProperties>$(PackProperties)FRIENDLY_NAME=$(VSInsertionComponentFriendlyName);</PackProperties>
......
......@@ -6,6 +6,12 @@
<TargetFramework>$(NETCoreAppFramework)</TargetFramework>
</PropertyGroup>
<!-- Set IsStableBuild to mimic https://github.com/dotnet/arcade/blob/694d59f090b743f894779d04a7ffe11cbaf352e7/src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj#L30-L31 -->
<PropertyGroup>
<IsStableBuild>false</IsStableBuild>
<IsStableBuild Condition="'$(DotNetFinalVersionKind)' == 'release'">true</IsStableBuild>
</PropertyGroup>
<PropertyGroup>
<BaseUrl Condition="'$(BaseUrl)' == ''">https://dotnetcli.blob.core.windows.net/</BaseUrl>
......
......@@ -65,6 +65,7 @@
ManifestBranch="$(BUILD_SOURCEBRANCH)"
ManifestBuildId="$(BUILD_BUILDNUMBER)"
ManifestCommit="$(BUILD_SOURCEVERSION)"
IsStableBuild="$(IsStableBuild)"
AssetManifestPath="$(AssetManifestFile)"
AssetsTemporaryDirectory="$(TempWorkingDir)" />
......@@ -109,6 +110,7 @@
ManifestBranch="$(BUILD_SOURCEBRANCH)"
ManifestBuildId="$(BUILD_BUILDNUMBER)"
ManifestCommit="$(BUILD_SOURCEVERSION)"
IsStableBuild="$(IsStableBuild)"
PublishFlatContainer="true"
AssetManifestPath="$(AssetManifestFile)"
AssetsTemporaryDirectory="$(TempWorkingDir)" />
......
......@@ -53,6 +53,20 @@
<DotNetRoot Condition="'$(DotNetRoot)' == ''">$(NetCoreRoot)</DotNetRoot>
</PropertyGroup>
<!--
Fetch the package version of Microsoft.NETCore.App. Use the runtime nupkg project because it
always ships.
Some test projects end in ".Tests", which Arcade detects and applies IsShipping=false. This
makes ProductVersion non-stable, so we can't rely on the test project's ProductVersion to be
the same as the package's version. Fetch this directly from the project to avoid guesswork.
-->
<MSBuild
Projects="$(SourceDir)pkg\projects\netcoreapp\pkg\Microsoft.NETCore.App.Runtime.pkgproj"
Targets="ReturnProductVersion">
<Output TaskParameter="TargetOutputs" PropertyName="NETCoreAppRuntimePackageVersion" />
</MSBuild>
<!--
Set up properties used inside tests. Write them to a text file so that they can be found
inside the VS Test Explorer context the same way as the XUnit runner will find them.
......@@ -65,7 +79,7 @@
<TestContextVariable Include="BUILDRID=$(OutputRid)" />
<TestContextVariable Include="BUILD_ARCHITECTURE=$(TargetArchitecture)" />
<TestContextVariable Include="BUILD_CONFIGURATION=$(ConfigurationGroup)" />
<TestContextVariable Include="MNA_VERSION=$(ProductVersion)" />
<TestContextVariable Include="MNA_VERSION=$(NETCoreAppRuntimePackageVersion)" />
<TestContextVariable Include="MNA_TFM=$(NETCoreAppFramework)" />
<TestContextVariable Include="DOTNET_SDK_PATH=$(DotNetRoot)" />
</ItemGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册