Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 556306840
Change-Id: I2ebfeb0c864da50d1f36c1c6989f251c03a33bb8
  • Loading branch information
Googler authored and copybara-github committed Aug 12, 2023
1 parent 885edca commit c7a0907
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 77 deletions.
21 changes: 0 additions & 21 deletions src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -971,22 +971,6 @@ private Builder addTargetIncludingFileTargets(
return addTargetExceptFileTargets(target, mapping);
}

/** Adds symlinks to given artifacts at their exec paths. */
public Builder addSymlinksToArtifacts(NestedSet<Artifact> artifacts) {
// These are symlinks using the exec path, not the output-dir-relative path, which currently
// requires flattening.
return addSymlinksToArtifacts(artifacts.toList());
}

/** Adds symlinks to given artifacts at their exec paths. */
@CanIgnoreReturnValue
public Builder addSymlinksToArtifacts(Iterable<Artifact> artifacts) {
for (Artifact artifact : artifacts) {
addSymlink(artifact.getExecPath(), artifact);
}
return this;
}

/**
* Add extra middlemen artifacts that should be built by reverse dependency binaries. This
* method exists solely to support the unfortunate legacy behavior of some rules; new uses
Expand All @@ -999,11 +983,6 @@ public Builder addLegacyExtraMiddleman(Artifact middleman) {
return this;
}

/** Add the other {@link Runfiles} object transitively, but don't merge artifacts. */
public Builder mergeExceptArtifacts(Runfiles runfiles) {
return merge(runfiles, false);
}

private static Iterable<TransitiveInfoCollection> getNonDataDeps(RuleContext ruleContext) {
return Iterables.concat(
// TODO(bazel-team): This line shouldn't be here. Removing it requires that no rules have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
Expand Down Expand Up @@ -449,36 +448,6 @@ public static RunfilesSupport withExecutable(
computeActionEnvironment(ruleContext));
}

/**
* Creates and returns a {@link RunfilesSupport} object for the given rule and executable. Note
* that this method calls back into the passed in rule to obtain the runfiles.
*/
public static RunfilesSupport withExecutable(
RuleContext ruleContext, Runfiles runfiles, Artifact executable, List<String> appendingArgs)
throws InterruptedException {
return RunfilesSupport.create(
ruleContext,
executable,
runfiles,
computeArgs(ruleContext, CommandLine.of(appendingArgs)),
computeActionEnvironment(ruleContext));
}

/**
* Creates and returns a {@link RunfilesSupport} object for the given rule, executable, runfiles
* and args.
*/
public static RunfilesSupport withExecutable(
RuleContext ruleContext, Runfiles runfiles, Artifact executable, CommandLine appendingArgs)
throws InterruptedException {
return RunfilesSupport.create(
ruleContext,
executable,
runfiles,
computeArgs(ruleContext, appendingArgs),
computeActionEnvironment(ruleContext));
}

private static CommandLine computeArgs(RuleContext ruleContext, CommandLine additionalArgs)
throws InterruptedException {
if (!ruleContext.getRule().isAttrDefined("args", Type.STRING_LIST)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ public TargetAndConfiguration(Target target, @Nullable BuildConfigurationValue c
this.configuration = configuration;
}

// The node name in the graph. The name should be unique.
// It is not suitable for user display.
public String getName() {
return target.getLabel() + " "
+ (configuration == null ? "null" : configuration.checksum());
}

@Override
public boolean equals(Object that) {
if (this == that) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.packages.PackageSpecification.PackageGroupContents;
import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.skyframe.BuildConfigurationKey;
import com.google.devtools.build.lib.skyframe.ConfiguredTargetAndData;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -105,10 +104,6 @@ public BuildConfigurationValue getConfiguration() {
return configuration;
}

public BuildConfigurationKey getConfigurationKey() {
return configuration.getKey();
}

public NestedSet<PackageGroupContents> getVisibility() {
return visibility;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.google.devtools.build.lib.packages.Info;
import com.google.devtools.build.lib.packages.Provider;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.Arrays;
import java.util.LinkedHashMap;
import javax.annotation.Nullable;

Expand Down Expand Up @@ -88,10 +87,6 @@ public TransitiveInfoProviderMapBuilder add(TransitiveInfoProvider provider) {
return put(TransitiveInfoProviderEffectiveClassHelper.get(provider), provider);
}

public TransitiveInfoProviderMapBuilder add(TransitiveInfoProvider... providers) {
return addAll(Arrays.asList(providers));
}

@CanIgnoreReturnValue
public TransitiveInfoProviderMapBuilder addAll(TransitiveInfoProviderMap other) {
for (int i = 0; i < other.getProviderCount(); ++i) {
Expand All @@ -100,14 +95,6 @@ public TransitiveInfoProviderMapBuilder addAll(TransitiveInfoProviderMap other)
return this;
}

@CanIgnoreReturnValue
public TransitiveInfoProviderMapBuilder addAll(Iterable<TransitiveInfoProvider> providers) {
for (TransitiveInfoProvider provider : providers) {
add(provider);
}
return this;
}

@Nullable
public <P extends TransitiveInfoProvider> P getProvider(Class<P> providerClass) {
return providerClass.cast(providers.get(providerClass));
Expand Down

0 comments on commit c7a0907

Please sign in to comment.