Ack Cut K0: portable cultmesh-kotlin build.ps1, pwsh interop harness, Kotlin parity note
build.ps1 picks kotlinc/kotlinc.bat and java/java.exe by platform and joins paths and the classpath with the platform separator, so it runs under PowerShell 7 on Linux (Yggdrasil's Kotlin verify image) and unchanged on Windows. The TypeScript interop harness invokes pwsh off Windows. The parity doc says twice that Kotlin does not yet conform to its RUDP claims until the ack campaign's Cut K lands. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9b8877ced7
commit
08a5fc783d
3 changed files with 14 additions and 8 deletions
|
|
@ -4,26 +4,28 @@ param(
|
|||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$onWindows = [Environment]::OSVersion.Platform -eq [PlatformID]::Win32NT
|
||||
$pathSeparator = [IO.Path]::PathSeparator
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
|
||||
$src = Join-Path $PSScriptRoot "src\main\kotlin"
|
||||
$out = Join-Path $repoRoot "artifacts\cultmesh-kotlin"
|
||||
$src = Join-Path $PSScriptRoot (Join-Path "src" (Join-Path "main" "kotlin"))
|
||||
$out = Join-Path (Join-Path $repoRoot "artifacts") "cultmesh-kotlin"
|
||||
$jarPath = Join-Path $out "cultmesh-kotlin.jar"
|
||||
$kotlinc = Join-Path $KotlinHome "bin\kotlinc.bat"
|
||||
$kotlinStdlib = Join-Path $KotlinHome "lib\kotlin-stdlib.jar"
|
||||
$java = Join-Path $JavaHome "bin\java.exe"
|
||||
$kotlinc = Join-Path (Join-Path $KotlinHome "bin") $(if ($onWindows) { "kotlinc.bat" } else { "kotlinc" })
|
||||
$kotlinStdlib = Join-Path (Join-Path $KotlinHome "lib") "kotlin-stdlib.jar"
|
||||
$java = Join-Path (Join-Path $JavaHome "bin") $(if ($onWindows) { "java.exe" } else { "java" })
|
||||
|
||||
if (-not (Test-Path $kotlinc)) { throw "kotlinc not found: $kotlinc" }
|
||||
if (-not (Test-Path $kotlinStdlib)) { throw "kotlin stdlib not found: $kotlinStdlib" }
|
||||
if (-not (Test-Path $java)) { throw "java not found: $java" }
|
||||
|
||||
$env:JAVA_HOME = $JavaHome
|
||||
$env:PATH = "$(Join-Path $JavaHome 'bin');$env:PATH"
|
||||
$env:PATH = "$(Join-Path $JavaHome 'bin')$pathSeparator$env:PATH"
|
||||
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $out
|
||||
New-Item -ItemType Directory -Force $out | Out-Null
|
||||
$sources = Get-ChildItem $src -Recurse -Filter *.kt | Select-Object -ExpandProperty FullName
|
||||
& $kotlinc @sources -jvm-target 1.8 -classpath $kotlinStdlib -d $jarPath
|
||||
if ($LASTEXITCODE -ne 0) { throw "kotlinc failed with exit code $LASTEXITCODE" }
|
||||
& $java -cp "$jarPath;$kotlinStdlib" org.gamecult.cultmesh.CultMeshKt
|
||||
& $java -cp "$jarPath$pathSeparator$kotlinStdlib" org.gamecult.cultmesh.CultMeshKt
|
||||
if ($LASTEXITCODE -ne 0) { throw "cultmesh-kotlin self-test failed with exit code $LASTEXITCODE" }
|
||||
Write-Host "Built $jarPath"
|
||||
|
|
|
|||
|
|
@ -2798,7 +2798,7 @@ async function runDotnetTestFilter(
|
|||
|
||||
async function buildKotlinInteropPeer(): Promise<void> {
|
||||
kotlinInteropPeerBuild ??= execFileAsync(
|
||||
"powershell",
|
||||
process.platform === "win32" ? "powershell" : "pwsh",
|
||||
["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", resolve(cultmeshKotlinRoot, "build.ps1")],
|
||||
{
|
||||
cwd: cultLibRoot,
|
||||
|
|
|
|||
Loading…
Reference in a new issue