Skip to content

Commit

Permalink
Move the addition of lint jars behind an experiment
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 450071707
  • Loading branch information
Googler authored and copybara-github committed May 20, 2022
1 parent 5fe9ab5 commit 4f851e4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
import com.google.idea.blaze.base.sync.libraries.BlazeLibraryCollector;
import com.google.idea.blaze.base.sync.libraries.LintCollector;
import com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder;
import com.google.idea.common.experiments.FeatureRolloutExperiment;
import com.intellij.openapi.project.Project;
import java.io.File;
import java.util.Objects;

/** {@inheritDoc} Collecting lint rule jars from {@code AarLibrary} */
public class AndroidLintCollector implements LintCollector {
public static final FeatureRolloutExperiment lintEnabled =
new FeatureRolloutExperiment("blaze.android.libraries.lint.enabled");

@Override
public ImmutableList<File> collectLintJars(Project project, BlazeProjectData blazeProjectData) {
Expand All @@ -42,4 +45,9 @@ public ImmutableList<File> collectLintJars(Project project, BlazeProjectData bla
.filter(Objects::nonNull)
.collect(toImmutableList());
}

@Override
public boolean isEnabled() {
return lintEnabled.isEnabled();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ public interface LintCollector {

ImmutableList<File> collectLintJars(Project project, BlazeProjectData blazeProjectData);

boolean isEnabled();

static ImmutableList<File> getLintJars(Project project, BlazeProjectData blazeProjectData) {
return EP_NAME
.extensions()
.filter(ep -> ep.isEnabled())
.map(ep -> ep.collectLintJars(project, blazeProjectData))
.flatMap(List::stream)
.collect(toImmutableList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@

# Flags used by ASwB
# Use Studio's deployer: b/197761450
aswb.use.studio.deployer=0
aswb.use.studio.deployer=0

# Enable lint check
blaze.java.libraries.lint.enabled=10
blaze.android.libraries.lint.enabled=10
118 changes: 0 additions & 118 deletions java/src/com/google/idea/blaze/java/libraries/JavaLintCollector.java

This file was deleted.

0 comments on commit 4f851e4

Please sign in to comment.