[SDFAB-1196] Build ONOS with Bazel 6.0.0 pre-release
This was a quite big jump (3.7.2 -> 6.x.x) and we had
to face the deprecation of several components.
- javabase/host_javabase -> java_language_version and
java_runtime_version
- java_toolchain/host_java_toolchain -> java_language_version
and java_runtime_version
- Turnedoff "ReturnValueIgnored" related to ErrorProne
- Moved to bazelisk v1.11.0
- patched again the grpc code due to the deprecation of host_javabase
as java_toolcahin contains already this information.
- resource_jars are also handled as resources because java constructs
do not accept them anymore.
- Use the OSGIWrapper to fix the path of the resource_hars and untar them.
Additionally clean up the code and enable/disable logging through a param.
- Fix absolute_javabase in the Dockerfile by providing the absolute
path of the local jvm through local_java_repository. The latter is
appended to the WORKSPACE file on demand inside the Dockerfile.
Change-Id: I96e06fe52b3b49a1a34f01443eec583a95347323
(cherry picked from commit 846c8b167f3e3aa8086b3eab3df94154a75dc423)
diff --git a/WORKSPACE-docker b/WORKSPACE-docker
new file mode 100644
index 0000000..1b2b0d7
--- /dev/null
+++ b/WORKSPACE-docker
@@ -0,0 +1,16 @@
+
+# Appended by the Dockerfiles to help bazel finding the local path of
+# the Azul jvm. When we build docker images we use the jvm available
+# in the base image to compile ONOS. In order to do that we have to
+# provide the absolute path by using the local_java_repository.
+
+# local_java_repository for docker based builds
+load("@bazel_tools//tools/jdk:local_java_repository.bzl", "local_java_repository")
+
+ABSOLUTE_JAVABASE = "/usr/lib/jvm/zulu11-ca-amd64"
+
+local_java_repository(
+ name = "dockerjdk",
+ version = "11",
+ java_home = ABSOLUTE_JAVABASE,
+)