Skip to content

Commit

Permalink
bazel: Add envoy_mobile_extra_swift_sources repository (#1661)
Browse files Browse the repository at this point in the history
Desscription: This can be used to attach extra source files to the main swift_library
target, which is useful for including private additions.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
  • Loading branch information
keith authored and jpsim committed Nov 29, 2022
1 parent d01773c commit b5b7ff2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions mobile/bazel/envoy_mobile_dependencies.bzl
Expand Up @@ -10,7 +10,24 @@ load("@rules_proto_grpc//java:repositories.bzl", rules_proto_grpc_java_repos = "
load("@rules_python//python:pip.bzl", "pip_install")
load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")

def _default_extra_swift_sources_impl(ctx):
ctx.file("WORKSPACE", "")
ctx.file("empty.swift", "")
ctx.file("BUILD.bazel", """
filegroup(
name = "extra_swift_srcs",
srcs = ["empty.swift"],
visibility = ["//visibility:public"],
)""")

_default_extra_swift_sources = repository_rule(
implementation = _default_extra_swift_sources_impl,
)

def envoy_mobile_dependencies():
if not native.existing_rule("envoy_mobile_extra_swift_sources"):
_default_extra_swift_sources(name = "envoy_mobile_extra_swift_sources")

swift_dependencies()
kotlin_dependencies()
python_dependencies()
Expand Down
2 changes: 1 addition & 1 deletion mobile/library/swift/BUILD
Expand Up @@ -41,7 +41,7 @@ swift_library(
"grpc/*.swift",
"mocks/*.swift",
"stats/*.swift",
]),
]) + ["@envoy_mobile_extra_swift_sources//:extra_swift_srcs"],
features = ["swift.enable_library_evolution"],
module_name = "Envoy",
private_deps = ["//library/objective-c:envoy_engine_objc_lib"],
Expand Down

0 comments on commit b5b7ff2

Please sign in to comment.