-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgenerate.ps1
More file actions
28 lines (26 loc) · 884 Bytes
/
Copy pathgenerate.ps1
File metadata and controls
28 lines (26 loc) · 884 Bytes
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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
param(
[string]$Codegen = "dynwinrt-codegen",
[string]$Winmd
)
$ErrorActionPreference = "Stop"
if (Test-Path -LiteralPath $Codegen -PathType Leaf) {
$Codegen = (Resolve-Path -LiteralPath $Codegen).Path
} else {
$Codegen = (Get-Command $Codegen -ErrorAction Stop).Source
}
$arguments = @(
"generate",
"--class-name",
"Windows.ApplicationModel.Background.IBackgroundTask,Windows.ApplicationModel.Background.IBackgroundTaskInstance,Windows.Foundation.IStringable,Windows.Foundation.IClosable",
"--lang", "py",
"--output", (Join-Path $PSScriptRoot "generated")
)
if ($Winmd) {
$arguments += @("--winmd", (Resolve-Path -LiteralPath $Winmd).Path)
}
& $Codegen @arguments
if ($LASTEXITCODE -ne 0) {
throw "WinRT interface generation failed with exit code $LASTEXITCODE"
}