Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ build --copt -Wno-deprecated-declarations
# Envoy's runtime system. This option prevents them from being compiled out.
build --copt -DABSL_FLAGS_STRIP_NAMES=0

# The defaults are JDK 11 on newer versions of Bazel
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially live under an Android specific bazelrc config if we'd prefer that not all builds have the JDK pinned to this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In EM this shouldn't matter for non android targets anyways

build --java_runtime_version=remotejdk_11
build --java_language_version=8

# Override PGV validation with NOP functions
build --@com_envoyproxy_protoc_gen_validate//bazel:template-flavor=nop

Expand Down Expand Up @@ -125,11 +129,6 @@ build:remote-ci-common --spawn_strategy=remote,sandboxed,local
# sends a keepalive if we don't receive any messages (server updates every 60s).
build:remote-ci-common --grpc_keepalive_time=61s
#############################################################################
# remote-ci-local-java8: Use a local Java 8 (JDK)
#############################################################################
build:remote-ci-local-java8 --java_runtime_version=local_jdk
build:remote-ci-local-java8 --java_language_version=8
#############################################################################
# remote-ci-linux: These options are linux-only using GCC by default
#############################################################################
# Common Engflow flags
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/android_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
--test_output=all \
--build_tests_only \
--config=remote-ci-macos \
--config=remote-ci-local-java8 \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
//test/kotlin/io/...
javatestsmac:
Expand Down Expand Up @@ -86,7 +85,6 @@ jobs:
--test_output=all \
--build_tests_only \
--config=remote-ci-macos \
--config=remote-ci-local-java8 \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
--define=signal_trace=disabled \
//test/java/...
Expand Down Expand Up @@ -131,6 +129,5 @@ jobs:
--test_output=all \
--build_tests_only \
--config=remote-ci-linux-clang \
--config=remote-ci-local-java8 \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
//test/kotlin/...
2 changes: 1 addition & 1 deletion bazel/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@envoy//bazel:envoy_build_system.bzl", "envoy_package")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")

licenses(["notice"]) # Apache 2

Expand Down
4 changes: 3 additions & 1 deletion bazel/envoy_mobile_dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependenci
load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")
load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@rules_detekt//detekt:dependencies.bzl", "rules_detekt_dependencies")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories")
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
load("@rules_proto_grpc//protobuf:repositories.bzl", "protobuf_repos")
load("@rules_proto_grpc//java:repositories.bzl", rules_proto_grpc_java_repos = "java_repos")
load("@rules_python//python:pip.bzl", "pip_install")
load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")
load("@rules_java//java:repositories.bzl", "rules_java_dependencies")

def _default_extra_swift_sources_impl(ctx):
ctx.file("WORKSPACE", "")
Expand Down Expand Up @@ -58,6 +59,7 @@ def swift_dependencies():
swift_rules_dependencies()

def kotlin_dependencies(extra_maven_dependencies = []):
rules_java_dependencies()
maven_install(
artifacts = [
"com.google.code.findbugs:jsr305:3.0.2",
Expand Down
19 changes: 12 additions & 7 deletions bazel/envoy_mobile_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ def swift_repos():
)

def kotlin_repos():
http_archive(
name = "rules_java",
sha256 = "ddc9e11f4836265fea905d2845ac1d04ebad12a255f791ef7fd648d1d2215a5b",
strip_prefix = "rules_java-5.0.0",
url = "https://github.com/bazelbuild/rules_java/archive/refs/tags/5.0.0.tar.gz",
)

http_archive(
name = "rules_jvm_external",
sha256 = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca",
Expand All @@ -106,17 +113,15 @@ def kotlin_repos():

http_archive(
name = "io_bazel_rules_kotlin",
sha256 = "dc1c76f91228ddaf4f7ca4190b82d61939e95369f61dea715e8be28792072b1b",
strip_prefix = "rules_kotlin-legacy-1.3.0-rc2",
type = "zip",
urls = ["https://github.com/bazelbuild/rules_kotlin/archive/legacy-1.3.0-rc2.zip"],
sha256 = "f1a4053eae0ea381147f5056bb51e396c5c494c7f8d50d0dee4cc2f9d5c701b0",
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/1.6.0-RC-1/rules_kotlin_release.tgz"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rules_kotlin 1.6.0-RC-1 pins the Kotlin compiler to 1.6.21

)

http_archive(
name = "rules_detekt",
sha256 = "b1b4c8a3228f880a169ab60a817619bc4cf254443196e7e108ece411cb9c580e",
strip_prefix = "bazel_rules_detekt-0.3.0",
url = "https://github.com/buildfoundation/bazel_rules_detekt/archive/v0.3.0.tar.gz",
sha256 = "44912c74dc2e164227b1102ef36227d0e78fdbd7c7359868ae13424eb4f0d5c2",
strip_prefix = "bazel_rules_detekt-0.6.0",
url = "https://github.com/buildfoundation/bazel_rules_detekt/archive/v0.6.0.tar.gz",
)

# gRPC java for @rules_proto_grpc
Expand Down
6 changes: 4 additions & 2 deletions bazel/envoy_mobile_toolchains.bzl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_register_toolchains")
load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
load("@rules_detekt//detekt:toolchains.bzl", "rules_detekt_toolchains")
load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains")
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")

def envoy_mobile_toolchains():
rules_java_toolchains()
kt_register_toolchains()
rules_detekt_toolchains(detekt_version = "1.8.0")
rules_detekt_toolchains(detekt_version = "1.20.0")
rules_proto_grpc_toolchains()
2 changes: 1 addition & 1 deletion bazel/kotlin_lib.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")

# This is the magic function which helps get the name of the native library
Expand Down
2 changes: 1 addition & 1 deletion bazel/kotlin_test.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_test")
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test")
load("//bazel:kotlin_lib.bzl", "native_lib_name")

def _internal_kt_test(name, srcs, deps = [], data = [], jvm_flags = [], repository = "", exec_properties = {}):
Expand Down
2 changes: 1 addition & 1 deletion examples/java/hello_world/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_jvm_external//:defs.bzl", "artifact")

licenses(["notice"]) # Apache 2
Expand Down
2 changes: 1 addition & 1 deletion examples/kotlin/hello_world/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_detekt//detekt:defs.bzl", "detekt")
load("@rules_jvm_external//:defs.bzl", "artifact")

Expand Down
2 changes: 1 addition & 1 deletion examples/kotlin/shared/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_jvm_external//:defs.bzl", "artifact")

licenses(["notice"]) # Apache 2
Expand Down
2 changes: 1 addition & 1 deletion library/kotlin/io/envoyproxy/envoymobile/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@envoy_mobile//bazel:android_artifacts.bzl", "android_artifacts")
load("@envoy_mobile//bazel:kotlin_lib.bzl", "envoy_mobile_kt_library")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_detekt//detekt:defs.bzl", "detekt")

licenses(["notice"]) # Apache 2
Expand Down
2 changes: 1 addition & 1 deletion test/kotlin/apps/baseline/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_detekt//detekt:defs.bzl", "detekt")
load("@rules_jvm_external//:defs.bzl", "artifact")

Expand Down
2 changes: 1 addition & 1 deletion test/kotlin/apps/experimental/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_detekt//detekt:defs.bzl", "detekt")
load("@rules_jvm_external//:defs.bzl", "artifact")

Expand Down