-
Notifications
You must be signed in to change notification settings - Fork 82
/
Build-TypeSpec.ps1
39 lines (35 loc) · 1.03 KB
/
Build-TypeSpec.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
$ErrorActionPreference = "Stop"
Write-Host "Apply diff to core"
Push-Location ./core
try {
git checkout .
git apply ../core.diff --ignore-whitespace
} finally {
Pop-Location
}
Write-Host "Build JAR"
mvn clean install -P tsp --no-transfer-progress
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Host "Copy JAR and TypeSpec code to './typespec-extension' directory"
# Copy JAR
New-Item -ItemType File -Path ./typespec-extension/generator/http-client-generator/target/emitter.jar -Force
Copy-Item ./core/packages/http-client-java/generator/http-client-generator/target/emitter.jar ./typespec-extension/generator/http-client-generator/target/emitter.jar -Force
# Copy TypeScript code
Copy-Item -Path ./core/packages/http-client-java/emitter/src -Destination ./typespec-extension/ -Recurse -Force
Write-Host "Build and Pack typespec-java"
Push-Location ./typespec-extension/
try {
npm ci
npm run build
npm run lint
# npm run check-format
npm pack
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
finally {
Pop-Location
}