Skip to content

Commit

Permalink
Fix build (#3539)
Browse files Browse the repository at this point in the history
* Add pack step, and revert package cleanup

* Split publish and pack for vsix to get all dlls in place.

* Make manifest it's own Manifest step.
  • Loading branch information
nohwnd authored Apr 1, 2022
1 parent 1d72c61 commit fd7a896
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Param(
[Switch] $Force,

[Alias("s")]
[String[]] $Steps = @("InstallDotnet", "Restore", "UpdateLocalization", "Build", "Publish", "PrepareAcceptanceTests")
[String[]] $Steps = @("InstallDotnet", "Restore", "UpdateLocalization", "Build", "Publish", "Pack", "Manifest", "PrepareAcceptanceTests")
)

$ErrorActionPreference = 'Stop'
Expand Down Expand Up @@ -759,12 +759,10 @@ function Move-Loc-Files($sourceDir, $destinationDir, $dllName) {
}
}

function Create-VsixPackage {
Write-Log "Create-VsixPackage: Started."
function Publish-VsixPackage {
Write-Log "Publish-VsixPackage: Started."
$timer = Start-Timer

$vsixSourceDir = Join-Path $env:TP_ROOT_DIR "src\package\VSIXProject"
$vsixProjectDir = Join-Path $env:TP_OUT_DIR "$TPB_Configuration\VSIX"
$packageDir = Get-FullCLRPackageDirectory
$extensionsPackageDir = Join-Path $packageDir "Extensions"
$testImpactComComponentsDir = Join-Path $extensionsPackageDir "TestImpact"
Expand Down Expand Up @@ -847,10 +845,20 @@ function Create-VsixPackage {
Copy-Item -Recurse $comComponentsDirectoryTIA\* $legacyTestImpactComComponentsDir -Force

Copy-Item (Join-Path $env:TP_PACKAGE_PROJ_DIR "ThirdPartyNotices.txt") $packageDir -Force

Write-Log "Publish-VsixPackage: Complete. {$(Get-ElapsedTime($timer))}"
}

function Create-VsixPackage {
Write-Log "Create-VsixPackage: Started."
$timer = Start-Timer

Write-Verbose "Locating MSBuild install path..."
$msbuildPath = Locate-MSBuildPath

$vsixSourceDir = Join-Path $env:TP_ROOT_DIR "src\package\VSIXProject"
$vsixProjectDir = Join-Path $env:TP_OUT_DIR "$TPB_Configuration\VSIX"

# Create vsix only when msbuild is installed.
if (![string]::IsNullOrEmpty($msbuildPath)) {
# Copy the vsix project to artifacts directory to modify manifest
Expand Down Expand Up @@ -1276,11 +1284,15 @@ if ($Force -or $Steps -contains "Build") {

if ($Force -or $Steps -contains "Publish") {
Publish-Package
Publish-VsixPackage
}

if ($Force -or $Steps -contains "Pack") {
Create-VsixPackage
Create-NugetPackages
}

if ($Force -or $Steps -contains "Publish" -or $Steps -contains "Manifest") {
if ($Force -or $Steps -contains "Manifest") {
Generate-Manifest -PackageFolder $TPB_PackageOutDir
if (Test-Path $TPB_SourceBuildPackageOutDir)
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/verify-nupkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Verify-Nuget-Packages($packageDirectory, $version)

# Don't remove the directories after you unpacked them
# they are useful for reviewing what is in the package.
# Remove-Item -Force -Recurse $unzipNugetPackageDir | Out-Null
Remove-Item -Force -Recurse $unzipNugetPackageDir | Out-Null
}

Write-Log "Completed Verify-Nuget-Packages."
Expand Down

0 comments on commit fd7a896

Please sign in to comment.