Installierbar als Remote-Extension via Gitea-Raw-URL, Updates per Klick. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 lines
1.7 KiB
PowerShell
41 lines
1.7 KiB
PowerShell
# Baut die Extension und aktualisiert das Repo-Listing (index.json) in dist/.
|
|
#
|
|
# Aufruf:
|
|
# .\build.ps1 # nutzt "blender" aus dem PATH
|
|
# .\build.ps1 -Blender "E:\...\blender.exe"
|
|
#
|
|
# Update-Workflow:
|
|
# 1. version in blender_manifest.toml erhoehen (und bl_info/version in der .py)
|
|
# 2. .\build.ps1
|
|
# 3. git add -A; git commit -m "vX.Y.Z"; git push
|
|
# 4. In Blender: Preferences -> Get Extensions -> Repo -> "Check for Updates"
|
|
|
|
param(
|
|
[string]$Blender = "blender"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$root = $PSScriptRoot
|
|
$stage = Join-Path $root "_extsrc"
|
|
$dist = Join-Path $root "dist"
|
|
|
|
if (Test-Path $stage) { Remove-Item -Recurse -Force $stage }
|
|
New-Item -ItemType Directory -Force -Path $stage | Out-Null
|
|
New-Item -ItemType Directory -Force -Path $dist | Out-Null
|
|
|
|
# Staging: Manifest + Addon-Code als __init__.py (Extension = Package)
|
|
Copy-Item (Join-Path $root "blender_manifest.toml") (Join-Path $stage "blender_manifest.toml")
|
|
Copy-Item (Join-Path $root "stylized_rock_generator.py") (Join-Path $stage "__init__.py")
|
|
|
|
Write-Host "== extension build ==" -ForegroundColor Cyan
|
|
& $Blender --command extension build --source-dir $stage --output-dir $dist
|
|
if ($LASTEXITCODE -ne 0) { throw "extension build fehlgeschlagen (Exit $LASTEXITCODE)" }
|
|
|
|
Write-Host "== server-generate (index.json) ==" -ForegroundColor Cyan
|
|
& $Blender --command extension server-generate --repo-dir $dist
|
|
if ($LASTEXITCODE -ne 0) { throw "server-generate fehlgeschlagen (Exit $LASTEXITCODE)" }
|
|
|
|
Remove-Item -Recurse -Force $stage
|
|
Write-Host "Fertig. dist/ enthaelt Zip + index.json." -ForegroundColor Green
|
|
Get-ChildItem $dist | Select-Object Name, Length | Format-Table -AutoSize
|