From 98be491e72cfc38ed5d307f9dd7788d35314c651 Mon Sep 17 00:00:00 2001 From: Austin Schuh Date: Thu, 7 Mar 2019 15:09:30 -0800 Subject: [PATCH] Bazel ci (#5228) * Stop building for Windows until the build passes ERROR: D:/b/bk-windows-java8-bd0z/bazel/flatbuffers/BUILD:123:1: Couldn't build file _objs/flatbuffers_test/test.obj: undeclared inclusion(s) in rule '//:flatbuffers_test': this rule is missing dependency declarations for the following files included by 'tests/test.cpp': 'tests/monster_test_generated.h' 'tests/monster_extra_generated.h' The files in tests are being found instead of the generated files since Windows doesn't have any sandboxing. For now, let's disable the rules and come back to it. * Fix buildifier warnings Clean up docstrings and add a module docstring. --- .bazelci/presubmit.yml | 5 ----- build_defs.bzl | 15 +++++++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index cea328d01..0ad9d3180 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -16,8 +16,3 @@ platforms: - "..." test_targets: - "..." - windows: - build_targets: - - "..." - test_targets: - - "..." diff --git a/build_defs.bzl b/build_defs.bzl index c55ab5180..af6761010 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -1,6 +1,10 @@ # Description: # BUILD rules for generating flatbuffer files in various languages. +""" +Rules for building C++ flatbuffers with Bazel. +""" + flatc_path = "@com_github_google_flatbuffers//:flatc" DEFAULT_INCLUDE_PATHS = [ @@ -46,9 +50,11 @@ def flatbuffer_library_public( reflection binaries for the schemas. reflection_visiblity: The visibility of the generated reflection Fileset. output_to_bindir: Passed to genrule for output to bin directory. - Outs: - filegroup(name): all generated source files. - Fileset([reflection_name]): (Optional) all generated reflection binaries. + + + This rule creates a filegroup(name) with all generated source files, and + optionally a Fileset([reflection_name]) with all generated reflection + binaries. """ include_paths_cmd = ["-I %s" % (s) for s in include_paths] @@ -145,7 +151,8 @@ def flatbuffer_cc_library( By default, use the value of the visibility parameter above. gen_reflections: Optional, if true this will generate the flatbuffer reflection binaries for the schemas. - Outs: + + This produces: filegroup([name]_srcs): all generated .h files. filegroup(srcs_filegroup_name if specified, or [name]_includes if not): Other flatbuffer_cc_library's can pass this in for their `includes`