-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpack.ps1
107 lines (84 loc) · 2.14 KB
/
pack.ps1
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
param(
[Parameter(Mandatory=$true)]
[string]$Platform,
[Parameter(Mandatory=$true)]
[string]$Configuration
)
$Platform = $Platform.ToLowerInvariant();
$outDir = (Join-Path $PSScriptRoot "out\$Configuration")
mkdir -Force $outDir | Out-Null
function Get-LxMonikaProjectPlatform(
[string]$Platform
)
{
switch ($Platform)
{
"x86" { return "Win32" }
default { return $Platform }
}
}
function Get-LxMonikaArtifact(
[string]$Project,
[string]$File
)
{
$ProjectPlatform = Get-LxMonikaProjectPlatform($Platform)
return Join-Path "$PSScriptRoot\$Project\bin\$Configuration\$ProjectPlatform" $File
}
function Clear-Directory(
[string]$Path
)
{
if (Test-Path $Path)
{
Remove-Item -Recurse -Force $Path
}
New-Item -Path $Path -ItemType Directory | Out-Null
}
# Binaries
$binDir = (Join-Path $outDir "bin\$Platform")
Clear-Directory $binDir
Copy-Item `
-Path (Get-LxMonikaArtifact "monika" "monika.exe") `
-Destination $binDir
$binaryExts = @(".sys", ".cer")
foreach ($ext in $binaryExts)
{
Copy-Item `
-Path (Get-LxMonikaArtifact "lxmonika" "lxmonika$ext") `
-Destination $binDir
}
foreach ($ext in $binaryExts)
{
Copy-Item `
-Path (Get-LxMonikaArtifact "lxstub" "LXCORE$ext") `
-Destination $binDir
}
# Includes
$includeDir = (Join-Path $outDir "Include")
Clear-Directory $includeDir
Copy-Item `
-Recurse `
-Path "$PSScriptRoot\lxmonika\include" `
-Destination (Join-Path $includeDir "lxmonika")
# LIBs
$libDir = (Join-Path $outDir "Lib\$Platform")
Clear-Directory $libDir
Copy-Item `
-Path (Get-LxMonikaArtifact "lxmonika" "lxmonika.lib") `
-Destination $libDir
Copy-Item `
-Path (Get-LxMonikaArtifact "lxstub" "LXCORE.lib") `
-Destination $libDir
# PDBs
$pdbDir = (Join-Path $outDir "Debug\$Platform")
Clear-Directory $pdbDir
Copy-Item `
-Path (Get-LxMonikaArtifact "monika" "monika.pdb") `
-Destination $pdbDir
Copy-Item `
-Path (Get-LxMonikaArtifact "lxmonika" "lxmonika.pdb") `
-Destination $pdbDir
Copy-Item `
-Path (Get-LxMonikaArtifact "lxstub" "LXCORE.pdb") `
-Destination $pdbDir