[java_common.compile] Always generate a source jar.
[Rolling forward https://github.com/bazelbuild/bazel/commit/c4e128e2c6d8cacaeba034d6a3195796d50f1745]
java_common.compile doesn't generate the output source jar when a source jar is
the only input for the compilation. This is wrong because the source jar can
include APT generated sources. It is also inconsistent with java_library and
leads to inconsistent Skylark rules where a declared output will not always have a
generating action.
This new behavior is guarded by a new flag --incompatible_generate_javacommon_source_jar.
RELNOTES: None.
PiperOrigin-RevId: 202648346
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java
index bea8aa7..5bd711b 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemantics.java
@@ -61,6 +61,8 @@
public abstract boolean incompatibleDisallowSlashOperator();
+ public abstract boolean incompatibleGenerateJavaCommonSourceJar();
+
public abstract boolean incompatibleNewActionsApi();
public abstract boolean incompatibleNoSupportToolsInActionInputs();
@@ -101,6 +103,7 @@
.incompatibleDisallowLegacyJavaInfo(false)
.incompatibleDisallowOldStyleArgsAdd(false)
.incompatibleDisallowSlashOperator(false)
+ .incompatibleGenerateJavaCommonSourceJar(false)
.incompatibleNewActionsApi(false)
.incompatibleNoSupportToolsInActionInputs(false)
.incompatiblePackageNameIsAFunction(false)
@@ -137,6 +140,8 @@
public abstract Builder incompatibleDisallowSlashOperator(boolean value);
+ public abstract Builder incompatibleGenerateJavaCommonSourceJar(boolean value);
+
public abstract Builder incompatibleNewActionsApi(boolean value);
public abstract Builder incompatibleNoSupportToolsInActionInputs(boolean value);