From a799e34c7f1905c3af82f235636bd85f9ab2a3f2 Mon Sep 17 00:00:00 2001 From: Eugene Kliuchnikov Date: Thu, 18 Oct 2018 17:25:05 +0200 Subject: [PATCH] Remove dependency to full JDK. This should speedup clean builds. (#719) * Remove dependency to full JDK. This should speedup clean builds. * Upgrade appveyor bazel --- java/BUILD | 34 ++++++++++---------- java/WORKSPACE | 74 ++++++++++++++------------------------------ scripts/appveyor.yml | 2 +- 3 files changed, 41 insertions(+), 69 deletions(-) diff --git a/java/BUILD b/java/BUILD index a00e2d0bd..f7dd0c0fa 100644 --- a/java/BUILD +++ b/java/BUILD @@ -6,7 +6,7 @@ package( genrule( name = "copy_link_jni_header", - srcs = ["@openjdk_linux//:jni_h"], + srcs = ["@openjdk_jni_h//file"], outs = ["jni/jni.h"], cmd = "cp -f $< $@", ) @@ -14,12 +14,12 @@ genrule( 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 $< $@", @@ -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, ) ######################################################## @@ -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, ) diff --git a/java/WORKSPACE b/java/WORKSPACE index ab3f8b1bd..06fbdfeea 100644 --- a/java/WORKSPACE +++ b/java/WORKSPACE @@ -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", ) diff --git a/scripts/appveyor.yml b/scripts/appveyor.yml index abfb58f7b..e22a8c689 100644 --- a/scripts/appveyor.yml +++ b/scripts/appveyor.yml @@ -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: