[WASM] Add a parallel javac build to provide better errors.
JDT compile errors are not as descriptive as javac ones and users may not see javac errors unless they build the dependency explicitly.
@@ -63,12 +63,23 @@ def _impl_j2wasm_application(ctx):
progress_message = "Compiling wat2wasm",
)
+ # Trigger a parallel Javac build to provide better error messages than JDT.
+ ctx.actions.run_shell(
+ outputs = [ctx.outputs.validate],
+ arguments = [ctx.outputs.validate.path],
+ command = "touch $1",
+ inputs = _trigger_javac_build(ctx.attr.deps),
+ )
+
def _get_transitive_srcs(deps):
return depset(transitive = [d[J2wasmInfo]._private_.transitive_srcs for d in deps])
def _get_transitive_classpath(deps):
return depset(transitive = [d[J2wasmInfo]._private_.transitive_classpath for d in deps])
+def _trigger_javac_build(deps):
+ return depset(transitive = [d[J2wasmInfo]._private_.java_info.transitive_runtime_jars for d in deps])
+
j2wasm_application = rule(
implementation = _impl_j2wasm_application,
attrs = {
@@ -96,5 +107,6 @@ j2wasm_application = rule(
"zip": "%{name}.zip",
"wat": "%{name}.wat",
"wasm": "%{name}.wasm",
+ "validate": "%{name}.validate",
},
)
