Set ReleaseSuffix in test asset

This commit is contained in:
William Li 2018-09-10 11:19:29 -07:00
parent efcae15d0d
commit 0b8d850377
3 changed files with 20 additions and 2 deletions

View file

@ -121,12 +121,13 @@
ProjectPath="%(TestPackageProject.ProjectPath)"
AdditionalParameters="/p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)"
/>
<!-- https://github.com/NuGet/Home/issues/4063 -->
<DotNetPack Output="$(TestPackagesDir)"
ProjectPath="%(TestPackageProject.ProjectPath)"
ToolPath="$(OutputDirectory)"
VersionSuffix="%(TestPackageProject.VersionSuffix)"
ReleaseSuffix="%(TestPackageProject.ReleaseSuffix)"
MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)" />
</Target>

View file

@ -27,6 +27,7 @@
<IsApplicable>True</IsApplicable>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<ReleaseSuffix>$(ReleaseSuffix)</ReleaseSuffix>
<Clean>True</Clean>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-portable">
@ -36,6 +37,7 @@
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<ReleaseSuffix></ReleaseSuffix>
<Clean>True</Clean>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-prefercliruntime">
@ -45,6 +47,7 @@
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<ReleaseSuffix></ReleaseSuffix>
<Clean>True</Clean>
</BaseTestPackageProject>

View file

@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build
protected override string Args
{
get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {GetIncludeSymbols()} {MsbuildArgs}"; }
get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetReleaseSuffix()} {GetRuntime()} {GetIncludeSymbols()} {MsbuildArgs}"; }
}
public string Configuration { get; set; }
@ -27,6 +27,8 @@ namespace Microsoft.DotNet.Cli.Build
public string VersionSuffix { get; set; }
public string ReleaseSuffix { get; set; }
public string Runtime { get; set; }
public bool IncludeSymbols { get; set; }
@ -77,6 +79,18 @@ namespace Microsoft.DotNet.Cli.Build
{
return $"--version-suffix {VersionSuffix}";
}
else
{
return $"--version-suffix \"\"";
}
}
private string GetReleaseSuffix()
{
if (!string.IsNullOrEmpty(ReleaseSuffix))
{
return $"-property:ReleaseSuffix={ReleaseSuffix}";
}
return null;
}