diff options
author | 2015-08-19 16:59:22 +0000 | |
---|---|---|
committer | 2015-08-20 14:49:25 +0000 | |
commit | f292aa028a63b549a7933d98ab89a2f3a66c110e (patch) | |
tree | ce8d822202b27978ff8e4c42482b28118b3b75f3 /src/main | |
parent | e2033b1d28d3f17c7e307f62b2b13c3eed72a7f6 (diff) |
Teach java_import about runtime_deps.
--
MOS_MIGRATED_REVID=101033383
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaImportRule.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaImportRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaImportRule.java index e1ebaec46b..645ea88b4f 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaImportRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaImportRule.java @@ -25,11 +25,18 @@ import com.google.devtools.build.lib.bazel.rules.java.BazelJavaRuleClasses.IjarB import com.google.devtools.build.lib.packages.RuleClass; import com.google.devtools.build.lib.packages.RuleClass.Builder; import com.google.devtools.build.lib.rules.java.JavaImportBaseRule; +import com.google.devtools.build.lib.rules.java.JavaSemantics; + +import java.util.Set; /** * Rule definition for the java_import rule. */ public final class BazelJavaImportRule implements RuleDefinition { + + private static final Set<String> ALLOWED_DEPS = + ImmutableSet.of("java_library", "java_import", "cc_library", "cc_binary"); + @Override public RuleClass build(Builder builder, RuleDefinitionEnvironment env) { return builder @@ -39,10 +46,18 @@ public final class BazelJavaImportRule implements RuleDefinition { See <a href="#java_library.exports">java_library.exports</a>. <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ .add(attr("exports", LABEL_LIST) - .allowedRuleClasses(ImmutableSet.of( - "java_library", "java_import", "cc_library", "cc_binary")) + .allowedRuleClasses(ALLOWED_DEPS) .allowedFileTypes() // none allowed .validityPredicate(ANY_EDGE)) + /* <!-- #BLAZE_RULE(java_import).ATTRIBUTE(runtime_deps) --> + Libraries to make available to the final binary or test at runtime only. + ${SYNOPSIS} + See <a href="#$java_rule.runtime_deps">java_library.runtime_deps</a>. + <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ + .add(attr("runtime_deps", LABEL_LIST) + .allowedFileTypes(JavaSemantics.JAR) + .allowedRuleClasses(ALLOWED_DEPS) + .skipAnalysisTimeFileTypeCheck()) .build(); } |