lberki | 1161e73 | 2019-02-18 05:07:04 -0800 | [diff] [blame] | 1 | // Copyright 2019 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. |
| 14 | |
| 15 | package com.google.devtools.build.lib.analysis; |
| 16 | |
| 17 | import com.google.devtools.build.lib.analysis.configuredtargets.AbstractConfiguredTarget; |
| 18 | import com.google.devtools.build.lib.cmdline.Label; |
| 19 | import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; |
| 20 | import com.google.devtools.build.lib.collect.nestedset.Order; |
| 21 | import com.google.devtools.build.lib.packages.InfoInterface; |
| 22 | import com.google.devtools.build.lib.packages.Provider; |
| 23 | import com.google.devtools.build.lib.skyframe.BuildConfigurationValue; |
| 24 | import javax.annotation.Nullable; |
| 25 | |
| 26 | /** A configured target that is empty. */ |
| 27 | public class EmptyConfiguredTarget extends AbstractConfiguredTarget { |
| 28 | public EmptyConfiguredTarget(Label label, BuildConfigurationValue.Key configurationKey) { |
| 29 | super(label, configurationKey, NestedSetBuilder.emptySet(Order.STABLE_ORDER)); |
| 30 | } |
| 31 | |
| 32 | @Nullable |
| 33 | @Override |
| 34 | protected InfoInterface rawGetSkylarkProvider(Provider.Key providerKey) { |
| 35 | return null; |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | protected Object rawGetSkylarkProvider(String providerKey) { |
| 40 | return null; |
| 41 | } |
janakr | 02be4c5 | 2019-03-17 20:33:11 -0700 | [diff] [blame] | 42 | |
| 43 | @Override |
| 44 | public String toString() { |
| 45 | return "Empty" + super.toString(); |
| 46 | } |
lberki | 1161e73 | 2019-02-18 05:07:04 -0800 | [diff] [blame] | 47 | } |