-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild-all.ps1
More file actions
62 lines (46 loc) · 2.38 KB
/
build-all.ps1
File metadata and controls
62 lines (46 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Set-PSDebug -Trace 1
$ErrorActionPreference = "Stop"
$lvproj = $PSScriptRoot + "\Gantry\Gantry.lvproj"
$version = Read-Host "Enter the version specifier (e.g., 1.0.0)"
function Set-Gantry-Driver {
param( [string]$driverName, [string]$projectPath)
$xml = [xml](Get-Content -Path $projectPath)
$node = $xml.SelectSingleNode("/Project/Property[@Name='CCSymbols']")
$node.'#text' = 'GANTRY_DRIVER,' + $driverName + ';'
$xml.Save($projectPath)
}
function Set-Build-Version {
param( [string]$driverName, [string]$projectPath)
$xml = [xml](Get-Content -Path $projectPath)
$node = $xml.SelectSingleNode("/Project/Item[@Name='My Computer']/Item[@Name='Build Specifications']/Item[@Name='gScript - ${driverName}']/Property[@Name='INST_productVersion']")
$node.'#text' = "${version}"
$xml.Save($projectPath)
}
function Compress-Distribution {
param([string]$distName)
$version_fname_safe = $version.Replace(".", "p")
$zipFile = "gScript_${version_fname_safe}_${distName}.zip"
if (Test-Path -Path $zipFile) {
Remove-Item -Path $zipFile -Force
}
$sourceFolder = "builds\gScript - $distName\Volume\"
Compress-Archive -Path $sourceFolder -DestinationPath $zipFile
}
# Build the driver-agnostic parts first
LabVIEWCLI.exe -OperationName ExecuteBuildSpec -ProjectPath $lvproj -BuildSpecName "gScript Camera Helper"
LabVIEWCLI.exe -OperationName ExecuteBuildSpec -ProjectPath $lvproj -BuildSpecName "gScript Path Visualizer"
LabVIEWCLI.exe -OperationName ExecuteBuildSpec -ProjectPath $lvproj -BuildSpecName "gScript Pattern Recognition Tuner"
#Build the A3200 Distribution
Set-Gantry-Driver -DriverName "A3200" -ProjectPath $lvproj
Set-Build-Version -DriverName "A3200" -ProjectPath $lvproj
LabVIEWCLI.exe -OperationName ExecuteBuildSpec -ProjectPath $lvproj -BuildSpecName "gScript Interpreter"
LabVIEWCLI.exe -OperationName ExecuteBuildSpec -ProjectPath $lvproj -BuildSpecName "gScript - A3200"
Compress-Distribution -DistName A3200
#Build the AUTOMATION1 Distribution
Set-Gantry-Driver -DriverName "AUTOMATION1" -ProjectPath $lvproj
Set-Build-Version -DriverName "AUTOMATION1" -ProjectPath $lvproj
LabVIEWCLI.exe -OperationName ExecuteBuildSpec -ProjectPath $lvproj -BuildSpecName "gScript Interpreter"
LabVIEWCLI.exe -OperationName ExecuteBuildSpec -ProjectPath $lvproj -BuildSpecName "gScript - AUTOMATION1"
Compress-Distribution -DistName AUTOMATION1
Write-Host "Press any key to continue..."
Read-Host