From ffa5b7a65b41a6e5ed97602df21edfa3a1949e29 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 29 Oct 2024 15:15:34 +0100 Subject: [PATCH 1/4] Set wildcard classpath for windows start batch (#371) The generated start script for Windows consists of a huge classpath. This classpath was too long, resulting in an error when executing the start script. Using wildcard to include libraries shortens the classpath so that now error occurs when executing the start script. --- metafix-runner/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/metafix-runner/build.gradle b/metafix-runner/build.gradle index fe2f8d9b..c3637914 100644 --- a/metafix-runner/build.gradle +++ b/metafix-runner/build.gradle @@ -2,6 +2,16 @@ plugins { id 'application' } +application + startScripts { + doLast { + def winScriptFile = file getWindowsScript() + def winFileText = winScriptFile.text + winFileText = winFileText.replaceAll('set CLASSPATH=.*', 'rem original CLASSPATH declaration replaced, see https://github.com/metafacture/metafacture-fix/issues/371:\nset CLASSPATH=%APP_HOME%\\\\lib\\\\\\*') + winScriptFile.text = winFileText + } + } + dependencies { implementation project(':metafix') From be72f9861015bf7796821c1348e7d360e074cd1b Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 7 Nov 2024 10:44:14 +0100 Subject: [PATCH 2/4] Update metafix-runner/build.gradle Co-authored-by: Jens Wille --- metafix-runner/build.gradle | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/metafix-runner/build.gradle b/metafix-runner/build.gradle index c3637914..6a93ea71 100644 --- a/metafix-runner/build.gradle +++ b/metafix-runner/build.gradle @@ -4,12 +4,8 @@ plugins { application startScripts { - doLast { - def winScriptFile = file getWindowsScript() - def winFileText = winScriptFile.text - winFileText = winFileText.replaceAll('set CLASSPATH=.*', 'rem original CLASSPATH declaration replaced, see https://github.com/metafacture/metafacture-fix/issues/371:\nset CLASSPATH=%APP_HOME%\\\\lib\\\\\\*') - winScriptFile.text = winFileText - } + // See https://github.com/metafacture/metafacture-fix/issues/371 + classpath = files('*') } dependencies { From c8b280f5dfeb1fc61538afae3403e04fe3b14477 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 7 Nov 2024 15:09:53 +0100 Subject: [PATCH 3/4] Include the directive in already existing 'application' block (#371) --- metafix-runner/build.gradle | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/metafix-runner/build.gradle b/metafix-runner/build.gradle index 6a93ea71..94b63370 100644 --- a/metafix-runner/build.gradle +++ b/metafix-runner/build.gradle @@ -2,12 +2,6 @@ plugins { id 'application' } -application - startScripts { - // See https://github.com/metafacture/metafacture-fix/issues/371 - classpath = files('*') - } - dependencies { implementation project(':metafix') @@ -54,4 +48,9 @@ application { "-XX:StartFlightRecording=dumponexit=true,filename=${file}.jfr,settings=profile" ] } + + startScripts { + // See https://github.com/metafacture/metafacture-fix/issues/371 + classpath = files('*') + } } From a2fbff1c696acb340060830de3f4b3439049e8d0 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Fri, 8 Nov 2024 15:38:24 +0100 Subject: [PATCH 4/4] Disable up-to-date checks when creating start scripts. (#382) Gradle would produce the following error on Windows (while Linux is not affected): "Cannot access input property 'classpath' of task ':metafix-runner:startScripts'. Accessing unreadable inputs or outputs is not supported. Declare the task as untracked by using Task.doNotTrackState(). For more information, please refer to https://docs.gradle.org/8.10.2/userguide/incremental_build.html#sec:disable-state-tracking in the Gradle documentation." --- metafix-runner/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/metafix-runner/build.gradle b/metafix-runner/build.gradle index 94b63370..1179b5c9 100644 --- a/metafix-runner/build.gradle +++ b/metafix-runner/build.gradle @@ -52,5 +52,6 @@ application { startScripts { // See https://github.com/metafacture/metafacture-fix/issues/371 classpath = files('*') + doNotTrackState('Accessing unreadable inputs is not supported.') } }