diff --git a/WORKSPACE b/WORKSPACE index 1bc607fb64f2..54c2e46b3641 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -16,11 +16,16 @@ workspace(name = "drake") -load("//tools/third_party/kythe/tools/build_rules/config:pkg_config.bzl", "pkg_config_package") load("//tools:bitbucket.bzl", "bitbucket_archive") load("//tools:github.bzl", "github_archive") load('@bazel_tools//tools/build_defs/repo:git.bzl', 'git_repository') +local_repository( + name = "kythe", + path = "tools/third_party/kythe", +) +load("@kythe//tools/build_rules/config:pkg_config.bzl", "pkg_config_package") + pkg_config_package( name = "glib", modname = "glib-2.0", diff --git a/tools/bot_core_lcmtypes.BUILD b/tools/bot_core_lcmtypes.BUILD index 46c3b4062208..9b91a8cc06b8 100644 --- a/tools/bot_core_lcmtypes.BUILD +++ b/tools/bot_core_lcmtypes.BUILD @@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"]) -load("@//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") +load("@drake//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") lcm_cc_library( name = "bot_core_lcmtypes", diff --git a/tools/ccd.BUILD b/tools/ccd.BUILD index 9baafdb2caf9..114e8bfa4e41 100644 --- a/tools/ccd.BUILD +++ b/tools/ccd.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates config.h based on the defines= we want in Drake. cmake_configure_file( diff --git a/tools/eigen.BUILD b/tools/eigen.BUILD index 385a52e68601..9be5a170d505 100644 --- a/tools/eigen.BUILD +++ b/tools/eigen.BUILD @@ -1,7 +1,7 @@ # -*- python -*- -load("@//tools:install.bzl", "install", "install_files") -load("@//tools:python_lint.bzl", "python_lint") +load("@drake//tools:install.bzl", "install", "install_files") +load("@drake//tools:python_lint.bzl", "python_lint") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") package( @@ -25,8 +25,8 @@ cc_library( py_binary( name = "create-cps", - srcs = ["@//tools:eigen-create-cps.py"], - main = "@//tools:eigen-create-cps.py", + srcs = ["@drake//tools:eigen-create-cps.py"], + main = "@drake//tools:eigen-create-cps.py", visibility = ["//visibility:private"], ) diff --git a/tools/fcl.BUILD b/tools/fcl.BUILD index 89185252c7f9..e39110900585 100644 --- a/tools/fcl.BUILD +++ b/tools/fcl.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates config.h based on the version numbers in CMake code. cmake_configure_file( diff --git a/tools/gtest.BUILD b/tools/gtest.BUILD index eebd3d145594..cdc01862d4cb 100644 --- a/tools/gtest.BUILD +++ b/tools/gtest.BUILD @@ -30,8 +30,8 @@ cc_library( "googletest/include", ], linkopts = select({ - "@//tools:linux": ["-pthread"], - "@//conditions:default": [], + "@drake//tools:linux": ["-pthread"], + "@//conditions:default": [], # This is a bazel-default rule, and does not need @drake// }), linkstatic = 1, visibility = ["//visibility:public"], diff --git a/tools/ignition_math.BUILD b/tools/ignition_math.BUILD index 5ca09bff909d..8c72d715d141 100644 --- a/tools/ignition_math.BUILD +++ b/tools/ignition_math.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates config.hh based on the version numbers in CMake code. cmake_configure_file( diff --git a/tools/ipopt.BUILD b/tools/ipopt.BUILD index f0d8942c7397..aeab83dc04ed 100644 --- a/tools/ipopt.BUILD +++ b/tools/ipopt.BUILD @@ -103,16 +103,16 @@ genrule( cmd = " ".join([ "(", "env", - "cdexec=$(location @//tools/third_party/kythe/tools/cdexec:cdexec)", + "cdexec=$(location @kythe//tools/cdexec:cdexec)", "top_builddir=$(@D)", - "tools/ipopt_build_with_autotools.sh", + "$(location @drake//tools:ipopt_build_with_autotools.sh)", " 2>&1 > ipopt_build_with_autotools.log", ")", "|| (cat ipopt_build_with_autotools.log && false)", ]), tools = [ - "@//tools:ipopt_build_with_autotools.sh", - "@//tools/third_party/kythe/tools/cdexec:cdexec", + "@drake//tools:ipopt_build_with_autotools.sh", + "@kythe//tools/cdexec:cdexec", ], visibility = ["//visibility:private"], ) diff --git a/tools/lcm.BUILD b/tools/lcm.BUILD index 7fde6668f853..ea9556f742f9 100644 --- a/tools/lcm.BUILD +++ b/tools/lcm.BUILD @@ -1,9 +1,9 @@ # -*- python -*- -load("@//tools:drake.bzl", "drake_generate_file") -load("@//tools:generate_export_header.bzl", "generate_export_header") -load("@//tools:install.bzl", "install", "install_files") -load("@//tools:python_lint.bzl", "python_lint") +load("@drake//tools:drake.bzl", "drake_generate_file") +load("@drake//tools:generate_export_header.bzl", "generate_export_header") +load("@drake//tools:install.bzl", "install", "install_files") +load("@drake//tools:python_lint.bzl", "python_lint") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") package(default_visibility = ["//visibility:public"]) @@ -200,8 +200,8 @@ pkg_tar( py_binary( name = "create-cps", - srcs = ["@//tools:lcm-create-cps.py"], - main = "@//tools:lcm-create-cps.py", + srcs = ["@drake//tools:lcm-create-cps.py"], + main = "@drake//tools:lcm-create-cps.py", visibility = ["//visibility:private"], ) diff --git a/tools/libbot.BUILD b/tools/libbot.BUILD index 413237697c10..d027d395d85b 100644 --- a/tools/libbot.BUILD +++ b/tools/libbot.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:lcm.bzl", "lcm_java_library", "lcm_py_library") +load("@drake//tools:lcm.bzl", "lcm_java_library", "lcm_py_library") package(default_visibility = ["//visibility:public"]) diff --git a/tools/nlopt.BUILD b/tools/nlopt.BUILD index a77c7c24acc3..48db4e8f78df 100644 --- a/tools/nlopt.BUILD +++ b/tools/nlopt.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Chooses the nlopt preprocessor substitutions that we want to use from Bazel. cmake_configure_file( @@ -50,9 +50,9 @@ genrule( "api/nlopt.h", ], outs = ["api/nlopt.hpp"], - cmd = "$(location @//tools:nlopt-gen-hpp.sh) $(SRCS) $(OUTS) 2>&1 1>log" + + cmd = "$(location @drake//tools:nlopt-gen-hpp.sh) $(SRCS) $(OUTS) 2>&1 1>log" + " || (cat log && false)", - tools = ["@//tools:nlopt-gen-hpp.sh"], + tools = ["@drake//tools:nlopt-gen-hpp.sh"], ) cc_library( diff --git a/tools/robotlocomotion_lcmtypes.BUILD b/tools/robotlocomotion_lcmtypes.BUILD index 6a22dffa2eec..e82a64b6bafa 100644 --- a/tools/robotlocomotion_lcmtypes.BUILD +++ b/tools/robotlocomotion_lcmtypes.BUILD @@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"]) -load("@//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") +load("@drake//tools:lcm.bzl", "lcm_cc_library", "lcm_py_library") lcm_cc_library( name = "robotlocomotion_lcmtypes", diff --git a/tools/sdformat.BUILD b/tools/sdformat.BUILD index 5717e4ff7bee..587ff5d8036b 100644 --- a/tools/sdformat.BUILD +++ b/tools/sdformat.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:cmake_configure_file.bzl", "cmake_configure_file") +load("@drake//tools:cmake_configure_file.bzl", "cmake_configure_file") # Generates sdf_config.h based on the version numbers in CMake code. cmake_configure_file( diff --git a/tools/semantic_version.BUILD b/tools/semantic_version.BUILD index 2ed78c4aa39c..01a9c22b1bce 100644 --- a/tools/semantic_version.BUILD +++ b/tools/semantic_version.BUILD @@ -1,6 +1,6 @@ # -*- python -*- -load("@//tools:drake.bzl", "drake_generate_file") +load("@drake//tools:drake.bzl", "drake_generate_file") py_library( name = "semantic_version", diff --git a/tools/spdlog.BUILD b/tools/spdlog.BUILD index 8f9180b369a3..d470c86c4e66 100644 --- a/tools/spdlog.BUILD +++ b/tools/spdlog.BUILD @@ -15,8 +15,8 @@ cc_library( ], includes = ["include"], linkopts = select({ - "@//tools:linux": ["-pthread"], - "@//conditions:default": [], + "@drake//tools:linux": ["-pthread"], + "@//conditions:default": [], # This is a bazel-default rule, and does not need @drake// }), deps = ["@fmt"], ) diff --git a/tools/third_party/kythe/WORKSPACE b/tools/third_party/kythe/WORKSPACE new file mode 100644 index 000000000000..87ca36e82007 --- /dev/null +++ b/tools/third_party/kythe/WORKSPACE @@ -0,0 +1,6 @@ +# -*- python -*- + +# This file marks a workspace root for the Bazel build system. see +# http://bazel.io/ . + +workspace(name = "kythe") diff --git a/tools/third_party/kythe/tools/build_rules/config/local.bzl b/tools/third_party/kythe/tools/build_rules/config/local.bzl index e75505ed4959..2e5e044aac89 100644 --- a/tools/third_party/kythe/tools/build_rules/config/local.bzl +++ b/tools/third_party/kythe/tools/build_rules/config/local.bzl @@ -50,7 +50,7 @@ local_cc_library_configure = repository_rule( "default": attr.string(), "defines": attr.string_list(), "build_file_template": attr.label( - default = Label("@//tools/third_party/kythe/tools/build_rules/config:BUILD.tpl"), + default = Label("@kythe//tools/build_rules/config:BUILD.tpl"), single_file = True, allow_files = True, ), diff --git a/tools/third_party/kythe/tools/build_rules/config/pkg_config.bzl b/tools/third_party/kythe/tools/build_rules/config/pkg_config.bzl index 18ad0085e474..063c81864f0e 100644 --- a/tools/third_party/kythe/tools/build_rules/config/pkg_config.bzl +++ b/tools/third_party/kythe/tools/build_rules/config/pkg_config.bzl @@ -174,7 +174,7 @@ pkg_config_package = repository_rule( "max_version": attr.string(), "exact_version": attr.string(), "build_file_template": attr.label( - default = Label("@//tools/third_party/kythe/tools/build_rules/config:BUILD.tpl"), + default = Label("@kythe//tools/build_rules/config:BUILD.tpl"), single_file = True, allow_files = True, ), diff --git a/tools/third_party/kythe/tools/build_rules/config/system.bzl b/tools/third_party/kythe/tools/build_rules/config/system.bzl index c793b66fac76..0003b8c7edfc 100644 --- a/tools/third_party/kythe/tools/build_rules/config/system.bzl +++ b/tools/third_party/kythe/tools/build_rules/config/system.bzl @@ -17,9 +17,9 @@ cc_system_package: repository, whose `:lib` target is then bound to '{name}'. """ -load("@//tools/third_party/kythe/tools/build_rules/config:wrapped_ctx.bzl", "wrapctx") -load("@//tools/third_party/kythe/tools/build_rules/config:local.bzl", "setup_local_cc_library") -load("@//tools/third_party/kythe/tools/build_rules/config:pkg_config.bzl", "setup_pkg_config_package") +load("@kythe//tools/build_rules/config:wrapped_ctx.bzl", "wrapctx") +load("@kythe//tools/build_rules/config:local.bzl", "setup_local_cc_library") +load("@kythe//tools/build_rules/config:pkg_config.bzl", "setup_pkg_config_package") def try_local_library(repo_ctx): if repo_ctx.attr.envvar and repo_ctx.attr.envvar in repo_ctx.os.environ: @@ -58,7 +58,7 @@ cc_system_package_configure = repository_rule( "default": attr.string(), "defines": attr.string_list(), "build_file_template": attr.label( - default = Label("@//tools/third_party/kythe/tools/build_rules/config:BUILD.tpl"), + default = Label("@kythe//tools/build_rules/config:BUILD.tpl"), single_file = True, allow_files = True, ),