Skip to content

Commit

Permalink
Remove more traces of the defaults package
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 241030747
  • Loading branch information
cushon authored and copybara-github committed Mar 29, 2019
1 parent b3934f6 commit e937767
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,15 @@
package com.google.devtools.build.lib.analysis.config;

import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.common.options.OptionDefinition;
import com.google.devtools.common.options.Options;
import com.google.devtools.common.options.OptionsBase;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;

/** Command-line build options for a Blaze module. */
public abstract class FragmentOptions extends OptionsBase implements Cloneable, Serializable {
/**
* Returns the labels contributed to the defaults package by this fragment.
*
* <p>The set of keys returned by this function should be constant, however, the values are
* allowed to change depending on the value of the options.
*/
@SuppressWarnings("unused")
public Map<String, Set<Label>> getDefaultsLabels() {
return ImmutableMap.of();
}

@Override
public FragmentOptions clone() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

/** Test-related options. */
public class TestConfiguration extends Fragment {
Expand Down Expand Up @@ -232,12 +231,6 @@ public static class TestOptions extends FragmentOptions {
+ "tools/test/test-setup.sh as on other platforms. On other platforms: no-op.")
public boolean windowsNativeTestWrapper;

@Override
public Map<String, Set<Label>> getDefaultsLabels() {
return ImmutableMap.<String, Set<Label>>of(
"coverage_support", ImmutableSet.of(coverageSupport),
"coverage_report_generator", ImmutableSet.of(coverageReportGenerator));
}

@Override
public FragmentOptions getHost() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
import com.google.devtools.common.options.OptionEffectTag;
import com.google.devtools.common.options.OptionMetadataTag;
import com.google.devtools.common.options.OptionsParsingException;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/** Command-line options for C++. */
public class CppOptions extends FragmentOptions {
Expand Down Expand Up @@ -896,24 +893,6 @@ public FragmentOptions getHost() {
return host;
}

@Override
public Map<String, Set<Label>> getDefaultsLabels() {
Set<Label> crosstoolLabels = new LinkedHashSet<>();
crosstoolLabels.add(crosstoolTop);
if (hostCrosstoolTop != null) {
crosstoolLabels.add(hostCrosstoolTop);
}

if (libcTopLabel != null) {
Label libcLabel = libcTopLabel;
if (libcLabel != null) {
crosstoolLabels.add(libcLabel);
}
}

return ImmutableMap.of("CROSSTOOL", crosstoolLabels);
}

/**
* Returns true if targets under this configuration should apply FDO.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package com.google.devtools.build.lib.rules.java;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration.LabelConverter;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration.LabelListConverter;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration.LabelMapConverter;
Expand All @@ -32,10 +31,8 @@
import com.google.devtools.common.options.OptionEffectTag;
import com.google.devtools.common.options.OptionMetadataTag;
import com.google.devtools.common.options.TriState;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/** Command-line options for building Java targets */
public class JavaOptions extends FragmentOptions {
Expand Down Expand Up @@ -741,12 +738,4 @@ public FragmentOptions getHost() {
return host;
}

@Override
public Map<String, Set<Label>> getDefaultsLabels() {
Map<String, Set<Label>> result = new HashMap<>();
result.put("JDK", ImmutableSet.of(javaBase, getHostJavaBase()));
result.put("JAVA_TOOLCHAIN", ImmutableSet.of(getJavaToolchain()));

return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.devtools.build.lib.analysis.BlazeDirectories;
Expand All @@ -28,7 +26,6 @@
import com.google.devtools.build.lib.analysis.config.BuildOptions;
import com.google.devtools.build.lib.analysis.config.FragmentOptions;
import com.google.devtools.build.lib.bazel.rules.DefaultBuildOptionsForDiffing;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.testutil.Scratch;
import com.google.devtools.build.lib.testutil.TestConstants;
import com.google.devtools.build.lib.util.ExitCode;
Expand All @@ -40,8 +37,6 @@
import com.google.devtools.common.options.OptionsParser;
import com.google.devtools.common.options.OptionsParsingResult;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -326,11 +321,5 @@ public MockFragmentOptions() {}
defaultValue = "false"
)
public boolean fakeOpt;

@Override
public Map<String, Set<Label>> getDefaultsLabels() {
return ImmutableMap.<String, Set<Label>>of(
"mock_target", ImmutableSet.of(Label.parseAbsoluteUnchecked("//mock:target")));
}
}
}

0 comments on commit e937767

Please sign in to comment.