File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,14 @@ echo ""
55
55
echo " Using JAVA_OPTS from the environment: ${JAVA_OPTS} "
56
56
echo " Using bazelrun_jvm_flags from the BUILD file: ${JVM_FLAGS} "
57
57
58
+ if [ -f " ${ADD_EXPORTS} " ]; then
59
+ echo " Using ADD_EXPORTS from the environment: ${ADD_EXPORTS} "
60
+ fi
61
+
62
+ if [ -f " ${ADD_OPENS} " ]; then
63
+ echo " Using ADD_OPENS from the environment: ${ADD_OPENS} "
64
+ fi
65
+
58
66
# main args
59
67
main_args=" $@ "
60
68
@@ -64,7 +72,7 @@ jar=${SPRINGBOOTJAR_FILENAME}
64
72
65
73
# assemble the command
66
74
# use exec so that we can pass signals to the underlying process (https://github.com/salesforce/rules_spring/issues/91)
67
- cmd=" exec ${java_cmd} ${JVM_FLAGS} ${JAVA_OPTS} -jar ${path}${jar} ${main_args} "
75
+ cmd=" exec ${java_cmd} ${JVM_FLAGS} ${JAVA_OPTS} ${ADD_EXPORTS} ${ADD_OPENS} -jar ${path}${jar} ${main_args} "
68
76
69
77
echo " Running ${cmd} "
70
78
echo " In directory $( pwd) "
Original file line number Diff line number Diff line change @@ -386,6 +386,8 @@ def springboot(
386
386
tags = [],
387
387
testonly = False ,
388
388
visibility = None ,
389
+ bazelrun_addopens = [],
390
+ bazelrun_addexports = [],
389
391
exclude = [], # deprecated
390
392
classpath_index = "@rules_spring//springboot:empty.txt" , # deprecated
391
393
use_build_dependency_order = True , # deprecated
@@ -585,6 +587,8 @@ def springboot(
585
587
name = genbazelrunenv_rule ,
586
588
cmd = "$(location @rules_spring//springboot:write_bazelrun_env.sh) " + name + " " + _get_springboot_jar_file_name (name )
587
589
+ " " + _get_relative_package_path () + " $@ " + _convert_starlarkbool_to_bashbool (bazelrun_background )
590
+ + " " + " " .join (["--add-exports=" + element for element in bazelrun_addexports ])
591
+ + " " + " " .join (["--add-opens=" + element for element in bazelrun_addopens ])
588
592
+ " " + bazelrun_jvm_flags ,
589
593
# message = "SpringBoot rule is writing the bazel run launcher env...",
590
594
tools = ["@rules_spring//springboot:write_bazelrun_env.sh" ],
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ SPRINGBOOTJAR_FILENAME=${2}
17
17
LABEL_PATH=${3}
18
18
OUTPUTFILE_PATH=${4}
19
19
DO_BACKGROUND=${5}
20
- FIRST_JVMFLAG_ARG=6
20
+ ADD_EXPORTS=${6}
21
+ ADD_OPENS=${7}
22
+ FIRST_JVMFLAG_ARG=8
21
23
22
24
if [ " $LABEL_PATH " == " root" ]; then
23
25
# token that indicates that the target is in the root path, which for the
@@ -43,4 +45,6 @@ echo "export RULE_NAME=$RULE_NAME" > $OUTPUTFILE_PATH
43
45
echo " export LABEL_PATH=$LABEL_PATH " >> $OUTPUTFILE_PATH
44
46
echo " export SPRINGBOOTJAR_FILENAME=$SPRINGBOOTJAR_FILENAME " >> $OUTPUTFILE_PATH
45
47
echo " export DO_BACKGROUND=$DO_BACKGROUND " >> $OUTPUTFILE_PATH
48
+ echo " export ADD_EXPORTS=$ADD_EXPORTS " >> $OUTPUTFILE_PATH
49
+ echo " export ADD_OPENS=$ADD_OPENS " >> $OUTPUTFILE_PATH
46
50
echo " export JVM_FLAGS=\" $JVM_FLAGS \" " >> $OUTPUTFILE_PATH
You can’t perform that action at this time.
0 commit comments