Skip to content

incompatible_java_common_parameters #12373

Closed
@comius

Description

@comius

Flag: --incompatible_java_common_parameters

Signature of java_common.compile is changed. Parameter host_javabase is removed.
Signature of java_common.pack_sources is changed. Parameters output_jar and host_javabase are removed.

Parameter host_javabase is not needed, because the value is passed together with java_toolchain argument.

Parameter output_jar was used to determine the name of resulting file, by replacing .jar to -src.jar in the file name. The resulting file of pack_sources can be specified directly using output_source_jar parameter.

Migration

Remove host_javabase argument from all invocations of java_common.compile and java_common.pack_sources.

In calls to java_common.pack_sources use output_source_jar parameter. For example:

+ source_jar_name = output_jar.basename[:-len(output_jar.extension)] + "-src.jar"
+ output_source_jar = ctx.actions.declare_file(source_jar_name, sibling = output_jar)
 java_common.pack_sources(
         actions,
-        output_jar = output_jar,
+        output_source_jar = output_source_jar,
         sources = sources,
         source_jars = source_jars,
         java_toolchain = java_toolchain,
-        host_javabase = host_javabase,
     )

The example shows how to translate old code to produce the same results, however there is often a nicer way to specify output_source_jar.

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)area-java-Starlark_APIjava_common, JavaInfo and other Starlark Java modulesincompatible-changeIncompatible/breaking changeteam-Rules-JavaIssues for Java rulestype: process

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions