-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Keith Smiley <keithbsmiley@gmail.com> Co-authored-by: Jose Ulises Nino Rivera <junr03@users.noreply.github.com> Co-authored-by: Tony Allen <tallen@lyft.com> Co-authored-by: Michael Rebello <me@michaelrebello.com> Co-authored-by: Alan Chiu <achiu@lyft.com> Co-authored-by: Matt Klein <mklein@lyft.com> Signed-off-by: Mike Schore <mike.schore@gmail.com> Signed-off-by: JP Simard <jp@jpsim.com>
- Loading branch information
Showing
51 changed files
with
1,311 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
startup --host_jvm_args=-Xmx512m | ||
|
||
build \ | ||
--define=google_grpc=disabled \ | ||
--define=hot_restart=disabled \ | ||
--define=signal_trace=disabled \ | ||
--define=tcmalloc=disabled \ | ||
--ios_minimum_os=10.0 \ | ||
--ios_simulator_device="iPhone X" \ | ||
--ios_simulator_version=12.2 \ | ||
--spawn_strategy=standalone \ | ||
--verbose_failures \ | ||
--workspace_status_command=envoy/bazel/get_workspace_status \ | ||
--xcode_version=10.2.1 \ | ||
--incompatible_bzl_disallow_load_after_statement=false | ||
|
||
build:ios --define=manual_stamp=manual_stamp | ||
|
||
build:android --fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
envoy/.clang-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
build_docs/ | ||
generated/ | ||
/bazel-* | ||
/build_* | ||
/dist/envoy.aar | ||
/dist/Envoy.framework | ||
.DS_Store | ||
/generated | ||
.idea | ||
.ijwb | ||
*.pyc | ||
tags | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("@envoy//bazel:envoy_build_system.bzl", "envoy_package") | ||
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_framework", "ios_static_framework") | ||
|
||
envoy_package() | ||
|
||
load("//bazel:aar_with_jni.bzl", "aar_with_jni") | ||
|
||
ios_static_framework( | ||
name = "ios_framework", | ||
hdrs = ["//library/common:main_interface.h"], | ||
bundle_name = "Envoy", | ||
minimum_os_version = "10.0", | ||
visibility = ["//visibility:public"], | ||
deps = ["//library/common:envoy_main_interface_lib"], | ||
) | ||
|
||
genrule( | ||
name = "ios_dist", | ||
srcs = ["//:ios_framework"], | ||
outs = ["ios_out"], | ||
cmd = """ | ||
unzip -o $< -d dist/ | ||
touch $@ | ||
""", | ||
) | ||
|
||
aar_with_jni( | ||
name = "android_aar", | ||
android_library = "android_lib", | ||
archive_name = "envoy", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
android_library( | ||
name = "android_lib", | ||
srcs = ["library/java/io/envoyproxy/envoymobile/Envoy.java"], | ||
custom_package = "io.envoyproxy.envoymobile", | ||
manifest = "library/EnvoyManifest.xml", | ||
deps = ["//library/common:envoy_jni_interface_lib"], | ||
) | ||
|
||
genrule( | ||
name = "android_dist", | ||
srcs = ["//:android_aar"], | ||
outs = ["android_out"], | ||
cmd = """ | ||
cp $< dist/envoy.aar | ||
chmod 755 dist/envoy.aar | ||
touch $@ | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
# TODO remove once https://github.com/bazelbuild/rules_foreign_cc/pull/253 is resolved | ||
# NOTE: this version should be kept up to date with https://github.com/lyft/envoy-edge-fork/blob/3573b07af1ab5c4cf687ced0f80e2ccc0a0b7ec2/bazel/repository_locations.bzl#L225-L230 until this is removed | ||
http_archive( | ||
name = "rules_foreign_cc", | ||
patches = ["//bazel:ranlib.patch"], | ||
sha256 = "e1b67e1fda647c7713baac11752573bfd4c2d45ef09afb4d4de9eb9bd4e5ac76", | ||
strip_prefix = "rules_foreign_cc-8648b0446092ef2a34d45b02c8dc4c35c3a8df79", | ||
urls = ["https://github.com/bazelbuild/rules_foreign_cc/archive/8648b0446092ef2a34d45b02c8dc4c35c3a8df79.tar.gz"], | ||
) | ||
|
||
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies") | ||
|
||
local_repository( | ||
name = "envoy", | ||
path = "envoy", | ||
) | ||
|
||
local_repository( | ||
name = "envoy_build_config", | ||
path = "envoy_build_config", | ||
) | ||
|
||
git_repository( | ||
name = "build_bazel_rules_apple", | ||
commit = "2f20f88d85c0fe217cf9a9eadfb8015b3a384dea", | ||
remote = "https://github.com/bazelbuild/rules_apple.git", | ||
) | ||
|
||
load("@envoy//bazel:api_repositories.bzl", "envoy_api_dependencies") | ||
|
||
envoy_api_dependencies() | ||
|
||
load("@envoy//bazel:repositories.bzl", "GO_VERSION", "envoy_dependencies") | ||
load("@envoy//bazel:cc_configure.bzl", "cc_configure") | ||
|
||
envoy_dependencies() | ||
|
||
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies") | ||
|
||
rules_foreign_cc_dependencies() | ||
|
||
cc_configure() | ||
|
||
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
|
||
go_rules_dependencies() | ||
|
||
go_register_toolchains(go_version = GO_VERSION) | ||
|
||
git_repository( | ||
name = "build_bazel_apple_support", | ||
commit = "dabf718975760b4d45bd7db3e18bc12e7b4ef485", | ||
remote = "https://github.com/bazelbuild/apple_support.git", | ||
shallow_since = "1551297696 -0500", | ||
) | ||
|
||
git_repository( | ||
name = "build_bazel_rules_swift", | ||
commit = "e517571f92fe7739635c6e25b2be1f4f185fce33", | ||
remote = "https://github.com/bazelbuild/rules_swift.git", | ||
shallow_since = "1551797865 -0800", | ||
) | ||
|
||
load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") | ||
|
||
apple_support_dependencies() | ||
|
||
load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") | ||
|
||
apple_rules_dependencies(ignore_version_differences = True) | ||
|
||
load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") | ||
|
||
swift_rules_dependencies() | ||
|
||
android_sdk_repository(name = "androidsdk") | ||
|
||
android_ndk_repository(name = "androidndk") | ||
|
||
git_repository( | ||
name = "rules_jvm_external", | ||
commit = "fc5bd21820581f342a4119a89bfdf36e79c6c549", | ||
remote = "https://github.com/bazelbuild/rules_jvm_external.git", | ||
shallow_since = "1552938175 -0400", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
licenses(["notice"]) # Apache 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Based on https://github.com/aj-michael/aar_with_jni | ||
|
||
def aar_with_jni(name, android_library, archive_name = "", visibility = None): | ||
if not archive_name: | ||
archive_name = name | ||
|
||
native.genrule( | ||
name = archive_name + "_binary_manifest_generator", | ||
outs = [archive_name + "_generated_AndroidManifest.xml"], | ||
cmd = """ | ||
cat > $(OUTS) <<EOF | ||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="does.not.matter"> | ||
<uses-sdk android:minSdkVersion="999"/> | ||
</manifest> | ||
EOF | ||
""", | ||
) | ||
|
||
native.android_binary( | ||
name = archive_name + "_jni", | ||
manifest = archive_name + "_generated_AndroidManifest.xml", | ||
custom_package = "does.not.matter", | ||
deps = [android_library], | ||
) | ||
|
||
native.genrule( | ||
name = name, | ||
srcs = [android_library + ".aar", archive_name + "_jni_unsigned.apk"], | ||
outs = [archive_name + ".aar"], | ||
cmd = """ | ||
cp $(location {}.aar) $(location :{}.aar) | ||
chmod +w $(location :{}.aar) | ||
origdir=$$PWD | ||
cd $$(mktemp -d) | ||
unzip $$origdir/$(location :{}_jni_unsigned.apk) "lib/*" | ||
cp -r lib jni | ||
zip -r $$origdir/$(location :{}.aar) jni/*/*.so | ||
""".format(android_library, archive_name, archive_name, archive_name, archive_name), | ||
visibility = visibility, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- tools/build_defs/cmake_script.bzl | ||
+++ tools/build_defs/cmake_script.bzl | ||
@@ -91,6 +91,7 @@ _CMAKE_ENV_VARS_FOR_CROSSTOOL = { | ||
_CMAKE_CACHE_ENTRIES_CROSSTOOL = { | ||
"CMAKE_SYSTEM_NAME": struct(value = "CMAKE_SYSTEM_NAME", replace = True), | ||
"CMAKE_AR": struct(value = "CMAKE_AR", replace = True), | ||
+ "CMAKE_RANLIB": struct(value = "CMAKE_RANLIB", replace = True), | ||
"CMAKE_CXX_LINK_EXECUTABLE": struct(value = "CMAKE_CXX_LINK_EXECUTABLE", replace = True), | ||
"CMAKE_C_FLAGS": struct(value = "CMAKE_C_FLAGS_INIT", replace = False), | ||
"CMAKE_CXX_FLAGS": struct(value = "CMAKE_CXX_FLAGS_INIT", replace = False), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("@envoy//bazel:envoy_build_system.bzl", "envoy_package") | ||
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_framework_import") | ||
|
||
envoy_package() | ||
|
||
# NOTE: You must first build the top-level targets //:ios_dist and //:android_dist to use the | ||
# artifacts referenced here. | ||
|
||
aar_import( | ||
name = "envoy_mobile_android", | ||
aar = "envoy.aar", | ||
) | ||
|
||
apple_static_framework_import( | ||
name = "envoy_mobile_ios", | ||
framework_imports = glob(["Envoy.framework/**"]), | ||
sdk_dylibs = [ | ||
"resolv.9", | ||
"c++", | ||
], | ||
) |
Oops, something went wrong.