Skip to content

Commit

Permalink
Move //tools/third_party to //third_party
Browse files Browse the repository at this point in the history
This better matches Bazel conventions, and paves the way for
tools to stop being build-system-only contents.
  • Loading branch information
jwnimmer-tri committed Oct 3, 2017
1 parent b70ac0e commit efb89bd
Show file tree
Hide file tree
Showing 27 changed files with 41 additions and 16 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

local_repository(
name = "kythe",
path = "tools/third_party/kythe",
path = "third_party/com_github_google_kythe",
)

load("@kythe//tools/build_rules/config:pkg_config.bzl", "pkg_config_package")
Expand Down
3 changes: 2 additions & 1 deletion drake/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ sh_test(
"drake_assert.h",
"test/drake_assert_test_compile.cc",
"unused.h",
"//tools:third_party/bazel/tools/cpp/osx_cc_wrapper.sh",
"//third_party:com_github_bazelbuild_bazel/tools/cpp/osx_cc_wrapper.sh", # noqa
"//tools:osx_cc_wrapper.sh",
],
)

Expand Down
25 changes: 25 additions & 0 deletions third_party/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- python -*-

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

package(default_visibility = ["//visibility:public"])

exports_files(
["com_github_bazelbuild_bazel/tools/cpp/osx_cc_wrapper.sh"],
visibility = [
"//drake/common:__pkg__",
"//tools:__pkg__",
],
)

exports_files(
["net_sf_jchart2d_jchart2d/LICENSE"],
visibility = ["//tools/install/jchart2d:__pkg__"],
)

exports_files(
["com_github_robotlocomotion_libbot2/LICENSE.ldpc"],
visibility = ["@libbot//:__pkg__"],
)

add_lint_tests()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 4 additions & 11 deletions tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,6 @@ exports_files(
visibility = ["@ipopt_robotlocomotion//:__pkg__"],
)

exports_files(
["third_party/jchart2d/LICENSE"],
visibility = ["//tools/install/jchart2d:__pkg__"],
)

exports_files(
["third_party/libbot/LICENSE.ldpc"],
visibility = ["@libbot//:__pkg__"],
)

exports_files(
[
"install/libbot/bot-procman-sheriff",
Expand Down Expand Up @@ -238,7 +228,10 @@ filegroup(
# A compiler wrapper script that adjusts linker paths on OS X.
filegroup(
name = "osx_cc_wrapper",
srcs = ["third_party/bazel/tools/cpp/osx_cc_wrapper.sh"],
srcs = [
"osx_cc_wrapper.sh",
"//third_party:com_github_bazelbuild_bazel/tools/cpp/osx_cc_wrapper.sh", # noqa
],
visibility = ["//visibility:private"],
)

Expand Down
2 changes: 1 addition & 1 deletion tools/CROSSTOOL
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ toolchain {
tool_path {name: "objcopy" path: "/usr/bin/objcopy" }
tool_path {name: "objdump" path: "/usr/bin/objdump" }
tool_path {name: "strip" path: "/usr/bin/strip" }
tool_path {name: "gcc" path: "third_party/bazel/tools/cpp/osx_cc_wrapper.sh" }
tool_path {name: "gcc" path: "osx_cc_wrapper.sh" }
tool_path {name: "ar" path: "/usr/bin/libtool" }

compilation_mode_flags {
Expand Down
4 changes: 4 additions & 0 deletions tools/buildifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ else
-name '*.BUILD' -o \
-name '*.bzl' \) -print |
xargs -t "$buildifier" -mode=fix -add_tables="$tables"
# TODO(jwnimmer-tri) The find misses this; within third_party, we want the
# direct child files, but nothing within a sub-folder. We should unify the
# source finding for cpplint, clang-format-includes, and buildifier.
"$buildifier" -mode=fix -add_tables="$tables" third_party/BUILD.bazel
fi

echo "... done"
2 changes: 1 addition & 1 deletion tools/install/jchart2d/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cmake_config(

install_cmake_config(package = CMAKE_PACKAGE)

JCHART_LICENSE_DOCS = ["//tools:third_party/jchart2d/LICENSE"]
JCHART_LICENSE_DOCS = ["//third_party:net_sf_jchart2d_jchart2d/LICENSE"]

JCHART_TARGETS = [
"@com_jidesoft_jide_oss//jar",
Expand Down
2 changes: 1 addition & 1 deletion tools/libbot.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ install(
name = "install",
docs = [
"LICENSE",
"@drake//tools:third_party/libbot/LICENSE.ldpc",
"@drake//third_party:com_github_robotlocomotion_libbot2/LICENSE.ldpc",
],
deps = [
":install_bot2_core",
Expand Down
2 changes: 2 additions & 0 deletions tools/osx_cc_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec third_party/com_github_bazelbuild_bazel/tools/cpp/osx_cc_wrapper.sh "$@"

0 comments on commit efb89bd

Please sign in to comment.