Skip to content

Commit

Permalink
Add load() statements for the builtin Bazel java rules
Browse files Browse the repository at this point in the history
Loads are being added in preparation for moving the rules out of Bazel and into `rules_java`.

PiperOrigin-RevId: 621519112
  • Loading branch information
FHIR Team authored and copybara-github committed Apr 18, 2024
1 parent ca35a36 commit cd759fb
Showing 2 changed files with 7 additions and 6 deletions.
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.
@@ -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",
8 changes: 4 additions & 4 deletions bazel/protogen.bzl
Original file line number Diff line number Diff line change
@@ -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"
@@ -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"],
@@ -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 +

0 comments on commit cd759fb

Please sign in to comment.