forked from netchx/netch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.ps1
35 lines (25 loc) · 1.04 KB
/
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
32
33
34
35
param([string]$buildtfm = 'all')
Write-Host 'DotNet SDK Version'
dotnet --version
$exe = 'Netch.exe'
$mainDir = (Get-Item -Path ".\").FullName
$net_baseoutput = "$mainDir\Netch\bin\$configuration"
Write-Host $mainDir
Write-Host $net_baseoutput
function Build-NetFrameworkx64
{
Write-Host 'Building .NET Framework x64'
$outdir = "$net_baseoutput\x64"
msbuild -v:m -m -t:Build /p:Configuration="Release" /p:Platform="x64" /p:TargetFramework=net48 /p:Runtimeidentifier=win-x64 /restore
if ($LASTEXITCODE) { cd $mainDir ; exit $LASTEXITCODE }
Write-Host 'Build x64 Completed, start copy bin, mode, i18n file'
Remove-Item -Recurse -Force "$net_baseoutput\x64\Release\win-x64\bin\tap-driver"
Copy-Item -Recurse "$mainDir\binaries\*" "$net_baseoutput\x64\Release\win-x64\bin"
Copy-Item -Recurse "$mainDir\modes\mode\*" "$net_baseoutput\x64\Release\win-x64\mode"
Copy-Item -Recurse "$mainDir\translations\i18n\*" "$net_baseoutput\x64\Release\win-x64\i18n"
Write-Host 'Build done'
}
cd $mainDir\Netch
Build-NetFrameworkx64
cd $mainDir
exit 0