From db2adfaf7fd1fd8ec5ff5da7394dd5f78eb7fd4d Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 27 Dec 2025 12:22:27 -0800 Subject: [PATCH] Add support for `--add-exports` in JavacOptions --- .../rife/bld/operations/JavacOptions.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/rife/bld/operations/JavacOptions.java b/src/main/java/rife/bld/operations/JavacOptions.java index d8b5061..bbe9c90 100644 --- a/src/main/java/rife/bld/operations/JavacOptions.java +++ b/src/main/java/rife/bld/operations/JavacOptions.java @@ -46,6 +46,32 @@ public class JavacOptions extends ArrayList { return this; } + /** + * Specifies a package to be considered as exported from its defining + * module to additional modules or to all unnamed modules when the value + * of other-module is ALL-UNNAMED. + * + * @return this list of options + * @since 2.3.1 + */ + public JavacOptions addExports(String... modules) { + return addExports(Arrays.asList(modules)); + } + + /** + * Specifies a package to be considered as exported from its defining + * module to additional modules or to all unnamed modules when the value + * of other-module is ALL-UNNAMED. + * + * @return this list of options + * @since 2.3.1 + */ + public JavacOptions addExports(List modules) { + add("--add-exports"); + add(StringUtils.join(modules, ",")); + return this; + } + /** * Root modules to resolve in addition to the initial modules, * or all modules on the module path if a module is