From cc766437cf879a421108ae80ab27b02ce986e3f0 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Mon, 21 Feb 2022 09:29:27 +0100 Subject: [PATCH] Fix java_jni_library with no srcs --- jni/internal/java_jni_library.bzl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jni/internal/java_jni_library.bzl b/jni/internal/java_jni_library.bzl index 3284d20..651761d 100644 --- a/jni/internal/java_jni_library.bzl +++ b/jni/internal/java_jni_library.bzl @@ -53,9 +53,11 @@ def java_jni_library( tags = java_library_args.pop("tags", default = None) visibility = java_library_args.pop("visibility", default = None) + java_library_deps_arg = "deps" if java_library_args.get("srcs") else "runtime_deps" + # Simple concatenation is compatible with select, append is not. - java_library_args.setdefault("deps", []) - java_library_args["deps"] += [Label("//jni/tools/native_loader")] + java_library_args.setdefault(java_library_deps_arg, []) + java_library_args[java_library_deps_arg] += [Label("//jni/tools/native_loader")] native.java_library( name = original_name,