Skip to content

Commit

Permalink
example: build e2e test
Browse files Browse the repository at this point in the history
Now we can build the e2e test
  • Loading branch information
manuelnaranjo committed Sep 2, 2024
1 parent 49bc806 commit 5ae62ef
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
3 changes: 3 additions & 0 deletions e2e/smoke/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ flatbuffer_library_public(
java_library(
name = "monster_java",
srcs = [":monster_fbs_java"],
deps = [
"@flatbuffers-java//jar",
],
)
8 changes: 8 additions & 0 deletions e2e/smoke/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ local_repository(
path = "../..",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")

http_jar(
name = "flatbuffers-java",
url = "https://repo1.maven.org/maven2/com/google/flatbuffers/flatbuffers-java/24.3.25/flatbuffers-java-24.3.25.jar",
# sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
)

#---SNIP--- Below here is re-used in the workspace snippet published on releases

######################
Expand Down
9 changes: 9 additions & 0 deletions e2e/smoke/WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# When --enable_bzlmod is set, this file replaces WORKSPACE.bazel.
# Dependencies then come from MODULE.bazel instead.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")

http_jar(
name = "flatbuffers-java",
integrity = "sha256-9bUANKU969qYCsqAO4sGlJ+TpAFjvB22zWlYHTcY41U=",
sha256 = "f5b50034a53debda980aca803b8b06949f93a40163bc1db6cd69581d3718e355",
url = "https://repo1.maven.org/maven2/com/google/flatbuffers/flatbuffers-java/24.3.25/flatbuffers-java-24.3.25.jar",
)
6 changes: 0 additions & 6 deletions flatbuffers/private/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ def flatbuffer_library_public(
)

genrule_cmd = " ".join([
"set -x;",
"set -eou pipefail;",
"pwd;",
"SRCS=($(SRCS));",
"for f in $${SRCS[@]:0:%s}; do" % len(srcs),
"OUTPUT_FILE=\"$(OUTS)\" %s $(location @com_bookingcom_rules_flatbuffers//flatbuffers:resolved_toolchain)" % (extra_env),
Expand All @@ -109,7 +107,6 @@ def flatbuffer_library_public(
srcs = srcs + includes,
outs = outs,
output_to_bindir = output_to_bindir,
# toolchains = ["@com_bookingcom_rules_flatbuffers//flatbuffers:toolchain"],
tools = ["@com_bookingcom_rules_flatbuffers//flatbuffers:resolved_toolchain"],
cmd = genrule_cmd,
compatible_with = compatible_with,
Expand All @@ -123,9 +120,7 @@ def flatbuffer_library_public(
reflection_include_paths = default_include_paths()
reflection_include_paths_cmd = ["-I %s" % (s) for s in reflection_include_paths]
reflection_genrule_cmd = " ".join([
"set -x;",
"set -eou pipefail;",
"pwd",
"SRCS=($(SRCS));",
"for f in $${SRCS[@]:0:%s}; do" % len(srcs),
"$(location @com_bookingcom_rules_flatbuffers//flatbuffers:resolved_toolchain)",
Expand Down Expand Up @@ -153,7 +148,6 @@ def flatbuffer_library_public(
message = "Generating flatbuffer reflection binary for %s:" % (name),
visibility = reflection_visibility,
tools = ["@com_bookingcom_rules_flatbuffers//flatbuffers:resolved_toolchain"],
# toolchains = ["@com_bookingcom_rules_flatbuffers//flatbuffers:toolchain"],
)
native.filegroup(
name = "%s_out" % reflection_name,
Expand Down

0 comments on commit 5ae62ef

Please sign in to comment.