Merge pull request #211 from eatkins/gc-output

Whitelist java9-rt-ext- output in rt export process
This commit is contained in:
Dale Wijnand 2018-02-13 13:02:16 +00:00 committed by GitHub
commit aa574a8f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,10 @@ public class Export {
if (destination.equals("--rt-ext-dir")) {
String v = System.getProperty("java.vendor") + "_" + System.getProperty("java.version");
v = v.replaceAll("\\W", "_").toLowerCase();
/*
* The launch script greps for output starting with "java9-rt-ext-" so changing this
* string will require changing the grep command in sbt-launch-lib.bash.
*/
Path rtExtDir = Paths.get(globalBase, "java9-rt-ext-" + v);
System.out.println(rtExtDir.toString());
System.exit(0);

View File

@ -234,8 +234,9 @@ copyRt() {
local at_least_9="$(expr $java_version ">=" 9)"
if [[ "$at_least_9" == "1" ]]; then
rtexport=$(rt_export_file)
# The grep for java9-rt-ext- matches the filename prefix printed in Export.java
java9_ext=$("$java_cmd" ${JAVA_OPTS} ${SBT_OPTS:-$default_sbt_opts} ${java_args[@]} \
-jar "$rtexport" --rt-ext-dir | grep -v Listening)
-jar "$rtexport" --rt-ext-dir | grep java9-rt-ext-)
java9_rt=$(echo "$java9_ext/rt.jar")
vlog "[copyRt] java9_rt = '$java9_rt'"
if [[ ! -f "$java9_rt" ]]; then