Skip to content

Commit

Permalink
Update BUILD files
Browse files Browse the repository at this point in the history
We're currently maintaining two sets of BUILD files; one at Google, and one
in the Git repository. We'd like to not do that. This change makes some of
the Bazel BUILD files more closely match their counterparts, in preparation
for removing the internal ones.

Closes bazelbuild#3094.

PiperOrigin-RevId: 158820490
  • Loading branch information
ulfjack authored and meteorcloudy committed Jun 13, 2017
1 parent 019935d commit 3e87c62
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 47 deletions.
44 changes: 23 additions & 21 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
# Bazel - Google's Build System

package(default_visibility = ["//scripts/release:__pkg__"])

exports_files(["LICENSE"])

filegroup(
name = "srcs",
srcs = glob(
["*"],
exclude = [
"bazel-*", # convenience symlinks
"out", # IntelliJ with setup-intellij.sh
"output", # output of compile.sh
".*", # mainly .git* files
],
) + [
"//examples:srcs",
"//scripts:srcs",
"//site:srcs",
"//src:srcs",
"//tools:srcs",
"//third_party:srcs",
],
visibility = ["//visibility:private"],
)

filegroup(
name = "git",
srcs = glob([".git/**"]),
Expand Down Expand Up @@ -29,27 +52,6 @@ filegroup(
],
)

filegroup(
name = "srcs",
srcs = glob(
["*"],
exclude = [
"bazel-*", # convenience symlinks
"out", # IntelliJ with setup-intellij.sh
"output", # output of compile.sh
".*", # mainly .git* files
],
) + [
"//examples:srcs",
"//scripts:srcs",
"//site:srcs",
"//src:srcs",
"//tools:srcs",
"//third_party:srcs",
],
visibility = ["//visibility:private"],
)

filegroup(
name = "bootstrap-derived-java-srcs",
srcs = glob(["derived/**/*.java"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@ java_library(
java_library(
name = "javac",
srcs = glob(
[
"javac/*.java",
],
["javac/*.java"],
exclude = [
"javac/JavacOptions.java",
],
),
deps = [
":invalid_command_line_exception",
":javac_options",
"//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins",
"//third_party:auto_value",
"//third_party:guava",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package(default_visibility = [":packages"])

package_group(
name = "packages",
packages = [
"//src/java_tools/buildjar/...",
],
)

package(default_visibility = [":packages"])

java_binary(
name = "GenClass",
main_class = "com.google.devtools.build.buildjar.genclass.GenClass",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package(default_visibility = [":packages"])

package_group(
name = "packages",
packages = [
"//src/java_tools/buildjar/...",
],
)

package(default_visibility = [":packages"])

JARHELPER_SRCS = [
"JarHelper.java",
"JarCreator.java",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package(default_visibility = [":packages"])

package_group(
name = "packages",
packages = ["//src/java_tools/buildjar/..."],
)

package(default_visibility = [":packages"])

java_binary(
name = "turbine",
srcs = ["Turbine.java"],
main_class = "com.google.devtools.build.java.turbine.Turbine",
visibility = ["//visibility:public"],
runtime_deps = [":turbine_main"],
)

java_library(
name = "turbine_main",
srcs = ["Turbine.java"],
deps = [
"//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac:javac_turbine",
"//third_party:guava",
Expand All @@ -19,6 +24,7 @@ java_binary(

filegroup(
name = "srcs",
srcs = glob(["**"]) + ["//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac:srcs"],
visibility = ["//src/java_tools/buildjar:__pkg__"],
srcs = glob(["**"]) + [
"//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac:srcs",
],
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package(default_visibility = [":packages"])

package_group(
name = "packages",
packages = ["//src/java_tools/buildjar/..."],
)

package(default_visibility = [":packages"])

java_library(
name = "javac_turbine",
srcs = ["JavacTurbine.java"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Description:
# Tests for tools for working with Java source code
package(default_visibility = ["//src:__subpackages__"])

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
filegroup(
name = "srcs",
srcs = glob(["**"]) + ["//src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/javac:srcs"],
visibility = ["//src/java_tools/buildjar:__pkg__"],
)
package(default_visibility = [":packages"])

package_group(
name = "packages",
packages = ["//src/java_tools/buildjar/..."],
)

package(default_visibility = [":packages"])
filegroup(
name = "srcs",
srcs = glob(["**"]) + [
"//src/java_tools/buildjar/javatests/com/google/devtools/build/java/turbine/javac:srcs",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ java_test(
],
tags = ["jdk8"],
deps = [
"//src/java_tools/buildjar/java/com/google/devtools/build/buildjar:JarOwner",
"//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac:javac_turbine",
"//src/main/protobuf:deps_java_proto",
"//third_party:asm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ DEFAULT_VISIBILITY = [
"//src/java_tools/junitrunner:__subpackages__",
]

licenses(["notice"]) # Apache 2.0

# Libraries
# =========================================================
java_library(
Expand Down Expand Up @@ -46,6 +44,7 @@ java_binary(

# Tests
# =========================================================

java_test(
name = "AllTests",
args = glob(["**/*Test.java"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ DEFAULT_VISIBILITY = [

package(default_visibility = DEFAULT_VISIBILITY)

licenses(["notice"]) # Apache 2.0

java_library(
name = "testbed",
testonly = 1,
Expand Down
3 changes: 3 additions & 0 deletions src/java_tools/singlejar/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Description:
# SingleJar combines multiple zip files and additional files
# into a single zip file.
package(default_visibility = ["//src:__subpackages__"])

filegroup(
Expand Down

0 comments on commit 3e87c62

Please sign in to comment.