Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scripts/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Param(
[Alias("vs")]
[System.String] $VersionSuffix = "dev",

[Parameter(Mandatory=$false)]
[System.String] $BuildVersionPrefix = "14.0",

[Parameter(Mandatory=$false)]
[System.String] $BuildVersionSuffix = "99.99",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it look like in real when provided by the CI ? Share an example.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like 1926.01


[Parameter(Mandatory=$false)]
[System.String] $Target = "Build",

Expand Down Expand Up @@ -74,6 +80,7 @@ $TFB_Configuration = $Configuration
$TFB_FrameworkVersion = $FrameworkVersion
$TFB_AdapterVersion = $AdapterVersion
$TFB_VersionSuffix = $VersionSuffix
$TFB_BuildVersion = if ($BuildVersionSuffix -ne '') { $BuildVersionPrefix + "." + $BuildVersionSuffix } else { $BuildVersionPrefix }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not required.

$TFB_SkipRestore = $SkipRestore
$TFB_Clean = $Clean
$TFB_ClearPackageCache = $ClearPackageCache
Expand Down Expand Up @@ -249,8 +256,8 @@ function Invoke-Build([string] $solution, $hasVsixExtension = "false")
$solutionFailureLog = Join-Path -path $solutionDir -childPath "msbuild.err"

Write-Log " Building $solution..."
Write-Verbose "$msbuild /t:$Target /p:Configuration=$configuration /tv:$msbuildVersion /v:m /flp1:Summary`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionSummaryLog /flp2:WarningsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionWarningLog /flp3:ErrorsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionFailureLog /p:IsLocalizedBuild=$TFB_IsLocalizedBuild /p:UpdateXlf=$TFB_UpdateXlf $solutionPath"
& $msbuild /t:$Target /p:Configuration=$configuration /tv:$msbuildVersion /v:m /flp1:Summary`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionSummaryLog /flp2:WarningsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionWarningLog /flp3:ErrorsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionFailureLog /p:IsLocalizedBuild=$TFB_IsLocalizedBuild /p:UpdateXlf=$TFB_UpdateXlf $solutionPath
Write-Verbose "$msbuild /t:$Target /p:Configuration=$configuration /tv:$msbuildVersion /v:m /flp1:Summary`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionSummaryLog /flp2:WarningsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionWarningLog /flp3:ErrorsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionFailureLog /p:IsLocalizedBuild=$TFB_IsLocalizedBuild /p:UpdateXlf=$TFB_UpdateXlf /p:BuildVersion=$TFB_BuildVersion $solutionPath"
& $msbuild /t:$Target /p:Configuration=$configuration /tv:$msbuildVersion /v:m /flp1:Summary`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionSummaryLog /flp2:WarningsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionWarningLog /flp3:ErrorsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$solutionFailureLog /p:IsLocalizedBuild=$TFB_IsLocalizedBuild /p:UpdateXlf=$TFB_UpdateXlf /p:BuildVersion=$TFB_BuildVersion $solutionPath

if ($lastExitCode -ne 0) {
throw "Build failed with an exit code of '$lastExitCode'."
Expand Down
2 changes: 1 addition & 1 deletion scripts/SetBuildNumber.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Set_BuildNumber()
Write-Verbose("Build number used: " + $buildNumber)

# This sets the build number.
Write-Host("##vso[build.updatebuildnumber]$buildNumber")
Write-Host("##vso[task.setvariable variable=BuildVersionSuffix]$buildNumber")
}

Set_BuildNumber
2 changes: 1 addition & 1 deletion scripts/build/TestFx.targets
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<TFBuildNumber Condition=" '$(TFBuildNumber)' == '' ">0.1</TFBuildNumber>
<MajorVersion>14.0</MajorVersion>
<AssemblyVersion>$(MajorVersion).0.0</AssemblyVersion>
<BuildVersion>$(MajorVersion).$(TFBuildNumber)</BuildVersion>
<BuildVersion Condition=" '$(BuildVersion)' == '' ">$(MajorVersion).$(TFBuildNumber)</BuildVersion>
</PropertyGroup>
<ItemGroup>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyVersionAttribute">
Expand Down