Skip to content

Commit

Permalink
RELNOTES[INC]: Remove deprecated and unused `--experimental_show_arti…
Browse files Browse the repository at this point in the history
…facts` flag.

PiperOrigin-RevId: 543976073
Change-Id: Ia961518c6bc9f068d225ce9b8289d8ac8eab7b09
  • Loading branch information
meisterT authored and copybara-github committed Jun 28, 2023
1 parent 1c32e87 commit bdcd311
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,14 @@ public static class BuildGraveyardOptions extends OptionsBase {
effectTags = {OptionEffectTag.UNKNOWN},
help = "No-op.")
public boolean parallelAqueryOutput;

@Option(
name = "experimental_show_artifacts",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
help = "Deprecated no-op.")
public boolean showArtifacts;
}

/** This is where deprecated Bazel-specific options only used by the build command go to die. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,6 @@ public class BuildRequestOptions extends OptionsBase {
+ " under the threshold.")
public int maxResultTargets;

@Option(
name = "experimental_show_artifacts",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
help =
"Output a list of all top level artifacts produced by this build."
+ "Use output format suitable for tool consumption. "
+ "This flag is temporary and intended to facilitate Android Studio integration. "
+ "This output format will likely change in the future or disappear completely.")
public boolean showArtifacts;

@Option(
name = "announce",
defaultValue = "false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.analysis.configuredtargets.OutputFileConfiguredTarget;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.exec.ExecutionOptions;
import com.google.devtools.build.lib.runtime.BlazeRuntime;
import com.google.devtools.build.lib.runtime.CommandEnvironment;
Expand Down Expand Up @@ -360,41 +358,6 @@ private static String formatArtifactForShowResults(
return " " + prettyPrinter.getPrettyPath(artifact.getPath().asFragment());
}

/**
* Prints a flat list of all artifacts built by the passed top-level targets.
*
* <p>This corresponds to the --experimental_show_artifacts flag.
*/
void showArtifacts(
BuildRequest request,
Collection<ConfiguredTarget> configuredTargets,
Collection<ConfiguredAspect> aspects) {

TopLevelArtifactContext context = request.getTopLevelArtifactContext();
Collection<ConfiguredTarget> targetsToPrint = filterTargetsToPrint(configuredTargets);

NestedSetBuilder<Artifact> artifactsBuilder = NestedSetBuilder.stableOrder();
targetsToPrint.forEach(
t ->
artifactsBuilder.addTransitive(
TopLevelArtifactHelper.getAllArtifactsToBuild(t, context).getImportantArtifacts()));

aspects.forEach(
a ->
artifactsBuilder.addTransitive(
TopLevelArtifactHelper.getAllArtifactsToBuild(a, context).getImportantArtifacts()));

OutErr outErr = request.getOutErr();
outErr.printErrLn("Build artifacts:");

NestedSet<Artifact> artifacts = artifactsBuilder.build();
for (Artifact artifact : artifacts.toList()) {
if (!artifact.isSourceArtifact()) {
outErr.printErrLn(">>>" + artifact.getPath());
}
}
}

/**
* Returns a list of configured targets that should participate in printing.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,16 +576,6 @@ void nonCatastrophicFinalizations(
buildResultListener.getAnalyzedAspects());
}

try (SilentCloseable c = Profiler.instance().profile("Show artifacts")) {
if (request.getBuildOptions().showArtifacts) {
BuildResultPrinter buildResultPrinter = new BuildResultPrinter(env);
buildResultPrinter.showArtifacts(
request,
buildResultListener.getAnalyzedTargets(),
buildResultListener.getAnalyzedAspects().values());
}
}

if (explanationHandler != null) {
uninstallExplanationHandler(explanationHandler);
try {
Expand Down

0 comments on commit bdcd311

Please sign in to comment.