Skip to content

Commit 9cbe9f8

Browse files
rbrushcopybara-github
authored andcommitted
Internal change.
PiperOrigin-RevId: 623166316
1 parent f20f977 commit 9cbe9f8

File tree

39 files changed

+9891
-3908
lines changed

39 files changed

+9891
-3908
lines changed

bazel/antlr4_cc.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Build rules to create C++ code from an Antlr4 grammar."""
22

3+
load("@rules_java//java:defs.bzl", "java_binary")
4+
35
def antlr4_cc_lexer(name, src, namespaces = None, imports = None, deps = None, lib_import = None):
46
"""Generates the C++ source corresponding to an antlr4 lexer definition.
57
@@ -25,8 +27,7 @@ def antlr4_cc_lexer(name, src, namespaces = None, imports = None, deps = None, l
2527
"%sLexer.h" % base_file_prefix,
2628
"%sLexer.cpp" % base_file_prefix,
2729
]
28-
29-
native.java_binary(
30+
java_binary(
3031
name = "antlr_tool",
3132
jvm_flags = ["-Xmx256m"],
3233
main_class = "org.antlr.v4.Tool",

bazel/go_dependencies.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,9 @@ def fhir_go_dependencies():
208208
sum = "h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=",
209209
version = "v0.0.0-20191204190536-9bdfabe68543",
210210
)
211+
go_repository(
212+
name = "com_github_antrl4_go_antlr",
213+
importpath = "github.com/antlr4-go/antlr/v4",
214+
sum = "h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=",
215+
version = "v4.13.0",
216+
)

bazel/protogen.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Rules for generating Protos from FHIR definitions"""
1615

16+
load("@rules_java//java:defs.bzl", "java_binary", "java_test")
17+
1718
R4_PACKAGE_DEP = "@com_google_fhir//spec:fhir_r4"
1819
PROTO_GENERATOR = "@com_google_fhir//java/com/google/fhir/protogen:ProtoGenerator"
1920
PROFILE_GENERATOR = "@com_google_fhir//java/com/google/fhir/protogen:ProfileGenerator"
@@ -151,8 +152,7 @@ def gen_fhir_protos(
151152
"-Dgolden_dir=" + src_dir,
152153
"-Xmx4096M",
153154
]
154-
155-
native.java_test(
155+
java_test(
156156
name = "GeneratedProtoTest_" + name,
157157
size = "medium",
158158
srcs = ["//external:GeneratedProtoTest.java"],
@@ -294,7 +294,7 @@ def _get_tar_for_pkg(pkg):
294294
return pkg + "_package.tgz"
295295

296296
def _proto_generator_with_runtime_deps_on_existing_protos(name, golden_java_protos_rules):
297-
native.java_binary(
297+
java_binary(
298298
name = name,
299299
main_class = "com.google.fhir.protogen.ProtoGeneratorMain",
300300
runtime_deps = golden_java_protos_rules +

cc/google/fhir/fhir_path/BUILD

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ cc_library(
120120
"fhir_path_types.h",
121121
],
122122
strip_include_prefix = "//cc/",
123-
visibility = [
124-
"//visibility:private", # Only private by automation, not intent. Owner may accept CLs adding visibility. See go/scheuklappen#explicit-private.
125-
],
123+
visibility = ["//visibility:private"],
126124
deps = [
127125
"//cc/google/fhir:annotations",
128126
"//cc/google/fhir:fhir_types",
@@ -143,9 +141,7 @@ cc_library(
143141
"utils.h",
144142
],
145143
strip_include_prefix = "//cc/",
146-
visibility = [
147-
"//visibility:private", # Only private by automation, not intent. Owner may accept CLs adding visibility. See go/scheuklappen#explicit-private.
148-
],
144+
visibility = ["//visibility:private"],
149145
deps = [
150146
"//cc/google/fhir:annotations",
151147
"//cc/google/fhir:references",

examples/bulkdata/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
load("@fhir_bazel_pip_dependencies//:requirements.bzl", "requirement")
2+
13
# Simple client to download data from FHIR server (using bulk data protocol)
24
load(
35
"@rules_python//python:python.bzl",
46
"py_binary",
57
)
6-
load("@fhir_bazel_pip_dependencies//:requirements.bzl", "requirement")
78

89
licenses(["notice"])
910

examples/profiles/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
load("//bazel:proto.bzl", "fhir_proto_library")
2+
load("//bazel:protogen.bzl", "gen_fhir_definitions_and_protos")
3+
14
package(default_visibility = ["//visibility:public"])
25

36
licenses(["notice"])
47

5-
load("//bazel:protogen.bzl", "gen_fhir_definitions_and_protos")
6-
load("//bazel:proto.bzl", "fhir_proto_library")
7-
88
gen_fhir_definitions_and_protos(
99
name = "demo",
1010
additional_proto_imports = [

go/fhirpath/BUILD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
licenses(["notice"])
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
go_library(
8+
name = "fhirpath",
9+
srcs = ["visitor.go"],
10+
importpath = "github.com/google/fhir/go/fhirpath",
11+
deps = [
12+
"//go/fhirpath/gen",
13+
"@com_github_antrl4_go_antlr//:go_default_library",
14+
],
15+
)

go/fhirpath/gen/BUILD

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
licenses(["notice"])
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
go_library(
8+
name = "gen",
9+
srcs = [
10+
"doc.go",
11+
"fhirpath_base_listener.go",
12+
"fhirpath_base_visitor.go",
13+
"fhirpath_lexer.go",
14+
"fhirpath_listener.go",
15+
"fhirpath_parser.go",
16+
"fhirpath_visitor.go",
17+
],
18+
importpath = "github.com/google/fhir/go/fhirpath/gen",
19+
visibility = [
20+
"//go/fhirpath:__subpackages__",
21+
],
22+
deps = ["@com_github_antrl4_go_antlr//:go_default_library"],
23+
)

go/fhirpath/gen/doc.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Package gen is a FHIRPath parser and lexer generated by Antlr. Do not modify the code in this package
16+
package gen

0 commit comments

Comments
 (0)