From 79b9e8ee7124599f8abe41279610c9a398c1a6e7 Mon Sep 17 00:00:00 2001 From: nx <4851913+Enzx@users.noreply.github.com> Date: Tue, 28 Apr 2026 01:43:13 +0200 Subject: [PATCH] cleanup: delete the upm script files --- scripts/build-upm-binary.ps1 | 11 --- scripts/build-upm.ps1 | 140 ----------------------------------- scripts/clean-upm.ps1 | 26 ------- 3 files changed, 177 deletions(-) delete mode 100644 scripts/build-upm-binary.ps1 delete mode 100644 scripts/build-upm.ps1 delete mode 100644 scripts/clean-upm.ps1 diff --git a/scripts/build-upm-binary.ps1 b/scripts/build-upm-binary.ps1 deleted file mode 100644 index 5d95269..0000000 --- a/scripts/build-upm-binary.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -Set-StrictMode -Version Latest -$ErrorActionPreference = 'Stop' - -$buildScript = Join-Path $PSScriptRoot 'build-upm.ps1' - -if (-not (Test-Path $buildScript)) { - throw "Build script not found: $buildScript" -} - -& $buildScript -Mode Binary - diff --git a/scripts/build-upm.ps1 b/scripts/build-upm.ps1 deleted file mode 100644 index 1333b74..0000000 --- a/scripts/build-upm.ps1 +++ /dev/null @@ -1,140 +0,0 @@ -param( - [ValidateSet('Source', 'Binary')] - [string]$Mode = 'Source' -) - -Set-StrictMode -Version Latest -$ErrorActionPreference = 'Stop' - -$repoRoot = Split-Path -Parent $PSScriptRoot -$sourceRoot = Join-Path $repoRoot 'NxGraph' -$projectPath = Join-Path $repoRoot 'NxGraph\NxGraph.csproj' -$packageRoot = Join-Path $repoRoot 'upm\com.enzx.nxgraph' -$runtimeRoot = Join-Path $packageRoot 'Runtime' -$stagedSourceRoot = Join-Path $runtimeRoot 'NxGraph' -$pluginsRoot = Join-Path $runtimeRoot 'Plugins' -$buildOutput = Join-Path $repoRoot 'NxGraph\bin\Release\netstandard2.1' - -function Clear-StagedSource { - if (Test-Path $stagedSourceRoot) { - Get-ChildItem -Path $stagedSourceRoot -Force -ErrorAction SilentlyContinue | - Remove-Item -Recurse -Force - } -} - -function Clear-StagedPlugins { - New-Item -ItemType Directory -Force -Path $pluginsRoot | Out-Null - Get-ChildItem -Path $pluginsRoot -File -ErrorAction SilentlyContinue | - Where-Object { $_.Name -ne '.gitkeep' } | - Remove-Item -Force -} - -function Stage-Source { - Write-Host "Staging NxGraph source for the Unity package..." -ForegroundColor Cyan - Write-Host "Source: $sourceRoot" - Write-Host "Package: $packageRoot" - - if (-not (Test-Path $sourceRoot)) { - throw "Source root not found: $sourceRoot" - } - - New-Item -ItemType Directory -Force -Path $stagedSourceRoot | Out-Null - Clear-StagedSource - Clear-StagedPlugins - - $directoriesToCopy = @( - 'Authoring', - 'Compatibility', - 'Diagnostics\Export', - 'Diagnostics\Replay', - 'Diagnostics\Validations', - 'Fsm', - 'Graphs' - ) - - foreach ($relativeDir in $directoriesToCopy) { - $src = Join-Path $sourceRoot $relativeDir - $dst = Join-Path $stagedSourceRoot $relativeDir - - if (-not (Test-Path $src)) { - throw "Expected source directory not found: $src" - } - - New-Item -ItemType Directory -Force -Path (Split-Path -Parent $dst) | Out-Null - Copy-Item -Path $src -Destination $dst -Recurse -Force - } - - $filesToCopy = @( - 'Result.cs', - 'ResultHelpers.cs' - ) - - foreach ($relativeFile in $filesToCopy) { - $src = Join-Path $sourceRoot $relativeFile - $dst = Join-Path $stagedSourceRoot $relativeFile - - if (-not (Test-Path $src)) { - throw "Expected source file not found: $src" - } - - Copy-Item -Path $src -Destination $dst -Force - } - - $excludedFiles = @( - (Join-Path $stagedSourceRoot 'Fsm\TracingObserver.cs') - ) - - foreach ($excluded in $excludedFiles) { - if (Test-Path $excluded) { - Remove-Item $excluded -Force - } - } - - Write-Host '' - Write-Host 'Unity package source staged successfully.' -ForegroundColor Green - Get-ChildItem -Path $stagedSourceRoot -Recurse -File | - Select-Object FullName | - ForEach-Object { $_.FullName.Replace($repoRoot + '\\', '') } -} - -function Stage-Binary { - Write-Host "Building NxGraph binary fallback for Unity package staging..." -ForegroundColor Cyan - Write-Host "Project: $projectPath" - Write-Host "Package: $packageRoot" - - if (-not (Test-Path $projectPath)) { - throw "Project not found: $projectPath" - } - - Clear-StagedSource - Clear-StagedPlugins - - dotnet build $projectPath -c Release -f netstandard2.1 - - $dllPath = Join-Path $buildOutput 'NxGraph.dll' - if (-not (Test-Path $dllPath)) { - throw "Build completed but NxGraph.dll was not found at $dllPath" - } - - Copy-Item $dllPath $pluginsRoot -Force - - $pdbPath = Join-Path $buildOutput 'NxGraph.pdb' - if (Test-Path $pdbPath) { - Copy-Item $pdbPath $pluginsRoot -Force - } - - $xmlPath = Join-Path $buildOutput 'NxGraph.xml' - if (Test-Path $xmlPath) { - Copy-Item $xmlPath $pluginsRoot -Force - } - - Write-Host '' - Write-Host 'Binary fallback staged successfully.' -ForegroundColor Green - Get-ChildItem -Path $pluginsRoot -File | Select-Object Name, Length | Format-Table -AutoSize -} - -switch ($Mode) { - 'Source' { Stage-Source } - 'Binary' { Stage-Binary } - default { throw "Unsupported mode: $Mode" } -} diff --git a/scripts/clean-upm.ps1 b/scripts/clean-upm.ps1 deleted file mode 100644 index 6651b20..0000000 --- a/scripts/clean-upm.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -Set-StrictMode -Version Latest -$ErrorActionPreference = 'Stop' - -$repoRoot = Split-Path -Parent $PSScriptRoot -$runtimeRoot = Join-Path $repoRoot 'upm\com.enzx.nxgraph\Runtime' -$stagedSourceRoot = Join-Path $runtimeRoot 'NxGraph' -$pluginsRoot = Join-Path $runtimeRoot 'Plugins' - -if (Test-Path $stagedSourceRoot) { - Get-ChildItem -Path $stagedSourceRoot -Force -ErrorAction SilentlyContinue | - Remove-Item -Recurse -Force - Write-Host "Cleaned staged Unity package sources in $stagedSourceRoot" -ForegroundColor Green -} -else { - Write-Host "Nothing to clean: $stagedSourceRoot does not exist." -ForegroundColor Yellow -} - -if (Test-Path $pluginsRoot) { - Get-ChildItem -Path $pluginsRoot -File -ErrorAction SilentlyContinue | - Where-Object { $_.Name -ne '.gitkeep' } | - Remove-Item -Force - Write-Host "Cleaned staged Unity package binaries in $pluginsRoot" -ForegroundColor Green -} -else { - Write-Host "Nothing to clean: $pluginsRoot does not exist." -ForegroundColor Yellow -}