forked from yetone/avante.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.ps1
31 lines (24 loc) · 829 Bytes
/
Build.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
param (
[string]$Version = "luajit"
)
$BuildDir = "build"
$BuildFromSource = $true
function Build-FromSource($feature) {
if (-not (Test-Path $BuildDir)) {
New-Item -ItemType Directory -Path $BuildDir | Out-Null
}
cargo build --release --features=$feature
$targetTokenizerFile = "avante_tokenizers.dll"
$targetTemplatesFile = "avante_templates.dll"
Copy-Item (Join-Path "target\release\libavante_tokenizers.dll") (Join-Path $BuildDir $targetTokenizerFile)
Copy-Item (Join-Path "target\release\libavante_templates.dll") (Join-Path $BuildDir $targetTemplatesFile)
Remove-Item -Recurse -Force "target"
}
function Main {
Set-Location $PSScriptRoot
Write-Host "Building for $Version..."
Build-FromSource $Version
Write-Host "Completed!"
}
# Run the main function
Main