From c10962d366767393eef70bbe9484c7a951c272a9 Mon Sep 17 00:00:00 2001 From: Catalin Bogdan Date: Fri, 11 Feb 2022 21:25:17 +0200 Subject: [PATCH] Updates: * bazel 5.0.0 * java 17 Fix: * set java_outer_classname to keyvalue.proto to avoid generating Keyvalue class in KeyValue.java file --- .bazeliskrc | 2 +- .bazelrc | 10 +++++++++- .gitignore | 1 + WORKSPACE | 19 ++++++++++++++++--- proto/keyvalue.proto | 1 + 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.bazeliskrc b/.bazeliskrc index d31fbec..821303c 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=3.7.0 +USE_BAZEL_VERSION=5.0.0 diff --git a/.bazelrc b/.bazelrc index 8ed1ba0..564f830 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,2 +1,10 @@ -build --disk_cache=/tmp --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 --protocopt=--experimental_allow_proto3_optional +build --disk_cache=/tmp --protocopt=--experimental_allow_proto3_optional +build --java_language_version=17 +build --java_runtime_version=remotejdk_17 +build --tool_java_language_version=17 +build --tool_java_runtime_version=remotejdk_17 test --disk_cache=/tmp --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 --protocopt=--experimental_allow_proto3_optional --test_summary=detailed --test_output=all +test --java_language_version=17 +test --java_runtime_version=remotejdk_17 +test --tool_java_language_version=17 +test --tool_java_runtime_version=remotejdk_17 diff --git a/.gitignore b/.gitignore index a649be1..1ab47af 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ gradle-app.setting /.project /.settings .ijwb +*.iml /bazel-bin /bazel-kafka-streams-contrib /bazel-out diff --git a/WORKSPACE b/WORKSPACE index 4735cdb..4864d79 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -2,12 +2,25 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") # Maven rules -git_repository( +RULES_JVM_EXTERNAL_TAG = "4.2" + +RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca" + +http_archive( name = "rules_jvm_external", - commit = "0dca0d770e2df942a6eab24386d84991c987c328", - remote = "https://github.com/bazelbuild/rules_jvm_external.git", + sha256 = RULES_JVM_EXTERNAL_SHA, + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, + url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, ) +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") + +rules_jvm_external_deps() + +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") + +rules_jvm_external_setup() + load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( diff --git a/proto/keyvalue.proto b/proto/keyvalue.proto index 1476f3d..b9f6a2e 100644 --- a/proto/keyvalue.proto +++ b/proto/keyvalue.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package protobuf; +option java_outer_classname = "BazelKeyValue"; option java_package = "de.nerden.kafka.streams.proto"; option java_multiple_files = true;