Skip to content

Commit

Permalink
Set --enable-preview in jvmArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfussenegger authored and mergify[bot] committed Nov 16, 2022
1 parent 0042a3b commit 518bc3e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ task(run, dependsOn: 'classes', type: JavaExec) {
enableAssertions = true
classpath = sourceSets.main.runtimeClasspath
args = ["-Cpath.home=${rootDir}/sandbox/crate"]
jvmArgs = ["--enable-preview"]
}

task createCrateNodeScripts(type: CreateStartScripts) {
Expand Down
3 changes: 3 additions & 0 deletions app/src/bin/crate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ if NOT "%CRATE_HEAP_DUMP_PATH%" == "" (
set JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=%CRATE_HEAP_DUMP_PATH%
)

REM See https://github.com/elastic/elasticsearch/issues/90526
set JAVA_OPTS=%JAVA_OPTS% --enable-preview

if "%CRATE_CLASSPATH%" == "" (
set CRATE_CLASSPATH=%CRATE_HOME%/lib/*
) else (
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/dist/bin/crate
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ if [ "x$CRATE_HEAP_DUMP_PATH" != "x" ]; then
JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=$CRATE_HEAP_DUMP_PATH"
fi

# See https://github.com/elastic/elasticsearch/issues/90526
JAVA_OPTS="$JAVA_OPTS --enable-preview"

if [ "$(uname -s)" = "Darwin" ]; then
JAVA="$CRATE_HOME/jdk/Contents/Home/bin/java"
Expand Down
2 changes: 2 additions & 0 deletions gradle/javaModule.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ tasks.withType(JavaCompile) {
sourceCompatibility = jdks.runtime.major()
targetCompatibility = jdks.runtime.major()
}

tasks.withType(JavaExec) {
if (System.getProperty('useSystemJdk') == null) {
executable = jdks.runtime.getBinJavaPath()
Expand Down Expand Up @@ -130,6 +131,7 @@ tasks.withType(Test) {
test.dependsOn jdks.runtime
test.executable = jdks.runtime.getBinJavaPath()
}
jvmArgs = ["--enable-preview"]

// by default `-D` arguments are "caught" in the gradle process
// and not passed-through to the test process.
Expand Down

0 comments on commit 518bc3e

Please sign in to comment.