forked from UbiquityDotNET/Llvm.Libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild-MetaPackage.ps1
More file actions
49 lines (42 loc) · 1.66 KB
/
Copy pathBuild-MetaPackage.ps1
File metadata and controls
49 lines (42 loc) · 1.66 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
using module "PSModules/CommonBuild/CommonBuild.psd1"
using module "PSModules/RepoBuild/RepoBuild.psd1"
<#
.SYNOPSIS
Builds the Meta package for the runtime libraries AND the handle source
.PARAMETER buildInfo
Optional hashtable of build information already created (Used by local loop Build-all script)
#>
Param(
[hashtable]$buildInfo
)
Push-location $PSScriptRoot
$oldPath = $env:Path
try
{
if(!$buildInfo)
{
$buildInfo = Initialize-BuildEnvironment
}
# Download and unpack the LLVM source from the versioned release tag if not already present
Clone-LlvmFromTag $buildInfo
# Always double check the source version matches expectations, this catches a bump in the script version
# but no download as the previous version is still there. (Mostly a local build problem but a major time
# waster if forgotten. So, test it here as early as possible.)
Assert-LlvmSourceVersion $buildInfo
# Build the meta package
Invoke-external dotnet pack (Join-Path $buildInfo['SrcRootPath'] 'Ubiquity.NET.LibLLVM' 'Ubiquity.NET.LibLLVM.csproj')
}
catch
{
# Everything from the official docs to the various articles in the blog-sphere says this isn't needed
# and in fact it is redundant - They're all WRONG! By re-throwing the exception the original location
# information is retained and the error reported will include the correct source file and line number
# data for the error. Without this, only the error message is retained and the location information is
# Line 1, Column 1, of the outer most script file, which is, of course, completely useless.
throw
}
finally
{
Pop-Location
$env:Path = $oldPath
}