diff --git a/Wurstpack/wurstscript/grill b/Wurstpack/wurstscript/grill index f18724fc7..3aab1b3eb 100644 --- a/Wurstpack/wurstscript/grill +++ b/Wurstpack/wurstscript/grill @@ -1,3 +1,28 @@ -#!/bin/bash +#!/usr/bin/env bash +set -euo pipefail -java -jar ~/.wurst/WurstSetup.jar ${@:1:6} \ No newline at end of file +RUNTIME="$HOME/.wurst/wurst-runtime/bin/java" + +# Resolve script dir (absolute) +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +JAR="$DIR/grill/grill.jar" +if [[ ! -f "$JAR" ]]; then + JAR="$DIR/../grill/grill.jar" +fi + +if [[ ! -f "$JAR" ]]; then + echo "[grill] ERROR: Missing jar. Searched:" + echo " $DIR/grill/grill.jar" + echo " $DIR/../grill/grill.jar" + exit 2 +fi + +if [[ ! -x "$RUNTIME" ]]; then + echo "[grill] ERROR: Bundled runtime not found or not executable at:" + echo " $RUNTIME" + echo "Please reinstall wurstscript via the VSCode extension." + exit 3 +fi + +exec "$RUNTIME" -jar "$JAR" "$@" diff --git a/Wurstpack/wurstscript/grill.cmd b/Wurstpack/wurstscript/grill.cmd new file mode 100644 index 000000000..9a4dc5aab --- /dev/null +++ b/Wurstpack/wurstscript/grill.cmd @@ -0,0 +1,30 @@ +@echo off +setlocal EnableExtensions + +rem ---- shared slim runtime ---- +set "RUNTIME=%USERPROFILE%\.wurst\wurst-runtime\bin\java.exe" + +rem script directory (trailing backslash) +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 +) + +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 +) + +rem Optional JVM flags via env var, e.g. set WURST_JAVA_OPTS=-Xmx1g +"%RUNTIME%" %WURST_JAVA_OPTS% -jar "%JAR%" %* +endlocal diff --git a/Wurstpack/wurstscript/wrapper_config.toml b/Wurstpack/wurstscript/wrapper_config.toml deleted file mode 100644 index cd7131bbf..000000000 --- a/Wurstpack/wurstscript/wrapper_config.toml +++ /dev/null @@ -1,16 +0,0 @@ -# Values in MB. Comment out to use system java defaults. - -initial_heap_size = 512 -maximum_heap_size = 512 -# thread_stack_size = 1024 - -# Comment this out to select java automatically from system environment. -# java_path = "../java.exe" - -# Any further java run arguments (called before -jar). -# java_args = ["-client", "-disablesystemassertions"] -# -# Path of the folder containing the wurstscript.jar -# wurst_path = "C:\Users\YourName\.wurst\" -# -# Defaults to the location from the setup-app diff --git a/de.peeeq.wurstscript/deploy.gradle b/de.peeeq.wurstscript/deploy.gradle index 5a58ab6bb..50cf5c831 100644 --- a/de.peeeq.wurstscript/deploy.gradle +++ b/de.peeeq.wurstscript/deploy.gradle @@ -84,7 +84,7 @@ tasks.register("jdepsModules") { if (!detected.split(",").contains(jdwpModule)) { detected = detected + "," + jdwpModule } - + if (!extraJdkModules.isEmpty()) detected = detected + "," + extraJdkModules modulesTxt.get().asFile.text = detected @@ -176,6 +176,9 @@ tasks.register("assembleSlimCompilerDist", Copy) { tasks.named("assembleSlimCompilerDist", Copy) { t -> if (os.isWindows()) { from("../Wurstpack/wurstscript/wurstscript.cmd") { into(".") } + from("../Wurstpack/wurstscript/wurstscript") { into(".") } + from("../Wurstpack/wurstscript/grill.cmd") { into(".") } + from("../Wurstpack/wurstscript/grill") { into(".") } } else { from("../Wurstpack/wurstscript/wurstscript") { into(".")