Files
Commonwealth-Online-Public/scripts/setup-ultralight-link.ps1
T
Andrew Zambazos 5bbcccee2c Add Ultralight SDK submodule and update scripts
Add Ultralight SDK as a git submodule (ThirdParty/Ultralight-SDK, Windows branch) and update build/deploy tooling and docs to use the vendored SDK by default. Updated .gitmodules and added the submodule pointer; build-prismaui.bat and deploy-all.bat now default UL_SDK to the submodule path and build-prismaui.bat checks the submodule is initialized. The PowerShell linker script (scripts/setup-ultralight-link.ps1) now falls back to ThirdParty/Ultralight-SDK when no SdkPath is provided. Documentation and developer log updated (docs/setup.md, plugin/setup.md, docs/dev-log.md) to document submodule initialization and usage; ULTRALIGHT_SDK_PATH can still override the default. Run 'git submodule update --init --recursive' on clones to initialize the SDK.
2026-06-11 14:16:41 +12:00

42 lines
1.3 KiB
PowerShell

param(
[string]$SdkPath = ""
)
$ErrorActionPreference = "Stop"
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$repoRoot = Split-Path -Parent $scriptDir
if ([string]::IsNullOrWhiteSpace($SdkPath)) {
$SdkPath = Join-Path $repoRoot "ThirdParty\Ultralight-SDK"
}
$frameworkBuild = Join-Path $repoRoot "ThirdParty\framework-F4-Conversion\build"
$linkPath = Join-Path $frameworkBuild "ultralight-1.4.0"
if (-not (Test-Path $SdkPath)) {
Write-Error "Ultralight SDK not found at: $SdkPath"
}
foreach ($required in @("include", "lib", "bin", "resources")) {
$candidate = Join-Path $SdkPath $required
if (-not (Test-Path $candidate)) {
Write-Error "Ultralight SDK is missing required folder: $candidate"
}
}
New-Item -ItemType Directory -Path $frameworkBuild -Force | Out-Null
if (Test-Path $linkPath) {
$item = Get-Item $linkPath -Force
if ($item.Attributes -band [IO.FileAttributes]::ReparsePoint) {
Write-Host "Removing existing junction: $linkPath"
cmd /c rmdir "$linkPath" | Out-Null
} else {
Write-Error "Expected a junction at $linkPath but found a normal directory. Remove it manually and rerun."
}
}
Write-Host "Linking $linkPath -> $SdkPath"
cmd /c mklink /J "$linkPath" "$SdkPath" | Out-Null
Write-Host "Ultralight SDK link ready."