Skip to content

Commit

Permalink
Add rules_license support
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Oct 30, 2021
1 parent fd77a28 commit b164ec7
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@rules_license//rules:license.bzl", "license")

exports_files(["LICENSE"])

license(
name = "jdk_license",
copyright_notice = """jni.h:
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
jni_md.h:
Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
""",
license_kinds = ["@rules_license//licenses/spdx:GPL-2.0-with-classpath-exception"],
license_text = "@com_github_openjdk_license//file",
visibility = ["//:__subpackages__"],
)

license(
name = "rules_jni_license",
copyright_notice = "Copyright 2021 Fabian Meumertzheim",
license_kinds = ["@rules_license//licenses/spdx:Apache-2.0"],
license_text = "//:LICENSE",
visibility = ["//:__subpackages__"],
)
3 changes: 3 additions & 0 deletions jni/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ exports_files(glob(["*.bzl"]))
alias(
name = "jni",
actual = "//jni/internal:jni",
applicable_licenses = ["//:jdk_license"],
visibility = ["//visibility:public"],
)

alias(
name = "libjvm",
actual = "//jni/tools/libjvm_stub:libjvm_stub_with_jni",
applicable_licenses = ["//:rules_jni_license"],
visibility = ["//visibility:public"],
)

alias(
name = "libjvm_lite",
actual = "//jni/tools/libjvm_stub:libjvm_stub_release_with_jni",
applicable_licenses = ["//:rules_jni_license"],
visibility = ["//visibility:public"],
)

Expand Down
14 changes: 14 additions & 0 deletions jni/internal/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ Currently, rules_jni depends on:
sha256 = "dbf96659c4c840b15ef40237db0c65657eca7a70904225fc984deb38999df515",
urls = ["https://raw.githubusercontent.com/openjdk/jdk/jdk-17-ga/src/java.base/windows/native/include/jni_md.h"],
)
maybe(
http_file,
name = "com_github_openjdk_license",
downloaded_file_path = "LICENSE",
sha256 = "4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726",
urls = ["https://raw.githubusercontent.com/openjdk/jdk/jdk-17-ga/LICENSE"],
)
maybe(
http_archive,
name = "platforms",
Expand All @@ -66,3 +73,10 @@ Currently, rules_jni depends on:
"https://github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz",
],
)
maybe(
http_archive,
name = "rules_license",
sha256 = "0e6873bada3667e4293230970132a671b4061d48759e554965595e14a39fcd82",
strip_prefix = "rules_license-8c2bb4408153cc3c2ecb3f13767473d744aa9cd1",
url = "https://github.com/bazelbuild/rules_license/archive/8c2bb4408153cc3c2ecb3f13767473d744aa9cd1.tar.gz",
)
1 change: 1 addition & 0 deletions jni/tools/native_loader/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
java_library(
name = "native_loader",
srcs = glob(["src/main/java/com/github/fmeum/rules_jni/*.java"]),
applicable_licenses = ["//:rules_jni_license"],
visibility = ["//visibility:public"],
)

0 comments on commit b164ec7

Please sign in to comment.