aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/RuleClass.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/RuleClass.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
index 0abecd2fdc..d83246871d 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -615,6 +615,7 @@ public class RuleClass {
private final Map<String, Attribute> attributes = new LinkedHashMap<>();
private final Set<Label> requiredToolchains = new HashSet<>();
private boolean supportsPlatforms = true;
+ private OutputFile.Kind outputFileKind = OutputFile.Kind.FILE;
/**
* Constructs a new {@code RuleClassBuilder} using all attributes from all
@@ -734,6 +735,7 @@ public class RuleClass {
supportsConstraintChecking,
requiredToolchains,
supportsPlatforms,
+ outputFileKind,
attributes.values());
}
@@ -1080,6 +1082,18 @@ public class RuleClass {
}
/**
+ * Sets the kind of output files this rule creates.
+ * DO NOT USE! This only exists to support the non-open-sourced {@code fileset} rule.
+ * {@see OutputFile.Kind}.
+ */
+ public Builder setOutputFileKind(OutputFile.Kind outputFileKind) {
+ this.outputFileKind = outputFileKind;
+ return this;
+ }
+
+
+
+ /**
* Declares that instances of this rule are compatible with the specified environments,
* in addition to the defaults declared by their environment groups. This can be overridden
* by rule-specific declarations. See
@@ -1264,6 +1278,7 @@ public class RuleClass {
@Nullable private final Label ruleDefinitionEnvironmentLabel;
@Nullable private final String ruleDefinitionEnvironmentHashCode;
+ private final OutputFile.Kind outputFileKind;
/**
* The set of configuration fragments which are legal for this rule's implementation to access.
@@ -1328,6 +1343,7 @@ public class RuleClass {
boolean supportsConstraintChecking,
Set<Label> requiredToolchains,
boolean supportsPlatforms,
+ OutputFile.Kind outputFileKind,
Collection<Attribute> attributes) {
this.name = name;
this.key = key;
@@ -1350,6 +1366,7 @@ public class RuleClass {
this.optionReferenceFunction = optionReferenceFunction;
this.ruleDefinitionEnvironmentLabel = ruleDefinitionEnvironmentLabel;
this.ruleDefinitionEnvironmentHashCode = ruleDefinitionEnvironmentHashCode;
+ this.outputFileKind = outputFileKind;
validateNoClashInPublicNames(attributes);
this.attributes = ImmutableList.copyOf(attributes);
this.workspaceOnly = workspaceOnly;
@@ -2174,6 +2191,11 @@ public class RuleClass {
return supportsPlatforms;
}
+ @Nullable
+ public OutputFile.Kind getOutputFileKind() {
+ return outputFileKind;
+ }
+
public static boolean isThirdPartyPackage(PackageIdentifier packageIdentifier) {
if (!packageIdentifier.getRepository().isMain()) {
return false;