blob: 856256eb142e351b72cbee0abe100db75fa9894d [file] [log] [blame]
cparsonse2d200f2018-03-06 16:15:11 -08001// Copyright 2014 The Bazel Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package com.google.devtools.build.lib.skyframe;
15
Googler1a159202024-07-25 07:03:28 -070016
janakrc9026912021-04-14 10:28:23 -070017import com.google.common.base.MoreObjects;
cparsonse2d200f2018-03-06 16:15:11 -080018import com.google.devtools.build.lib.analysis.ConfiguredTarget;
janakr876deaa2021-02-17 07:49:48 -080019import com.google.devtools.build.lib.analysis.ConfiguredTargetValue;
janakr459b2442018-06-05 10:26:02 -070020import com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget;
cparsonse2d200f2018-03-06 16:15:11 -080021import com.google.devtools.build.lib.collect.nestedset.NestedSet;
22import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
23import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
24import com.google.devtools.build.lib.packages.Package;
Googler1a159202024-07-25 07:03:28 -070025import com.google.devtools.build.lib.skyframe.serialization.VisibleForSerialization;
26import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
cparsonse2d200f2018-03-06 16:15:11 -080027import javax.annotation.Nullable;
28
janakrf3130e12018-03-21 11:46:30 -070029/** A non-rule configured target in the context of a Skyframe graph. */
cparsonse2d200f2018-03-06 16:15:11 -080030@Immutable
31@ThreadSafe
Googler1a159202024-07-25 07:03:28 -070032// Reached via OutputFileConfiguredTarget.
33@AutoCodec(explicitlyAllowClass = RuleConfiguredTarget.class)
Googler6e6e8622024-04-12 10:47:23 -070034public final class NonRuleConfiguredTargetValue
35 extends BaseRuleConfiguredTargetValue<ConfiguredTarget> implements ConfiguredTargetValue {
cparsonse2d200f2018-03-06 16:15:11 -080036
Googler1a159202024-07-25 07:03:28 -070037 @AutoCodec.Instantiator
38 @VisibleForSerialization
39 NonRuleConfiguredTargetValue(
40 ConfiguredTarget configuredTarget) {
41 // Transitive packages are not serialized.
42 this(configuredTarget, null);
43 }
44
cparsonse2d200f2018-03-06 16:15:11 -080045 NonRuleConfiguredTargetValue(
Googler720dc5f2022-09-16 03:43:51 -070046 ConfiguredTarget configuredTarget, @Nullable NestedSet<Package> transitivePackages) {
Googler6e6e8622024-04-12 10:47:23 -070047 super(configuredTarget, transitivePackages);
cparsonse2d200f2018-03-06 16:15:11 -080048 }
49
cparsonse2d200f2018-03-06 16:15:11 -080050 @Override
51 public String toString() {
Googler6e6e8622024-04-12 10:47:23 -070052 return MoreObjects.toStringHelper(this)
53 .add("configuredTarget", getConfiguredTarget())
54 .toString();
shahan52bb22a2018-09-02 08:39:50 -070055 }
cparsonse2d200f2018-03-06 16:15:11 -080056}