Skip to content

Commit

Permalink
Fix java_jni_library with no srcs
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Feb 21, 2022
1 parent e98b1e8 commit cc76643
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jni/internal/java_jni_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cc76643

Please sign in to comment.