From d0d212b64a07031079db63e46ceba6031460dbe3 Mon Sep 17 00:00:00 2001 From: Connection Refused Date: Sat, 16 Oct 2021 13:12:31 +0800 Subject: [PATCH] [Scripts] Update build.ps1 --- build.ps1 | 30 ++++++++++++++++-------------- deps.ps1 | 15 --------------- 2 files changed, 16 insertions(+), 29 deletions(-) delete mode 100644 deps.ps1 diff --git a/build.ps1 b/build.ps1 index 2869f40b..d3bfc6c4 100644 --- a/build.ps1 +++ b/build.ps1 @@ -24,20 +24,26 @@ param ( Push-Location (Split-Path $MyInvocation.MyCommand.Path -Parent) -if ( Test-Path -Path "$OutputPath" ) { - rm -Recurse -Force "$OutputPath" +if ( Test-Path -Path $OutputPath ) { + rm -Recurse -Force $OutputPath } -New-Item -ItemType Directory -Name "$OutputPath" | Out-Null +New-Item -ItemType Directory -Name $OutputPath | Out-Null -.\deps.ps1 "$OutputPath" -if ( -Not $? ) { exit $lastExitCode } +Push-Location $OutputPath +New-Item -ItemType Directory -Name 'bin' | Out-Null +New-Item -ItemType Directory -Name 'mode' | Out-Null +New-Item -ItemType Directory -Name 'i18n' | Out-Null +Pop-Location -if ( -Not ( Test-Path '.\Other\release\aiodns.bin' ) ) { +if ( -Not ( Test-Path '.\Other\release' ) ) { .\Other\build.ps1 if ( -Not $? ) { exit $lastExitCode } } +cp -Force '.\Other\release\*.bin' "$OutputPath\bin" +cp -Force '.\Other\release\*.dll' "$OutputPath\bin" +cp -Force '.\Other\release\*.exe' "$OutputPath\bin" Write-Host Write-Host 'Building Netch' @@ -54,7 +60,7 @@ dotnet publish ` '.\Netch\Netch.csproj' if ( -Not $? ) { exit $lastExitCode } -if ( -Not (Test-Path ".\Redirector\bin\$Configuration\Redirector.bin" ) ) { +if ( -Not ( Test-Path ".\Redirector\bin\$Configuration" ) ) { Write-Host Write-Host 'Building Redirector' @@ -64,8 +70,10 @@ if ( -Not (Test-Path ".\Redirector\bin\$Configuration\Redirector.bin" ) ) { '.\Redirector\Redirector.vcxproj' if ( -Not $? ) { exit $lastExitCode } } +cp -Force ".\Redirector\bin\$Configuration\nfapi.dll" "$OutputPath\bin" +cp -Force ".\Redirector\bin\$Configuration\Redirector.bin" "$OutputPath\bin" -if ( -Not (Test-Path ".\RouteHelper\bin\$Configuration\RouteHelper.bin" ) ) { +if ( -Not ( Test-Path ".\RouteHelper\bin\$Configuration" ) ) { Write-Host Write-Host 'Building RouteHelper' @@ -75,12 +83,6 @@ if ( -Not (Test-Path ".\RouteHelper\bin\$Configuration\RouteHelper.bin" ) ) { '.\RouteHelper\RouteHelper.vcxproj' if ( -Not $? ) { exit $lastExitCode } } - -cp -Force '.\Other\release\*.bin' "$OutputPath\bin" -cp -Force '.\Other\release\*.dll' "$OutputPath\bin" -cp -Force '.\Other\release\*.exe' "$OutputPath\bin" -cp -Force ".\Redirector\bin\$Configuration\nfapi.dll" "$OutputPath\bin" -cp -Force ".\Redirector\bin\$Configuration\Redirector.bin" "$OutputPath\bin" cp -Force ".\RouteHelper\bin\$Configuration\RouteHelper.bin" "$OutputPath\bin" if ( $Configuration.Equals('Release') ) { diff --git a/deps.ps1 b/deps.ps1 deleted file mode 100644 index eec18711..00000000 --- a/deps.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -param ( - [string] - $OutputPath = 'release' -) - -if ( -Not ( Test-Path -Path "$OutputPath" ) ) { - New-Item -ItemType Directory -Name "$OutputPath" | Out-Null -} - -Push-Location "$OutputPath" -New-Item -ItemType Directory -Name 'bin' | Out-Null -New-Item -ItemType Directory -Name 'mode' | Out-Null -New-Item -ItemType Directory -Name 'i18n' | Out-Null -Pop-Location -exit 0 \ No newline at end of file