diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7de8ea35..87a64e9f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,9 @@ jobs: permissions: contents: read env: + JAVA_TOOL_OPTIONS: >- + -XX:+UseCompactObjectHeaders + -XX:+UseStringDeduplication GRADLE_OPTS: -Dorg.gradle.daemon=false defaults: run: @@ -155,7 +158,7 @@ jobs: - name: Publish Nightly Release (upload assets) uses: softprops/action-gh-release@v2 with: - tag_name: nightly # tag now points at $GITHUB_SHA + tag_name: nightly prerelease: true draft: false make_latest: "false" @@ -167,4 +170,3 @@ jobs: fail_on_unmatched_files: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/Wurstpack/wurstscript/grill.cmd b/Wurstpack/wurstscript/grill.cmd index 9a4dc5aab..76b86578a 100644 --- a/Wurstpack/wurstscript/grill.cmd +++ b/Wurstpack/wurstscript/grill.cmd @@ -1,30 +1,40 @@ @echo off -setlocal EnableExtensions +setlocal -rem ---- shared slim runtime ---- -set "RUNTIME=%USERPROFILE%\.wurst\wurst-runtime\bin\java.exe" +rem Save current code page +for /f "tokens=2 delims=: " %%A in ('chcp') do set "_OLDCP=%%A" -rem script directory (trailing backslash) +rem Switch to UTF-8 for this session +chcp 65001 >NUL + +rem Resolve script dir set "DIR=%~dp0" -if not exist "%RUNTIME%" ( - echo [wurstscript] ERROR: Runtime not found: - echo(%RUNTIME% - echo Reinstall Wurstscript via the VSCode extension. - exit /b 1 +set "JAVA=%DIR%wurst-runtime\bin\java.exe" +set "GRILL_JAR=%DIR%grill\grill.jar" + +if not exist "%GRILL_JAR%" ( + echo [grill] ERROR: Missing jar. Searched: + echo %GRILL_JAR% + rem fallback to ../grill if you want: + set "GRILL_JAR=%DIR%..\grill\grill.jar" + if not exist "%GRILL_JAR%" ( + echo %GRILL_JAR% + goto :restore + ) ) -rem ---- fixed jar location(s), no wildcards ---- -set "JAR=%DIR%grill\grill.jar" -if not exist "%JAR%" set "JAR=%DIR%..\grill\grill.jar" -if not exist "%JAR%" ( - echo [grill] ERROR: Missing jar: - echo(%DIR%grill\grill.jar - echo or - echo(%DIR%..\grill\grill.jar - exit /b 1 +if not exist "%JAVA%" ( + echo [grill] ERROR: Bundled runtime not found or not executable at: + echo %JAVA% + echo Please reinstall wurstscript via the VS Code extension. + goto :restore ) -rem Optional JVM flags via env var, e.g. set WURST_JAVA_OPTS=-Xmx1g -"%RUNTIME%" %WURST_JAVA_OPTS% -jar "%JAR%" %* +"%JAVA%" -Dfile.encoding=UTF-8 -jar "%GRILL_JAR%" %* + +:restore +rem Restore previous code page if we captured it +if defined _OLDCP chcp %_OLDCP% >NUL + endlocal diff --git a/Wurstpack/wurstscript/wurstscript.cmd b/Wurstpack/wurstscript/wurstscript.cmd index 9523637b7..0fecaf520 100644 --- a/Wurstpack/wurstscript/wurstscript.cmd +++ b/Wurstpack/wurstscript/wurstscript.cmd @@ -1,30 +1,36 @@ @echo off -setlocal EnableExtensions +setlocal -rem ---- shared slim runtime ---- -set "RUNTIME=%USERPROFILE%\.wurst\wurst-runtime\bin\java.exe" +rem Save current code page +for /f "tokens=2 delims=: " %%A in ('chcp') do set "_OLDCP=%%A" + +rem Switch to UTF-8 +chcp 65001 >NUL -rem script directory (trailing backslash) set "DIR=%~dp0" +set "JAVA=%DIR%wurst-runtime\bin\java.exe" +set "JAR=%DIR%wurst-compiler\wurstscript.jar" -if not exist "%RUNTIME%" ( - echo [wurstscript] ERROR: Runtime not found: - echo(%RUNTIME% - echo Reinstall Wurstscript via the VSCode extension. - exit /b 1 +if not exist "%JAR%" ( + set "JAR=%DIR%..\wurst-compiler\wurstscript.jar" ) -rem ---- fixed jar location(s), no wildcards ---- -set "JAR=%DIR%wurst-compiler\wurstscript.jar" -if not exist "%JAR%" set "JAR=%DIR%..\wurst-compiler\wurstscript.jar" if not exist "%JAR%" ( - echo [wurstscript] ERROR: Missing jar: - echo(%DIR%wurst-compiler\wurstscript.jar - echo or - echo(%DIR%..\wurst-compiler\wurstscript.jar - exit /b 1 + echo [wurstscript] ERROR: Missing jar. Searched: + echo %DIR%wurst-compiler\wurstscript.jar + echo %DIR%..\wurst-compiler\wurstscript.jar + goto :restore ) -rem Optional JVM flags via env var, e.g. set WURST_JAVA_OPTS=-Xmx1g -"%RUNTIME%" %WURST_JAVA_OPTS% -jar "%JAR%" %* +if not exist "%JAVA%" ( + echo [wurstscript] ERROR: Bundled runtime not found or not executable at: + echo %JAVA% + echo Please reinstall wurstscript via the VS Code extension. + goto :restore +) + +"%JAVA%" -Dfile.encoding=UTF-8 -jar "%JAR%" %* + +:restore +if defined _OLDCP chcp %_OLDCP% >NUL endlocal