Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#9001 from jwnimmer-tri/buildifier
Browse files Browse the repository at this point in the history
workspace: Upgrade to buildifier 0.12.0
  • Loading branch information
jwnimmer-tri authored Jun 15, 2018
2 parents 6f48091 + c90e851 commit 723783a
Show file tree
Hide file tree
Showing 85 changed files with 813 additions and 397 deletions.
2 changes: 1 addition & 1 deletion examples/acrobot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/install:install_data.bzl", "install_data")
load(
Expand Down
2 changes: 1 addition & 1 deletion examples/compass_gait/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
Expand Down
2 changes: 1 addition & 1 deletion examples/double_pendulum/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
Expand Down
2 changes: 1 addition & 1 deletion examples/geometry_world/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load(
"@drake//tools/vector_gen:vector_gen.bzl",
Expand Down
2 changes: 1 addition & 1 deletion examples/kinova_jaco_arm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_library",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/kuka_iiwa_arm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_library",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
)
load(
"//tools/skylark:drake_py.bzl",
Expand Down
2 changes: 1 addition & 1 deletion examples/kuka_iiwa_arm/controlled_kuka/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

load(
"//tools:drake.bzl",
"drake_cc_library",
"drake_cc_binary",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/kuka_iiwa_arm/dev/box_rotation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

load(
"//tools:drake.bzl",
"drake_cc_library",
"drake_cc_binary",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_library",
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/kuka_iiwa_arm/dev/pick_and_place/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_library",
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/kuka_iiwa_arm/iiwa_world/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_library",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/acrobot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/bouncing_ball/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/inclined_plane/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/pendulum/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/particles/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
Expand Down
2 changes: 1 addition & 1 deletion examples/pendulum/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
Expand Down
2 changes: 1 addition & 1 deletion examples/pr2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_library",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/install:install_data.bzl", "install_data")
Expand Down
2 changes: 1 addition & 1 deletion examples/quadrotor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
Expand Down
2 changes: 1 addition & 1 deletion examples/rimless_wheel/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
Expand Down
2 changes: 1 addition & 1 deletion examples/rod2d/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load(
"@drake//tools/vector_gen:vector_gen.bzl",
Expand Down
2 changes: 1 addition & 1 deletion examples/schunk_wsg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion examples/van_der_pol/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"//tools:drake.bzl",
"drake_cc_library",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
2 changes: 1 addition & 1 deletion multibody/benchmarks/acrobot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

load(
"@drake//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
"drake_cc_googletest",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

Expand Down
3 changes: 2 additions & 1 deletion tools/clion/aspect.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Load the relevant upstream methods.
load(
"@intellij_aspect//:intellij_info_impl.bzl",
"make_intellij_info_aspect",
"intellij_info_aspect_impl",
"make_intellij_info_aspect",
)
load(
"@intellij_aspect//:intellij_info_bundled.bzl",
Expand Down Expand Up @@ -40,6 +40,7 @@ def _extra_ide_info(target, ctx, ide_info, ide_info_file, output_groups):
if includes == None:
# No includes exist, so we don't need to override them.
return False

# Place Drake's parent directory on CLion's include path.
includes.insert(0, additional_transitive_quote_include_directory)
return False
Expand Down
9 changes: 6 additions & 3 deletions tools/clion/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ def _impl(repository_ctx):
# Write out the path to a bzl constant.
bzl_content = [
'additional_transitive_quote_include_directory = "{}"'.format(
drake_workspace_parent),
drake_workspace_parent,
),
]
repository_ctx.file(
"BUILD.bazel",
content = "\n",
executable = False)
executable = False,
)
repository_ctx.file(
"path.bzl",
content = "".join(bzl_content),
executable = False)
executable = False,
)

def drake_clion_environment():
rule = repository_rule(
Expand Down
12 changes: 9 additions & 3 deletions tools/external_data/expose_all_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def expose_all_files(
@param sub_dirs
Any directories that are not packages.
"""

# @note It'd be nice if this could respect *ignore files, but meh.
# Also, it'd be **super** nice if Bazel did not let `**` globs leak into
# other packages and then error out.
Expand All @@ -76,17 +77,22 @@ def expose_all_files(
srcs = native.glob(patterns)
for sub_dir in sub_dirs:
srcs += native.glob([
sub_dir + "/" + pattern for pattern in patterns])
sub_dir + "/" + pattern
for pattern in patterns
])
native.filegroup(
name = name,
srcs = srcs,
# Trying to use `data = deps` here only exposes the files in
# runfiles, but not for expansion via `$(locations...)`.
visibility = visibility,
)

# Expose all files recursively (from one level).
deps = [package_prefix + sub_package + ":" + name + "_recursive"
for sub_package in sub_packages]
deps = [
package_prefix + sub_package + ":" + name + "_recursive"
for sub_package in sub_packages
]
recursive_filegroup(
name = name + "_recursive",
data = [name] + deps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

def _dirname(p, remove = 1):
# Returns parent directory name for a path `p`.
pieces = p.split('/')
return '/'.join(pieces[0:-remove])
pieces = p.split("/")
return "/".join(pieces[0:-remove])

def get_drake_path(workspace_dir):
"""Returns path of Drake. This is replaced under
Expand Down
5 changes: 4 additions & 1 deletion tools/external_data/test/external_data_workspace_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ load(
)
load(
"//tools/external_data/test:workspace_test.bzl",
"workspace_test",
"ARGS_DEFAULT",
"workspace_test",
)

_workspace_list = [
Expand Down Expand Up @@ -59,8 +59,10 @@ def collect_external_data_lint_files():
packages = ["//tools/external_data"]
for workspace in _workspace_list:
package = "@" + workspace + "//"

# Prepare to expose all files recursively.
packages.append(package)

# Join files for linting, to permit $(locations ...) expansion directly
# on transitive file dependencies.
for name in ["bazel_lint_files", "python_lint_files"]:
Expand All @@ -75,6 +77,7 @@ def add_external_data_test_repositories(workspace_dir):
Adds test workspace directories as repositories so that their files can be
consumed and their tests can be ignored by `bazel test ...` from Drake.
"""

# WARNING: Bazel also craps out here if `workspace_dir + path` is used
# rather than just `path`.
# N.B. This error is *stateful*. You will get different behavior depending
Expand Down
Loading

0 comments on commit 723783a

Please sign in to comment.