Skip to content

Commit

Permalink
Remove dependency to full JDK. This should speedup clean builds. (#719)
Browse files Browse the repository at this point in the history
* Remove dependency to full JDK. This should speedup clean builds.

* Upgrade appveyor bazel
  • Loading branch information
eustas authored Oct 18, 2018
1 parent 7a153eb commit a799e34
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 69 deletions.
34 changes: 17 additions & 17 deletions java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ package(

genrule(
name = "copy_link_jni_header",
srcs = ["@openjdk_linux//:jni_h"],
srcs = ["@openjdk_jni_h//file"],
outs = ["jni/jni.h"],
cmd = "cp -f $< $@",
)

genrule(
name = "copy_link_jni_md_header",
srcs = select({
"@org_brotli//:darwin": ["@openjdk_macos//:jni_md_h"],
"@org_brotli//:darwin_x86_64": ["@openjdk_macos//:jni_md_h"],
"@org_brotli//:windows_msys": ["@openjdk_win//:jni_md_h"],
"@org_brotli//:windows_msvc": ["@openjdk_win//:jni_md_h"],
"@org_brotli//:windows": ["@openjdk_win//:jni_md_h"],
"//conditions:default": ["@openjdk_linux//:jni_md_h"],
"@org_brotli//:darwin": ["@openjdk_macosx_jni_md_h//file"],
"@org_brotli//:darwin_x86_64": ["@openjdk_macosx_jni_md_h//file"],
"@org_brotli//:windows_msys": ["@openjdk_windows_jni_md_h//file"],
"@org_brotli//:windows_msvc": ["@openjdk_windows_jni_md_h//file"],
"@org_brotli//:windows": ["@openjdk_windows_jni_md_h//file"],
"//conditions:default": ["@openjdk_solaris_jni_md_h//file"],
}),
outs = ["jni/jni_md.h"],
cmd = "cp -f $< $@",
Expand All @@ -42,21 +42,21 @@ cc_library(
cc_binary(
name = "brotli_jni.dll",
srcs = [
"//org/brotli/wrapper/common:jni_src",
"//org/brotli/wrapper/dec:jni_src",
"//org/brotli/wrapper/enc:jni_src",
"@org_brotli//:common_headers",
"@org_brotli//:common_sources",
"@org_brotli//:dec_headers",
"@org_brotli//:dec_sources",
"@org_brotli//:enc_headers",
"@org_brotli//:enc_sources",
"//org/brotli/wrapper/common:jni_src",
"//org/brotli/wrapper/dec:jni_src",
"//org/brotli/wrapper/enc:jni_src",
],
linkshared = 1,
deps = [
"@org_brotli//:brotli_inc",
":jni_inc",
"@org_brotli//:brotli_inc",
],
linkshared = 1,
)

########################################################
Expand All @@ -65,22 +65,22 @@ cc_binary(
cc_binary(
name = "brotli_jni_no_dictionary_data.dll",
srcs = [
"//org/brotli/wrapper/common:jni_src",
"//org/brotli/wrapper/dec:jni_src",
"//org/brotli/wrapper/enc:jni_src",
"@org_brotli//:common_headers",
"@org_brotli//:common_sources",
"@org_brotli//:dec_headers",
"@org_brotli//:dec_sources",
"@org_brotli//:enc_headers",
"@org_brotli//:enc_sources",
"//org/brotli/wrapper/common:jni_src",
"//org/brotli/wrapper/dec:jni_src",
"//org/brotli/wrapper/enc:jni_src",
],
defines = [
"BROTLI_EXTERNAL_DICTIONARY_DATA=",
],
linkshared = 1,
deps = [
"@org_brotli//:brotli_inc",
":jni_inc",
"@org_brotli//:brotli_inc",
],
linkshared = 1,
)
74 changes: 23 additions & 51 deletions java/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,32 @@ maven_jar(
artifact = "junit:junit:4.12",
)

new_http_archive(
name = "openjdk_linux",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu-8.23.0.3-jdk8.0.144/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-8.23.0.3-jdk8.0.144/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
"https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
],
sha256 = "7e6284739c0e5b7142bc7a9adc61ced70dc5bb26b130b582b18e809013bcb251",
build_file_content = """
package(
default_visibility = ["//visibility:public"],
)
filegroup(
name = "jni_h",
srcs = ["zulu8.23.0.3-jdk8.0.144-linux_x64/include/jni.h"],
)
filegroup(
name = "jni_md_h",
srcs = ["zulu8.23.0.3-jdk8.0.144-linux_x64/include/linux/jni_md.h"],
)""",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

new_http_archive(
name = "openjdk_macos",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu-8.23.0.3-jdk8.0.144/zulu8.23.0.3-jdk8.0.144-macosx_x64.zip",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-8.23.0.3-jdk8.0.144/zulu8.23.0.3-jdk8.0.144-macosx_x64.zip",
"https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-macosx_x64.zip",
],
sha256 = "ff533364c9cbd3b271ab5328efe28e2dd6d7bae5b630098a5683f742ecf0709d",
build_file_content = """
package(
default_visibility = ["//visibility:public"],
http_file(
name = "openjdk_jni_h",
downloaded_file_path = "jni.h",
urls = ["https://hg.openjdk.java.net/jdk8/jdk8/jdk/raw-file/687fd7c7986d/src/share/javavm/export/jni.h"],
sha256 = "ed99792df48670072b78028faf704a8dcb6868fe140ccc7eced9b01dfa62fef4",
)
filegroup(
name = "jni_md_h",
srcs = ["zulu8.23.0.3-jdk8.0.144-macosx_x64/include/darwin/jni_md.h"],
)""",

http_file(
name = "openjdk_solaris_jni_md_h",
downloaded_file_path = "jni_md.h",
urls = ["https://hg.openjdk.java.net/jdk8/jdk8/jdk/raw-file/687fd7c7986d/src/solaris/javavm/export/jni_md.h"],
sha256 = "ecbe6944fe1a4290644d5a6b3c8f68576798a53b9da12cd31c58c48569595ff7",
)

new_http_archive(
name = "openjdk_win",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu-8.23.0.3-jdk8.0.144/zulu8.23.0.3-jdk8.0.144-win_x64.zip",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-8.23.0.3-jdk8.0.144/zulu8.23.0.3-jdk8.0.144-win_x64.zip",
"https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-win_x64.zip",
],
sha256 = "f1d9d3341ef7c8c9baff3597953e99a6a7c64f8608ee62c03fdd7574b7655c02",
build_file_content = """
package(
default_visibility = ["//visibility:public"],
http_file(
name = "openjdk_macosx_jni_md_h",
downloaded_file_path = "jni_md.h",
urls = ["https://hg.openjdk.java.net/jdk8/jdk8/jdk/raw-file/687fd7c7986d/src/macosx/javavm/export/jni_md.h"],
sha256 = "8f718071022e7e7f2fc9a229984b7e83582db91ed83861b49ce1461436fe8dc4",
)
filegroup(
name = "jni_md_h",
srcs = ["zulu8.23.0.3-jdk8.0.144-win_x64/include/win32/jni_md.h"],
)""",

http_file(
name = "openjdk_windows_jni_md_h",
downloaded_file_path = "jni_md.h",
urls = ["https://hg.openjdk.java.net/jdk8/jdk8/jdk/raw-file/687fd7c7986d/src/windows/javavm/export/jni_md.h"],
sha256 = "5479fb385ea1e11619f5c0cdfd9ccb3ea3a3fea0f5bc6176fb3ce62be29d759b",
)
2 changes: 1 addition & 1 deletion scripts/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ install:
)
)
- IF "%BUILD_SYSTEM%"=="bazel" (
appveyor DownloadFile https://github.com/bazelbuild/bazel/releases/download/0.14.1/bazel-0.14.1-windows-x86_64.exe -FileName bazel.exe
appveyor DownloadFile https://github.com/bazelbuild/bazel/releases/download/0.18.0/bazel-0.18.0-windows-x86_64.exe -FileName bazel.exe
)

before_build:
Expand Down

0 comments on commit a799e34

Please sign in to comment.