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,