Skip to content

Commit

Permalink
Singlejar Created-By field does not include Bazel version
Browse files Browse the repository at this point in the history
Including the Bazel version in the tag reduces the effectiveness of remote caching if multiple developers use different versions of Bazel.

RELNOTES: None
PiperOrigin-RevId: 463085774
Change-Id: If606a33299e852f0d554fc9716c8a15fff37d3f5
  • Loading branch information
ted-xie authored and copybara-github committed Jul 25, 2022
1 parent f3211f0 commit 28dabbb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.BlazeVersionInfo;
import com.google.devtools.build.lib.analysis.FilesToRunProvider;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.actions.CustomCommandLine;
Expand Down Expand Up @@ -208,7 +207,7 @@ private void setSingleJarCreatedBy(RuleContext ruleContext, CustomCommandLine.Bu
if (ruleContext.getConfiguration().getFragment(BazelAndroidConfiguration.class) != null) {
// Only enabled for Bazel, not Blaze.
builder.add("--output_jar_creator");
builder.addDynamicString("Bazel " + BlazeVersionInfo.instance().getReleaseName());
builder.add("Bazel");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/analysis:actions/template",
"//src/main/java/com/google/devtools/build/lib/analysis:actions/template_expansion_action",
"//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster",
"//src/main/java/com/google/devtools/build/lib/analysis:blaze_version_info",
"//src/main/java/com/google/devtools/build/lib/analysis:config/build_configuration",
"//src/main/java/com/google/devtools/build/lib/analysis:config/build_options",
"//src/main/java/com/google/devtools/build/lib/analysis:config/compilation_mode",
Expand Down
7 changes: 2 additions & 5 deletions src/test/shell/bazel/android/android_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,10 @@ EOF
bazel clean
bazel build //java/com/example/hello:hello || fail "build failed"
jar xf bazel-bin/java/com/example/hello/hello.apk
# Check that the apk manifest contains Created-By: Bazel. Note that for
# custom-built bazel binaries, the field will say "Bazel development version".
# For official releases, the field will reflect the build label specified, for
# example "Bazel 5.2.0.".
# Check that the apk manifest contains Created-By: Bazel.
assert_contains "Created\-By: Bazel" META-INF/MANIFEST.MF
# Clean up the extracted manifest.
rm -rf META-INF/MANIFEST.MF
rm META-INF/MANIFEST.MF
}

function test_d8_dexes_hello_android() {
Expand Down

0 comments on commit 28dabbb

Please sign in to comment.