From d559ebd9aba39e1ae0df18f590f68b028470f864 Mon Sep 17 00:00:00 2001 From: cushon Date: Mon, 12 Nov 2018 01:06:16 -0800 Subject: [PATCH] Prepare to remove support for resource_jars PiperOrigin-RevId: 221051445 --- .../build/lib/rules/java/JavaCommon.java | 5 +++++ .../build/lib/rules/java/JavaConfiguration.java | 6 ++++++ .../build/lib/rules/java/JavaOptions.java | 16 +++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java index 76ec54af7a6449..71514396685b3e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java @@ -609,6 +609,11 @@ public JavaTargetAttributes.Builder initCommon( } if (ruleContext.attributes().has("resource_jars", BuildType.LABEL_LIST)) { + if (ruleContext.getFragment(JavaConfiguration.class).disallowResourceJars()) { + ruleContext.attributeError( + "resource_jars", + "resource_jars are not supported; use java_import and deps or runtime_deps instead."); + } javaTargetAttributes.addResourceJars( PrerequisiteArtifacts.nestedSet(ruleContext, "resource_jars", Mode.TARGET)); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java index fe694f443f9bab..06be3cdd113ab9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java @@ -171,6 +171,7 @@ public boolean alwaysGenerateOutputMapping() { private final boolean jplPropagateCcLinkParamsStore; private final ImmutableList