Skip to content

Commit 2171634

Browse files
committed
Avoid creating JPMS module jars for now
As we move to using rules_jvm_external, we will encounter some hiccups with modules provided by third parties. Skirt around that by disabling JPMS module generation for now.
1 parent ccc9a3b commit 2171634

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

java/private/maven_artifacts.bzl

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ def _maven_artifacts_impl(ctx):
66
info = target[MavenInfo]
77

88
# Merge together all the binary jars
9-
temp_bin_jar = ctx.actions.declare_file("%s-temp.jar" % ctx.attr.name)
10-
combine_jars(ctx, ctx.executable._singlejar, info.artifact_jars.to_list(), temp_bin_jar)
9+
bin_jar = ctx.outputs.binjar
10+
combine_jars(ctx, ctx.executable._singlejar, info.artifact_jars.to_list(), bin_jar)
1111
src_jar = ctx.outputs.srcjar
1212
combine_jars(ctx, ctx.executable._singlejar, info.source_jars.to_list(), src_jar)
1313

14-
# Now generate the module info
15-
module_jar = ctx.actions.declare_file("%s-module.jar" % ctx.attr.name)
16-
17-
args = ctx.actions.args()
18-
args.add_all(["--coordinates", ctx.attr.maven_coordinates])
19-
args.add_all(["--in", temp_bin_jar.path])
20-
args.add_all(["--out", module_jar.path])
21-
if len(ctx.attr.module_uses_services) > 0:
22-
args.add_all(ctx.attr.module_uses_services, before_each = "--uses")
23-
24-
paths = [file.path for file in target[GatheredJavaModuleInfo].module_jars.to_list()]
25-
if len(paths) > 0:
26-
args.add_all(["--module-path", ctx.host_configuration.host_path_separator.join(paths)])
27-
if len(ctx.attr.module_exclude_patterns) > 0:
28-
args.add_all(ctx.attr.module_exclude_patterns, before_each = "--exclude")
29-
30-
ctx.actions.run(
31-
mnemonic = "BuildModuleJar",
32-
inputs = [temp_bin_jar] + target[GatheredJavaModuleInfo].module_jars.to_list(),
33-
outputs = [module_jar],
34-
executable = ctx.executable._generate_module,
35-
arguments = [args],
36-
)
37-
38-
# Now merge the module info and the binary jars
39-
combine_jars(ctx, ctx.executable._singlejar, [temp_bin_jar, module_jar], ctx.outputs.binjar)
14+
# # Now generate the module info
15+
# module_jar = ctx.actions.declare_file("%s-module.jar" % ctx.attr.name)
16+
#
17+
# args = ctx.actions.args()
18+
# args.add_all(["--coordinates", ctx.attr.maven_coordinates])
19+
# args.add_all(["--in", temp_bin_jar.path])
20+
# args.add_all(["--out", module_jar.path])
21+
# if len(ctx.attr.module_uses_services) > 0:
22+
# args.add_all(ctx.attr.module_uses_services, before_each = "--uses")
23+
#
24+
# paths = [file.path for file in target[GatheredJavaModuleInfo].module_jars.to_list()]
25+
# if len(paths) > 0:
26+
# args.add_all(["--module-path", ctx.host_configuration.host_path_separator.join(paths)])
27+
# if len(ctx.attr.module_exclude_patterns) > 0:
28+
# args.add_all(ctx.attr.module_exclude_patterns, before_each = "--exclude")
29+
#
30+
# ctx.actions.run(
31+
# mnemonic = "BuildModuleJar",
32+
# inputs = [temp_bin_jar] + target[GatheredJavaModuleInfo].module_jars.to_list(),
33+
# outputs = [module_jar],
34+
# executable = ctx.executable._generate_module,
35+
# arguments = [args],
36+
# )
37+
#
38+
# # Now merge the module info and the binary jars
39+
# combine_jars(ctx, ctx.executable._singlejar, [temp_bin_jar, module_jar], ctx.outputs.binjar)
4040

4141
defaultInfo = target[DefaultInfo]
4242

0 commit comments

Comments
 (0)