-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_test.ps1
81 lines (72 loc) · 2.36 KB
/
build_test.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
Set-Location $PSScriptRoot
# Compile in the `SdkTemplateOption` in `field-options.proto`
protoc --proto_path="../sdk/proto" --go_out="./" "../sdk/proto/services/options/field-options.proto"
go version
go mod vendor
# Support server work vs sdk work
$BuildTarget = "server" # "server", "sdk", "sdk-swift", "docs"
$ProcessorArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLower()
$BuildPath = "go-plugin/protoc-gen-sdk-$( If ($IsWindows)
{
'windows'
}
ElseIf ($IsLinux)
{
'linux'
}
ElseIf ($IsMacOS)
{
'darwin'
} )-${ProcessorArch}$( If ($IsWindows)
{
'.exe'
}
Else
{
''
} )"
go build -o $BuildPath
$RenamePairs = "trust-registry=trustregistry,universal-wallet=wallet,verifiable-credentials=credential,templates=template,access-management=access_management,file-management=file_management"
# Default to doing nothing
$PythonPath = "***SKIP***"
$DotnetPath = "***SKIP***"
$DashboardFrontendPath = "***SKIP***"
$DartPath = "***SKIP***"
$GolangPath = "***SKIP***"
$TypescriptPath = "***SKIP***"
$JavaKotlinPath = "***SKIP***"
$SwiftPath = "***SKIP***"
if ($BuildTarget -eq "sdk" -or $BuildTarget -eq "docs") {
$ProtoPath = "$PSScriptRoot/../sdk/proto"
$PythonPath = "$PSScriptRoot/../sdk/python/trinsic"
$DotnetPath = "$PSScriptRoot/../sdk/dotnet/Trinsic"
$DartPath = "$PSScriptRoot/../sdk/dart/lib/src"
$GolangPath = "$PSScriptRoot/../sdk/go/services"
$TypescriptPath = "$PSScriptRoot/../sdk/web/src"
$JavaKotlinPath = "$PSScriptRoot/../sdk/java/src/main/java/trinsic/services"
$DocsPath = "$PSScriptRoot/../sdk/docs/reference/services"
}
if ($BuildTarget -eq "sdk-swift" -or $BuildTarget -eq "docs")
{
$ProtoPath = "$PSScriptRoot/../sdk-swift/proto"
$SwiftPath = "$PSScriptRoot/../sdk-swift/Sources/Trinsic"
}
if ($BuildTarget -eq "server")
{
$ProtoPath = "$PSScriptRoot/../server/proto"
$DashboardFrontendPath = "$PSScriptRoot/../server/dashboard/app/src/services/Trinsic"
$DocsPath = "***SKIP***"
}
./action.ps1 `
-ProtoPath $ProtoPath `
-RenamePairs $RenamePairs `
-PythonPath $PythonPath `
-DotnetPath $DotnetPath `
-DashboardFrontendPath $DashboardFrontendPath `
-DartPath $DartPath `
-GolangPath $GolangPath `
-TypescriptPath $TypescriptPath `
-JavaKotlinPath $JavaKotlinPath `
-SwiftPath $SwiftPath `
-DocsPath $DocsPath `
-BuildTarget $BuildTarget