Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal change. #380

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bazel/antlr4_cc.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Build rules to create C++ code from an Antlr4 grammar."""

load("@rules_java//java:defs.bzl", "java_binary")

def antlr4_cc_lexer(name, src, namespaces = None, imports = None, deps = None, lib_import = None):
"""Generates the C++ source corresponding to an antlr4 lexer definition.
Expand All @@ -25,8 +27,7 @@ def antlr4_cc_lexer(name, src, namespaces = None, imports = None, deps = None, l
"%sLexer.h" % base_file_prefix,
"%sLexer.cpp" % base_file_prefix,
]

native.java_binary(
java_binary(
name = "antlr_tool",
jvm_flags = ["-Xmx256m"],
main_class = "org.antlr.v4.Tool",
Expand Down
6 changes: 6 additions & 0 deletions bazel/go_dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,9 @@ def fhir_go_dependencies():
sum = "h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=",
version = "v0.0.0-20191204190536-9bdfabe68543",
)
go_repository(
name = "com_github_antrl4_go_antlr",
importpath = "github.com/antlr4-go/antlr/v4",
sum = "h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=",
version = "v4.13.0",
)
8 changes: 4 additions & 4 deletions bazel/protogen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Rules for generating Protos from FHIR definitions"""

load("@rules_java//java:defs.bzl", "java_binary", "java_test")

R4_PACKAGE_DEP = "@com_google_fhir//spec:fhir_r4"
PROTO_GENERATOR = "@com_google_fhir//java/com/google/fhir/protogen:ProtoGenerator"
PROFILE_GENERATOR = "@com_google_fhir//java/com/google/fhir/protogen:ProfileGenerator"
Expand Down Expand Up @@ -151,8 +152,7 @@ def gen_fhir_protos(
"-Dgolden_dir=" + src_dir,
"-Xmx4096M",
]

native.java_test(
java_test(
name = "GeneratedProtoTest_" + name,
size = "medium",
srcs = ["//external:GeneratedProtoTest.java"],
Expand Down Expand Up @@ -294,7 +294,7 @@ def _get_tar_for_pkg(pkg):
return pkg + "_package.tgz"

def _proto_generator_with_runtime_deps_on_existing_protos(name, golden_java_protos_rules):
native.java_binary(
java_binary(
name = name,
main_class = "com.google.fhir.protogen.ProtoGeneratorMain",
runtime_deps = golden_java_protos_rules +
Expand Down
8 changes: 2 additions & 6 deletions cc/google/fhir/fhir_path/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ cc_library(
"fhir_path_types.h",
],
strip_include_prefix = "//cc/",
visibility = [
"//visibility:private", # Only private by automation, not intent. Owner may accept CLs adding visibility. See go/scheuklappen#explicit-private.
],
visibility = ["//visibility:private"],
deps = [
"//cc/google/fhir:annotations",
"//cc/google/fhir:fhir_types",
Expand All @@ -143,9 +141,7 @@ cc_library(
"utils.h",
],
strip_include_prefix = "//cc/",
visibility = [
"//visibility:private", # Only private by automation, not intent. Owner may accept CLs adding visibility. See go/scheuklappen#explicit-private.
],
visibility = ["//visibility:private"],
deps = [
"//cc/google/fhir:annotations",
"//cc/google/fhir:references",
Expand Down
3 changes: 2 additions & 1 deletion examples/bulkdata/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("@fhir_bazel_pip_dependencies//:requirements.bzl", "requirement")

# Simple client to download data from FHIR server (using bulk data protocol)
load(
"@rules_python//python:python.bzl",
"py_binary",
)
load("@fhir_bazel_pip_dependencies//:requirements.bzl", "requirement")

licenses(["notice"])

Expand Down
6 changes: 3 additions & 3 deletions examples/profiles/BUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
load("//bazel:proto.bzl", "fhir_proto_library")
load("//bazel:protogen.bzl", "gen_fhir_definitions_and_protos")

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

load("//bazel:protogen.bzl", "gen_fhir_definitions_and_protos")
load("//bazel:proto.bzl", "fhir_proto_library")

gen_fhir_definitions_and_protos(
name = "demo",
additional_proto_imports = [
Expand Down
15 changes: 15 additions & 0 deletions go/fhirpath/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

licenses(["notice"])

package(default_visibility = ["//visibility:public"])

go_library(
name = "fhirpath",
srcs = ["visitor.go"],
importpath = "github.com/google/fhir/go/fhirpath",
deps = [
"//go/fhirpath/gen",
"@com_github_antrl4_go_antlr//:go_default_library",
],
)
23 changes: 23 additions & 0 deletions go/fhirpath/gen/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

licenses(["notice"])

package(default_visibility = ["//visibility:public"])

go_library(
name = "gen",
srcs = [
"doc.go",
"fhirpath_base_listener.go",
"fhirpath_base_visitor.go",
"fhirpath_lexer.go",
"fhirpath_listener.go",
"fhirpath_parser.go",
"fhirpath_visitor.go",
],
importpath = "github.com/google/fhir/go/fhirpath/gen",
visibility = [
"//go/fhirpath:__subpackages__",
],
deps = ["@com_github_antrl4_go_antlr//:go_default_library"],
)
16 changes: 16 additions & 0 deletions go/fhirpath/gen/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package gen is a FHIRPath parser and lexer generated by Antlr. Do not modify the code in this package
package gen
Loading