Skip to content

Commit

Permalink
Replace Constants.PRODUCT_NAME with a startup option --product_name=b…
Browse files Browse the repository at this point in the history
…azel and

(finally) delete Constants.java.

For bazel the file Constants.java is the only source of 
src/main/java/com/google/devtools/build/lib:common and since it was exporting
guava then many dependencies needed to be fixed.

--
MOS_MIGRATED_REVID=123648270
  • Loading branch information
lfpino authored and kchodorow committed May 31, 2016
1 parent dc54452 commit 623cdf8
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 93 deletions.
2 changes: 2 additions & 0 deletions src/main/cpp/blaze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ static vector<string> GetArgumentArray() {
globals->options.invocation_policy);
}

result.push_back("--product_name=" + globals->options.GetProductName());

globals->options.AddExtraOptions(&result);

// The option sources are transmitted in the following format:
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/google/devtools/build/docgen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ java_library(
deps = [
"//src/main/java/com/google/devtools/build/lib:android-rules",
"//src/main/java/com/google/devtools/build/lib:build-base",
"//src/main/java/com/google/devtools/build/lib:common",
"//src/main/java/com/google/devtools/build/lib:java-rules",
"//src/main/java/com/google/devtools/build/lib:packages",
"//src/main/java/com/google/devtools/build/lib:skylarkinterface",
Expand All @@ -31,7 +30,6 @@ java_binary(
":docgen_javalib",
"//src/main/java/com/google/devtools/build/lib:bazel-rules",
"//src/main/java/com/google/devtools/build/lib:build-base",
"//src/main/java/com/google/devtools/build/lib:common",
],
)

Expand Down
61 changes: 22 additions & 39 deletions src/main/java/com/google/devtools/build/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,11 @@ package(
default_visibility = ["//src:__subpackages__"],
)

java_library(
name = "common",
srcs = [
"Constants.java",
],
exports = ["//third_party:guava"],
deps = [
"//third_party:guava",
],
)

java_library(
name = "shell",
srcs = glob(["shell/*.java"]),
deps = [
":common",
"//third_party:guava",
],
)

Expand Down Expand Up @@ -57,7 +46,7 @@ java_library(
name = "graph",
srcs = glob(["graph/*.java"]),
deps = [
":common",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -74,8 +63,8 @@ java_library(
"//conditions:default": ["//src/main/native:libunix.so"],
}),
deps = [
":common",
":shell",
"//third_party:guava",
],
)

Expand All @@ -84,8 +73,8 @@ java_library(
name = "concurrent",
srcs = glob(["concurrent/*.java"]),
deps = [
":common",
":preconditions",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -98,8 +87,8 @@ java_library(
"collect/nestedset/*.java",
]),
deps = [
":common",
":preconditions",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand Down Expand Up @@ -130,11 +119,11 @@ java_library(
deps = [
":base-util",
":clock",
":common",
":concurrent",
":os_util",
":preconditions",
":unix",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -148,10 +137,10 @@ java_library(
"profiler/statistics/*.java",
]),
deps = [
":common",
":util",
":vfs",
"//src/main/java/com/google/devtools/build/lib/actions",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -162,11 +151,11 @@ java_library(
srcs = glob(["vfs/inmemoryfs/*.java"]),
deps = [
":clock",
":common",
":concurrent",
":preconditions",
":unix",
":vfs",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -193,8 +182,8 @@ java_library(
"util/VarInt.java",
],
deps = [
":common",
":preconditions",
"//third_party:guava",
],
)

Expand All @@ -203,7 +192,7 @@ java_library(
name = "preconditions",
srcs = ["util/Preconditions.java"],
deps = [
":common",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -214,9 +203,9 @@ java_library(
srcs = glob(["util/io/*.java"]),
deps = [
":clock",
":common",
":concurrent",
":vfs",
"//third_party:guava",
],
)

Expand Down Expand Up @@ -253,7 +242,6 @@ java_library(
deps = [
":base-util",
":collect",
":common",
":concurrent",
":exitcode-external",
":os_util",
Expand All @@ -262,6 +250,7 @@ java_library(
":unix",
":vfs",
"//src/main/java/com/google/devtools/common/options",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -281,11 +270,11 @@ java_library(
name = "events",
srcs = glob(["events/*.java"]),
deps = [
":common",
":concurrent",
":io",
":preconditions",
":vfs",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand Down Expand Up @@ -336,11 +325,11 @@ java_library(
srcs = glob(["cmdline/*.java"]),
deps = [
":base-util",
":common",
":concurrent",
":skylarkinterface",
":util",
":vfs",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand All @@ -353,7 +342,6 @@ java_library(
deps = [
":cmdline",
":collect",
":common",
":concurrent",
":events",
":skylarkinterface",
Expand All @@ -364,6 +352,7 @@ java_library(
"//third_party:asm-util",
"//third_party:auto_value",
"//third_party:bytebuddy",
"//third_party:guava",
"//third_party:jsr305",
],
)
Expand Down Expand Up @@ -400,7 +389,6 @@ java_library(
deps = [
":cmdline",
":collect",
":common",
":concurrent",
":events",
":skylarkinterface",
Expand Down Expand Up @@ -486,7 +474,6 @@ java_library(
":base-util",
":cmdline",
":collect",
":common",
":concurrent",
":events",
":exitcode-external",
Expand Down Expand Up @@ -536,7 +523,6 @@ java_library(
":build-base",
":build-info",
":collect",
":common",
":concurrent",
":events",
":ideinfo",
Expand Down Expand Up @@ -601,7 +587,6 @@ java_library(
srcs = glob(["bazel/commands/*.java"]),
resources = ["bazel/commands/fetch.txt"],
deps = [
":common",
":events",
":exitcode-external",
":java-rules",
Expand Down Expand Up @@ -681,13 +666,13 @@ java_library(
deps = [
":build-base",
":collect",
":common",
":concurrent",
":packages-internal",
":util",
":vfs",
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/rules/cpp",
"//third_party:guava",
"//third_party:jsr305",
"//third_party/protobuf",
],
Expand All @@ -701,7 +686,6 @@ java_library(
deps = [
":build-base",
":collect",
":common",
":concurrent",
":packages-internal",
":skylarkinterface",
Expand All @@ -728,7 +712,6 @@ java_library(
deps = [
":build-base",
":collect",
":common",
":concurrent",
":events",
":java-implicit-attributes",
Expand All @@ -741,6 +724,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/rules/cpp",
"//src/main/java/com/google/devtools/common/options",
"//src/main/protobuf:extra_actions_base_java_proto",
"//third_party:guava",
"//third_party:joda_time",
"//third_party:jsr305",
"//third_party/protobuf",
Expand All @@ -760,7 +744,6 @@ java_library(
deps = [
":build-base",
":collect",
":common",
":concurrent",
":events",
":java-rules",
Expand All @@ -775,6 +758,7 @@ java_library(
"//src/main/protobuf:android_deploy_info_java_proto",
"//src/main/protobuf:apk_manifest_java_proto",
"//third_party:android_sdklib",
"//third_party:guava",
"//third_party:jsr305",
"//third_party/protobuf",
],
Expand All @@ -788,7 +772,6 @@ java_library(
deps = [
":build-base",
":collect",
":common",
":concurrent",
":packages-internal",
":skylarkinterface",
Expand All @@ -799,6 +782,7 @@ java_library(
"//src/main/java/com/google/devtools/common/options",
"//src/main/protobuf:crosstool_config_java_proto",
"//src/main/protobuf:extra_actions_base_java_proto",
"//third_party:guava",
"//third_party:jsr305",
"//third_party/protobuf",
],
Expand All @@ -813,7 +797,6 @@ java_library(
":android-rules",
":build-base",
":collect",
":common",
":concurrent",
":java-rules",
":packages-internal",
Expand Down Expand Up @@ -855,7 +838,6 @@ java_library(
":clock",
":cmdline",
":collect",
":common",
":concurrent",
":events",
":exitcode-external",
Expand All @@ -879,6 +861,7 @@ java_library(
"//src/main/protobuf:command_server_java_proto",
"//src/main/protobuf:invocation_policy_java_proto",
"//src/main/protobuf:test_status_java_proto",
"//third_party:guava",
"//third_party:joda_time",
"//third_party:jsr305",
"//third_party/grpc:grpc-jar",
Expand All @@ -896,7 +879,6 @@ java_library(
name = "all-build-rules",
exports = [
":build-base",
":common",
":concurrent",
":graph",
":packages-internal",
Expand All @@ -905,6 +887,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/rules/objc",
"//src/main/java/com/google/devtools/common/options",
"//third_party:guava",
],
)

Expand All @@ -928,7 +911,6 @@ java_library(
java_library(
name = "query2",
exports = [
":common",
":concurrent",
":events",
":foundation",
Expand All @@ -939,6 +921,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/query2",
"//src/main/java/com/google/devtools/common/options",
"//src/main/protobuf:build_java_proto",
"//third_party:guava",
],
)

Expand Down
Loading

0 comments on commit 623cdf8

Please sign in to comment.