From 5611ff267b7f11615516fd6efe8373b730999a0d Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 16 May 2019 11:35:00 -0700 Subject: [PATCH] Moved bazel files to bazel/ directory. --- BUILD | 4 ++-- WORKSPACE | 6 ++--- bazel/BUILD | 0 build_defs.bzl => bazel/build_defs.bzl | 0 lua.BUILD => bazel/lua.BUILD | 0 ragel.BUILD => bazel/ragel.BUILD | 0 .../repository_defs.bzl | 0 .../upb_proto_library.bzl | 10 ++++----- .../workspace_deps.bzl | 2 +- tools/copy_genfiles.sh.in | 22 ------------------- 10 files changed, 11 insertions(+), 33 deletions(-) create mode 100644 bazel/BUILD rename build_defs.bzl => bazel/build_defs.bzl (100%) rename lua.BUILD => bazel/lua.BUILD (100%) rename ragel.BUILD => bazel/ragel.BUILD (100%) rename repository_defs.bzl => bazel/repository_defs.bzl (100%) rename upb_proto_library.bzl => bazel/upb_proto_library.bzl (97%) rename workspace_deps.bzl => bazel/workspace_deps.bzl (94%) delete mode 100755 tools/copy_genfiles.sh.in diff --git a/BUILD b/BUILD index 362417ab1c..11156c8245 100644 --- a/BUILD +++ b/BUILD @@ -1,5 +1,5 @@ load( - ":build_defs.bzl", + "//bazel:build_defs.bzl", "generated_file_staleness_test", "licenses", # copybara:strip_for_google3 "lua_binary", @@ -11,7 +11,7 @@ load( ) load( - ":upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) diff --git a/WORKSPACE b/WORKSPACE index 63ccaab310..91d21500a0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,13 +1,13 @@ workspace(name = "upb") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@upb//:workspace_deps.bzl", "upb_deps") +load("//bazel:workspace_deps.bzl", "upb_deps") upb_deps() http_archive( name = "lua", - build_file = "//:lua.BUILD", + build_file = "//bazel:lua.BUILD", sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b", strip_prefix = "lua-5.2.4", urls = [ @@ -18,7 +18,7 @@ http_archive( http_archive( name = "ragel", - build_file = "//:ragel.BUILD", + build_file = "//bazel:ragel.BUILD", sha256 = "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f", strip_prefix = "ragel-6.10", urls = ["http://www.colm.net/files/ragel/ragel-6.10.tar.gz"], diff --git a/bazel/BUILD b/bazel/BUILD new file mode 100644 index 0000000000..e69de29bb2 diff --git a/build_defs.bzl b/bazel/build_defs.bzl similarity index 100% rename from build_defs.bzl rename to bazel/build_defs.bzl diff --git a/lua.BUILD b/bazel/lua.BUILD similarity index 100% rename from lua.BUILD rename to bazel/lua.BUILD diff --git a/ragel.BUILD b/bazel/ragel.BUILD similarity index 100% rename from ragel.BUILD rename to bazel/ragel.BUILD diff --git a/repository_defs.bzl b/bazel/repository_defs.bzl similarity index 100% rename from repository_defs.bzl rename to bazel/repository_defs.bzl diff --git a/upb_proto_library.bzl b/bazel/upb_proto_library.bzl similarity index 97% rename from upb_proto_library.bzl rename to bazel/upb_proto_library.bzl index 962facd5b9..0dc8c6e4f0 100644 --- a/upb_proto_library.bzl +++ b/bazel/upb_proto_library.bzl @@ -218,7 +218,7 @@ _upb_proto_library_aspect = aspect( "_upbc": attr.label( executable = True, cfg = "host", - default = ":protoc-gen-upb", + default = "//:protoc-gen-upb", ), "_protoc": attr.label( executable = True, @@ -228,7 +228,7 @@ _upb_proto_library_aspect = aspect( "_cc_toolchain": attr.label( default = "@bazel_tools//tools/cpp:current_cc_toolchain", ), - "_upb": attr.label_list(default = [":upb"]), + "_upb": attr.label_list(default = ["//:upb"]), "_ext": attr.string(default = ".upb"), }), implementation = _upb_proto_aspect_impl, @@ -255,7 +255,7 @@ _upb_proto_reflection_library_aspect = aspect( "_upbc": attr.label( executable = True, cfg = "host", - default = ":protoc-gen-upb", + default = "//:protoc-gen-upb", ), "_protoc": attr.label( executable = True, @@ -267,8 +267,8 @@ _upb_proto_reflection_library_aspect = aspect( ), "_upb": attr.label_list( default = [ - ":upb", - ":reflection", + "//:upb", + "//:reflection", ], ), "_ext": attr.string(default = ".upbdefs"), diff --git a/workspace_deps.bzl b/bazel/workspace_deps.bzl similarity index 94% rename from workspace_deps.bzl rename to bazel/workspace_deps.bzl index a77d5843fe..39bf524a7a 100644 --- a/workspace_deps.bzl +++ b/bazel/workspace_deps.bzl @@ -1,7 +1,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") -load("@upb//:repository_defs.bzl", "bazel_version_repository") +load("//bazel:repository_defs.bzl", "bazel_version_repository") def upb_deps(): bazel_version_repository( diff --git a/tools/copy_genfiles.sh.in b/tools/copy_genfiles.sh.in deleted file mode 100755 index 5e226259d8..0000000000 --- a/tools/copy_genfiles.sh.in +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e - -BINDIR=`dirname "$0"`/.. -SRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -EXIT=0 - -function try_copy() { - if [ ! -f $1 ]; then - echo "Can't find $1, skipping..." - EXIT=1 - else - cp $1 $2 - echo $1 - fi -} - -try_copy $BINDIR/google/protobuf/descriptor.upb.c $SRCDIR/google/protobuf -try_copy $BINDIR/google/protobuf/descriptor.upb.h $SRCDIR/google/protobuf -try_copy $BINDIR/upb/json/parser.c $SRCDIR/upb/json -try_copy $BINDIR/upb/pb/compile_decoder_x64.h $SRCDIR/upb/pb