summaryrefslogtreecommitdiff
path: root/Build-SampleSet.ps1
diff options
context:
space:
mode:
authorMatt <[email protected]>2024-06-27 14:17:05 -0700
committerGitHub <[email protected]>2024-06-27 14:17:05 -0700
commitf9eb04d34edd823873e491a7da6e6ed7a064e823 (patch)
tree601d4ea7c230b6e825cf1104587d075a321d16e7 /Build-SampleSet.ps1
parent2e07f1b58a93eb36c616192045db654cf043a670 (diff)
Refactored vsix install and cleaned up build sampleset
Diffstat (limited to 'Build-SampleSet.ps1')
-rw-r--r--Build-SampleSet.ps133
1 files changed, 18 insertions, 15 deletions
diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1
index 2fccfdb8..adae8bb0 100644
--- a/Build-SampleSet.ps1
+++ b/Build-SampleSet.ps1
@@ -55,17 +55,21 @@ finally {
#
# Determine build environment: 'GitHub', 'NuGet', 'EWDK', or 'WDK'.
# Determine build number (used for exclusions based on build number). Five digits. Say, '22621'.
+# Determine NuGet package version (if applicable).
+# Determine WDK vsix version.
#
$build_environment=""
$build_number=0
$nuget_package_version=0
+$vsix_version=""
#
-# In Github we build using Nuget only and source version from repo .\Env-Vars.ps1.
+# In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step.
#
if ($env:GITHUB_REPOSITORY) {
$build_environment="GitHub"
$nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value
$build_number=$nuget_package_version.split('.')[2]
+ $vsix_version = $env:SAMPLES_VSIX_VERSION
}
#
# WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1.
@@ -102,7 +106,19 @@ else {
Write-Error "Could not determine build environment."
exit 1
}
-
+#
+# Get the vsix version from packages if not set
+if (-not $vsix_version) {
+ $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name
+ if ($vsix_version) {
+ $vsix_version = $vsix_version.split('=')[1]
+ }
+ else {
+ Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed."
+ exit 1
+ }
+}
+#
#
# InfVerif_AdditionalOptions
#
@@ -164,19 +180,6 @@ $jresult = @{
$SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count
-# Find vsix version either from env variabel or from packages
-$vsix_version = $env:SAMPLES_VSIX_VERSION
-if (-not $vsix_version) {
- $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name
- if ($vsix_version) {
- $vsix_version = $vsix_version.split('=')[1]
- }
- else {
- Write-Error "No version for the WDK VSIX could be found. The WDK VSIX is not installed."
- exit 1
- }
-}
-
Write-Output ("Build Environment: " + $build_environment)
Write-Output ("Build Number: " + $build_number)
if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) }