Skip to content

Commit

Permalink
Remove some javacopt handling that was only being used in tests
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 323028597
  • Loading branch information
cushon authored and copybara-github committed Jul 24, 2020
1 parent b4540d8 commit 78db762
Showing 1 changed file with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -151,12 +150,6 @@ public JavaCompilationHelper(
disableStrictDeps);
}

@VisibleForTesting
JavaCompilationHelper(
RuleContext ruleContext, JavaSemantics semantics, JavaTargetAttributes.Builder attributes) {
this(ruleContext, semantics, getDefaultJavacOptsFromRule(ruleContext), attributes);
}

JavaTargetAttributes getAttributes() {
if (builtAttributes == null) {
builtAttributes = attributes.build();
Expand Down Expand Up @@ -815,26 +808,10 @@ public String getFixDepsTool() {
* Gets the value of the "javacopts" attribute combining them with the default options. If the
* current rule has no javacopts attribute, this method only returns the default options.
*/
@VisibleForTesting
public ImmutableList<String> getJavacOpts() {
private ImmutableList<String> getJavacOpts() {
return customJavacOpts;
}

/**
* Obtains the standard list of javac opts needed to build {@code rule}.
*
* <p>This method must only be called during initialization.
*
* @param ruleContext a rule context
* @return a list of options to provide to javac
*/
private static ImmutableList<String> getDefaultJavacOptsFromRule(RuleContext ruleContext) {
return ImmutableList.copyOf(
Iterables.concat(
JavaToolchainProvider.from(ruleContext).getJavacOptions(ruleContext),
ruleContext.getExpander().withDataLocations().tokenized("javacopts")));
}

public void setTranslations(Collection<Artifact> translations) {
Preconditions.checkArgument(!translationsFrozen);
this.translations.addAll(translations);
Expand Down

0 comments on commit 78db762

Please sign in to comment.