Skip to content

Commit

Permalink
Remove legacy sync-before-build setting
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 588495470
  • Loading branch information
Googler authored and copybara-github committed Dec 6, 2023
1 parent 87ddeb3 commit 5c531ff
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.google.idea.blaze.base.projectview.ProjectViewSet;
import com.google.idea.blaze.base.projectview.section.Glob;
import com.google.idea.blaze.base.projectview.section.sections.TestSourceSection;
import com.google.idea.blaze.base.qsync.settings.QuerySyncSettings;
import com.google.idea.blaze.base.scope.BlazeContext;
import com.google.idea.blaze.base.settings.BlazeImportSettings;
import com.google.idea.blaze.base.sync.SyncListener;
Expand Down Expand Up @@ -335,9 +334,6 @@ public DependencyTracker getDependencyTracker() {
public void enableAnalysis(BlazeContext context, Set<Label> projectTargets)
throws BuildException {
try {
if (QuerySyncSettings.getInstance().syncBeforeBuild()) {
syncWithCurrentSnapshot(context);
}
context.output(
PrintOutput.output(
"Building dependencies for:\n " + Joiner.on("\n ").join(projectTargets)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.google.idea.blaze.base.qsync.settings;

import com.google.idea.blaze.base.qsync.QuerySync;
import com.google.idea.common.experiments.BoolExperiment;
import com.intellij.openapi.options.BoundSearchableConfigurable;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.ui.DialogPanel;
Expand All @@ -36,9 +35,6 @@
/** A configuration page for the settings dialog for query sync. */
class QuerySyncConfigurable extends BoundSearchableConfigurable implements Configurable {

private static final BoolExperiment LEGACY_SYNC_BEFORE_BUILD =
new BoolExperiment("query.sync.before.build", false);

private final QuerySyncSettings settings = QuerySyncSettings.getInstance();

// Provides access to enableQuerySyncCheckBoxCell for other rows
Expand All @@ -54,7 +50,6 @@ public DialogPanel createPanel() {
p -> {
boolean enabledByExperimentFile =
QuerySync.useByDefault() ? false : QuerySync.isLegacyExperimentEnabled();
boolean syncBeforeBuildExperiment = LEGACY_SYNC_BEFORE_BUILD.getValue();
// Enable query sync checkbox
Row unusedEnableQuerySyncRow =
p.row(
Expand Down Expand Up @@ -129,46 +124,6 @@ public void set(Boolean selected) {
.enabledIf(ButtonKt.getSelected(enableQuerySyncCheckBoxCell));
return Unit.INSTANCE;
});
Row unusedSyncBeforeBuildOptionRow =
ip.row(
/* label= */ ((JLabel) null),
/* init= */ r -> {
Cell<JBCheckBox> syncBeforeBuildCheckBox =
r.checkBox("Sync automatically before building dependencies")
.bind(
/* componentGet= */ AbstractButton::isSelected,
/* componentSet= */ (jbCheckBox, selected) -> {
jbCheckBox.setSelected(selected);
return Unit.INSTANCE;
},
/* prop= */ new MutableProperty<Boolean>() {
@Override
public Boolean get() {
return settings.syncBeforeBuild()
|| syncBeforeBuildExperiment;
}

@Override
public void set(Boolean selected) {
settings.enableSyncBeforeBuild(selected);
}
});
if (!syncBeforeBuildExperiment) {
syncBeforeBuildCheckBox =
syncBeforeBuildCheckBox.enabledIf(
ButtonKt.getSelected(enableQuerySyncCheckBoxCell));
} else {
syncBeforeBuildCheckBox =
syncBeforeBuildCheckBox
.enabled(false)
.comment(
"This feature is forcefully enabled by the old flag"
+ " from the .intellij-experiments file. ",
UtilsKt.DEFAULT_COMMENT_WIDTH,
HyperlinkEventAction.HTML_HYPERLINK_INSTANCE);
}
return Unit.INSTANCE;
});
Row unusedBuildWorkingSetRow =
ip.row(
/* label= */ ((JLabel) null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ static class State {

public boolean showDetailedInformationInEditor = true;

public boolean syncBeforeBuild = false;

public boolean buildWorkingSet = false;

public boolean syncOnFileChanges = false;
Expand Down Expand Up @@ -82,14 +80,6 @@ public boolean showDetailedInformationInEditor() {
return state.showDetailedInformationInEditor;
}

public void enableSyncBeforeBuild(boolean syncBeforeBuild) {
state.syncBeforeBuild = syncBeforeBuild;
}

public boolean syncBeforeBuild() {
return state.syncBeforeBuild;
}

public void enableBuildWorkingSet(boolean buildWorkingSet) {
state.buildWorkingSet = buildWorkingSet;
}
Expand Down Expand Up @@ -149,7 +139,6 @@ public ImmutableMap<String, String> getApplicationSettings() {
builder.put(
"showDetailedInformationInEditor",
Boolean.toString(settings.showDetailedInformationInEditor()));
builder.put("syncBeforeBuild", Boolean.toString(settings.syncBeforeBuild()));
builder.put("buildWorkingSet", Boolean.toString(settings.buildWorkingSet()));
builder.put("syncOnFileChanges", Boolean.toString(settings.syncOnFileChanges()));
return builder.buildOrThrow();
Expand Down

0 comments on commit 5c531ff

Please sign in to comment.