diff --git a/.bazelrc b/.bazelrc index 169f3f0b81..2320992de9 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,6 +19,7 @@ build --ios_simulator_version=15.2 build --verbose_failures build --workspace_status_command=envoy/bazel/get_workspace_status build --xcode_version=13.2.1 +build --use_top_level_targets_for_symlinks # https://github.com/bazelbuild/rules_jvm_external/issues/445 build --repo_env=JAVA_HOME=../bazel_tools/jdk build --define disable_known_issue_asserts=true diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index 1fd9f27a0c..41dc3b4c75 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -15,26 +15,14 @@ jobs: - uses: actions/checkout@v1 with: submodules: true - - uses: actions/cache@v2 - id: check-cache - with: - key: aar-${{ github.sha }} - path: dist/envoy.aar - name: 'Check cache' - - run: echo "Found envoy.aar from previous run!" - if: steps.check-cache.outputs.cache-hit == 'true' - name: 'Build cache hit' - uses: actions/setup-java@v1 - if: steps.check-cache.outputs.cache-hit != 'true' with: java-version: '8' java-package: jdk architecture: x64 - name: 'Install dependencies' - if: steps.check-cache.outputs.cache-hit != 'true' run: ./ci/mac_ci_setup.sh --android - name: 'Build envoy.aar distributable' - if: steps.check-cache.outputs.cache-hit != 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -45,7 +33,6 @@ jobs: //:android_dist_ci javahelloworld: name: java_helloworld - needs: androidbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -59,14 +46,6 @@ jobs: architecture: x64 - run: ./ci/mac_ci_setup.sh --android name: 'Install dependencies' - - uses: actions/cache@v2 - id: check-cache - with: - key: aar-${{ github.sha }} - path: dist/envoy.aar - name: 'Download aar' - - run: exit 1 - if: steps.check-cache.outputs.cache-hit != 'true' - name: 'Start simulator' run: ./ci/mac_start_emulator.sh # Return to using: @@ -87,7 +66,6 @@ jobs: run: adb logcat -e "received headers with status 200" -m 1 kotlinhelloworld: name: kotlin_helloworld - needs: androidbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -101,15 +79,6 @@ jobs: architecture: x64 - name: 'Install dependencies' run: ./ci/mac_ci_setup.sh - - name: 'Download aar' - uses: actions/cache@v2 - id: check-cache - with: - key: aar-${{ github.sha }} - path: dist/envoy.aar - - name: 'Short-circuit' - if: steps.check-cache.outputs.cache-hit != 'true' - run: exit 1 - name: 'Start simulator' run: ./ci/mac_start_emulator.sh # Return to using: @@ -130,7 +99,6 @@ jobs: run: adb logcat -e "received headers with status 200" -m 1 kotlinbaselineapp: name: kotlin_baseline_app - needs: androidbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -144,15 +112,6 @@ jobs: architecture: x64 - name: 'Install dependencies' run: ./ci/mac_ci_setup.sh --android - - name: 'Download aar' - uses: actions/cache@v2 - id: check-cache - with: - key: aar-${{ github.sha }} - path: dist/envoy.aar - - name: 'Short-circuit' - if: steps.check-cache.outputs.cache-hit != 'true' - run: exit 1 - name: 'Start simulator' run: ./ci/mac_start_emulator.sh # Return to using: @@ -173,7 +132,6 @@ jobs: run: adb logcat -e "received headers with status 200" -m 1 kotlinexperimentalapp: name: kotlin_experimental_app - needs: androidbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -187,15 +145,6 @@ jobs: architecture: x64 - name: 'Install dependencies' run: ./ci/mac_ci_setup.sh - - name: 'Download aar' - uses: actions/cache@v2 - id: check-cache - with: - key: aar-${{ github.sha }} - path: dist/envoy.aar - - name: 'Short-circuit' - if: steps.check-cache.outputs.cache-hit != 'true' - run: exit 1 - name: 'Start simulator' run: ./ci/mac_start_emulator.sh # Return to using: diff --git a/.github/workflows/ios_build.yml b/.github/workflows/ios_build.yml index 528a240b82..4e72173c69 100644 --- a/.github/workflows/ios_build.yml +++ b/.github/workflows/ios_build.yml @@ -15,28 +15,16 @@ jobs: - uses: actions/checkout@v1 with: submodules: true - - uses: actions/cache@v2 - id: check-cache - with: - key: framework-${{ github.sha }} - path: dist/Envoy.framework - name: 'Check cache' - - run: echo "Found Envoy.framework from previous run!" - if: steps.check-cache.outputs.cache-hit == 'true' - name: 'Build cache hit' - run: ./ci/mac_ci_setup.sh - if: steps.check-cache.outputs.cache-hit != 'true' name: 'Install dependencies' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ./bazelw shutdown - ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //:ios_dist - if: steps.check-cache.outputs.cache-hit != 'true' + ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //library/swift:ios_framework name: 'Build Envoy.framework distributable' swifthelloworld: name: swift_helloworld - needs: iosbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -45,15 +33,6 @@ jobs: submodules: true - run: ./ci/mac_ci_setup.sh name: 'Install dependencies' - - uses: actions/cache@v2 - id: check-cache - with: - key: framework-${{ github.sha }} - path: dist/Envoy.framework - name: 'Download framework' - - run: exit 1 - if: steps.check-cache.outputs.cache-hit != 'true' - name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/hello_world:app @@ -70,7 +49,6 @@ jobs: name: 'Log app run' swiftbaselineapp: name: swift_baseline_app - needs: iosbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -79,15 +57,6 @@ jobs: submodules: true - run: ./ci/mac_ci_setup.sh name: 'Install dependencies' - - uses: actions/cache@v2 - id: check-cache - with: - key: framework-${{ github.sha }} - path: dist/Envoy.framework - name: 'Download framework' - - run: exit 1 - if: steps.check-cache.outputs.cache-hit != 'true' - name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/swift/apps/baseline:app @@ -104,7 +73,6 @@ jobs: name: 'Log app run' swiftexperimentalapp: name: swift_experimental_app - needs: iosbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -113,15 +81,6 @@ jobs: submodules: true - run: ./ci/mac_ci_setup.sh name: 'Install dependencies' - - uses: actions/cache@v2 - id: check-cache - with: - key: framework-${{ github.sha }} - path: dist/Envoy.framework - name: 'Download framework' - - run: exit 1 - if: steps.check-cache.outputs.cache-hit != 'true' - name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/swift/apps/experimental:app @@ -138,7 +97,6 @@ jobs: name: 'Log app run' swiftasyncawait: name: swift_async_await - needs: iosbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -147,15 +105,6 @@ jobs: submodules: true - run: ./ci/mac_ci_setup.sh name: 'Install dependencies' - - uses: actions/cache@v2 - id: check-cache - with: - key: framework-${{ github.sha }} - path: dist/Envoy.framework - name: 'Download framework' - - run: exit 1 - if: steps.check-cache.outputs.cache-hit != 'true' - name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/swift/async_await:app @@ -172,7 +121,6 @@ jobs: name: 'Log app run' objchelloworld: name: objc_helloworld - needs: iosbuild runs-on: macos-12 timeout-minutes: 25 steps: @@ -181,15 +129,6 @@ jobs: submodules: true - run: ./ci/mac_ci_setup.sh name: 'Install dependencies' - - uses: actions/cache@v2 - id: check-cache - with: - key: framework-${{ github.sha }} - path: dist/Envoy.framework - name: 'Download framework' - - run: exit 1 - if: steps.check-cache.outputs.cache-hit != 'true' - name: 'Short-circuit' - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./bazelw build --config=ios --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //examples/objective-c/hello_world:app diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59a6ceaeb3..4f6725221d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ //:android_dist_ci - name: 'Tar artifacts' - run: tar -czvf envoy_android_aar_sources.tar.gz dist/envoy.aar dist/envoy-pom.xml dist/envoy-javadoc.jar dist/envoy-sources.jar + run: tar -czvf envoy_android_aar_sources.tar.gz bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy.aar bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-pom.xml bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-sources.jar bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-javadoc.jar - uses: actions/upload-artifact@v2 with: name: envoy_android_aar_sources @@ -52,7 +52,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: envoy_android_aar_sources - path: dist/ + path: . - run: tar -xvf dist/envoy_android_aar_sources.tar.gz - name: 'Configure envoy-bot git user' run: | @@ -75,10 +75,10 @@ jobs: gpg --passphrase $GPG_PASSPHRASE --batch --import signing-key shred signing-key - gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab dist/envoy.aar - gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab dist/envoy-pom.xml - gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab dist/envoy-javadoc.jar - gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab dist/envoy-sources.jar + gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy.aar -o aar.asc + gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-pom.xml -o xml.asc + gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-javadoc.jar -o javadoc.asc + gpg --pinentry-mode=loopback --passphrase $GPG_PASSPHRASE -ab bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-sources.jar -o sources.asc - name: 'Release to sonatype repository' env: READWRITE_USER: ${{ secrets.sonatype_user }} @@ -86,19 +86,19 @@ jobs: ENVOY_PROXY_PROFILE_ID: ${{ secrets.envoy_proxy_profile_id }} run: | current_release_tag=$(git describe --tags --abbrev=0 --exact-match) - python dist/sonatype_nexus_upload.py \ + python ci/sonatype_nexus_upload.py \ --profile_id=$ENVOY_PROXY_PROFILE_ID \ --version="${current_release_tag:1}" \ --files \ - dist/envoy.aar \ - dist/envoy-pom.xml \ - dist/envoy-sources.jar \ - dist/envoy-javadoc.jar \ + bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy.aar \ + bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-pom.xml \ + bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-sources.jar \ + bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-javadoc.jar \ --signed_files \ - dist/envoy-sources.jar.asc \ - dist/envoy.aar.asc \ - dist/envoy-pom.xml.asc \ - dist/envoy-javadoc.jar.asc + sources.asc \ + aar.asc \ + xml.asc \ + javadoc.asc ios_release_artifacts_framework: name: ios_release_artifacts_framework @@ -119,15 +119,11 @@ jobs: --ios_multi_cpus=i386,x86_64,armv7,arm64 \ --config=remote-ci-macos \ --remote_header="Authorization=Bearer $GITHUB_TOKEN" \ - //:ios_dist - - name: 'Create temporary directory for artifact to produce properly named zip' - run: mkdir -p dist/ios_artifact/Envoy.framework - - name: 'Move artifact to directory for zipping' - run: mv dist/Envoy.framework/* dist/ios_artifact/Envoy.framework + //library/swift:ios_framework - uses: actions/upload-artifact@v2 with: name: envoy_ios_framework - path: dist/ios_artifact + path: bazel-bin/library/swift/ios_framework.zip ios_release_artifacts_cocoapods: name: ios_release_artifacts_cocoapods diff --git a/.gitignore b/.gitignore index d212a33590..e52f81155e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,15 +5,7 @@ .vscode /bazel-* /build_* -/dist/*pom.xml -/dist/*.aar -/dist/*.jar -/dist/*.objdump -/dist/*.objdump.gz -/dist/envoy_aar_sources.zip -/dist/Envoy.framework -/dist/*.asc -/dist/*.sha256 +/dist/ /generated /test/coverage/BUILD /tmp diff --git a/BUILD b/BUILD index 6a3cbca360..c8b6e1b787 100644 --- a/BUILD +++ b/BUILD @@ -1,25 +1,33 @@ +load("@build_bazel_rules_android//android:rules.bzl", "aar_import") +load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_framework_import") load("@io_bazel_rules_kotlin//kotlin/internal:toolchains.bzl", "define_kt_toolchain") +load("//bazel:framework_imports_extractor.bzl", "framework_imports_extractor") licenses(["notice"]) # Apache 2 alias( - name = "ios_framework", + name = "ios_dist", actual = "//library/swift:ios_framework", - visibility = ["//visibility:public"], ) -genrule( - name = "ios_dist", - srcs = [":ios_framework"], - outs = ["ios_out"], - cmd = """ -unzip -o $< -d dist/ -touch $@ -""", - stamp = True, - # This action writes to a non-hermetic output location, so it needs to run - # locally. - tags = ["local"], +framework_imports_extractor( + name = "framework_imports", + framework = "//library/swift:ios_framework", +) + +apple_static_framework_import( + name = "envoy_mobile_ios", + framework_imports = [":framework_imports"], + sdk_dylibs = [ + "resolv.9", + "c++", + ], + sdk_frameworks = [ + "Network", + "SystemConfiguration", + "UIKit", + ], + visibility = ["//visibility:public"], ) alias( @@ -28,53 +36,24 @@ alias( visibility = ["//visibility:public"], ) -genrule( - name = "android_dist_ci", - srcs = [ - "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_with_artifacts", - ], - outs = ["envoy_mobile.zip"], - cmd = """ - for artifact in $(SRCS); do - chmod 755 $$artifact - cp $$artifact dist/ - done - touch $@ - """, - local = True, - stamp = True, - tools = ["//bazel:zipper"], +aar_import( + name = "envoy_mobile_android", + aar = "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar", visibility = ["//visibility:public"], ) -genrule( +alias( + name = "android_dist_ci", + actual = "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_with_artifacts", +) + +filegroup( name = "android_dist", srcs = [ "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar", - "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_pom_xml", "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_objdump_collector", + "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_pom_xml", ], - outs = ["output_in_dist_directory"], - cmd = """ - set -- $(SRCS) - chmod 755 $$1 - chmod 755 $$2 - cp $$1 dist/envoy.aar - cp $$2 dist/envoy-pom.xml - shift 2 - - mkdir -p dist/symbols - if [[ -n "$$@" ]]; then - chmod 755 $$@ - cp $$@ dist/symbols - tar -cvf dist/symbols.tar dist/symbols - fi - touch $@ - """, - stamp = True, - # This action writes to a non-hermetic output location, so it needs to run - # locally. - tags = ["local"], ) define_kt_toolchain( diff --git a/bazel/android_artifacts.bzl b/bazel/android_artifacts.bzl index 65f20779c6..e577b4d2a5 100644 --- a/bazel/android_artifacts.bzl +++ b/bazel/android_artifacts.bzl @@ -1,3 +1,4 @@ +load("@build_bazel_rules_android//android:rules.bzl", "android_binary") load("@envoy_mobile//bazel:dokka.bzl", "sources_javadocs") load("@rules_java//java:defs.bzl", "java_binary") load("@rules_cc//cc:defs.bzl", "cc_library") @@ -191,7 +192,7 @@ def _create_jni_library(name, native_deps = []): ) # This outputs {jni_archive_name}_unsigned.apk which will contain the base files for our aar - native.android_binary( + android_binary( name = jni_archive_name, manifest = name + "_generated_AndroidManifest.xml", custom_package = "does.not.matter", @@ -221,7 +222,7 @@ def _create_classes_jar(name, manifest, android_library): # This creates bazel-bin/library/kotlin/io/envoyproxy/envoymobile/{name}_bin_deploy.jar # This jar has all the classes needed for our aar and will be our `classes.jar` - native.android_binary( + android_binary( name = android_binary_name, manifest = manifest, custom_package = "does.not.matter", diff --git a/bazel/framework_imports_extractor.bzl b/bazel/framework_imports_extractor.bzl new file mode 100644 index 0000000000..f4a270a314 --- /dev/null +++ b/bazel/framework_imports_extractor.bzl @@ -0,0 +1,56 @@ +""" +This rule declares outputs for files from a distributable framework. +This allows us to reproduce what it's like to import our distribution artifact +within the same build. Ideally we could just propagate the directory so we +didn't have to enumerate the files in the framework zip, but that isn't +supported by 'apple_static_framework_import'. +""" + +load("//bazel:config.bzl", "MINIMUM_IOS_VERSION") + +def _framework_imports_extractor(ctx): + outputs = [ + ctx.actions.declare_file("Envoy.framework/Envoy"), + ctx.actions.declare_file("Envoy.framework/Headers/Envoy.h"), + ctx.actions.declare_file("Envoy.framework/Modules/module.modulemap"), + ] + for arch in ctx.split_attr.framework.keys(): + if not arch.startswith("ios_"): + fail("Unexpected arch: {}".format(arch)) + + arch = arch[4:] + + # ios_sim_arm64 is a temporary special case for the M1. + if arch.startswith("sim_"): + arch = arch[4:] + + outputs.extend([ + ctx.actions.declare_file("Envoy.framework/Modules/Envoy.swiftmodule/{}.swiftdoc".format(arch)), + ctx.actions.declare_file("Envoy.framework/Modules/Envoy.swiftmodule/{}.swiftinterface".format(arch)), + ]) + + if len(ctx.attr.framework[0].files.to_list()) != 1: + fail("Expected exactly one framework zip, got {}".format(ctx.attr.framework[0].files)) + + framework_zip = ctx.attr.framework[0].files.to_list()[0] + ctx.actions.run_shell( + inputs = [framework_zip], + outputs = outputs, + command = "unzip -qq {} -d {}".format(framework_zip.path, ctx.bin_dir.path), + progress_message = "Extracting framework", + ) + + return [DefaultInfo(files = depset(outputs))] + +framework_imports_extractor = rule( + attrs = dict( + framework = attr.label( + mandatory = True, + cfg = apple_common.multi_arch_split, + ), + platform_type = attr.string(default = "ios"), + minimum_os_version = attr.string(default = MINIMUM_IOS_VERSION), + ), + # fragments = ["apple"], + implementation = _framework_imports_extractor, +) diff --git a/bazel/kotlin_test.bzl b/bazel/kotlin_test.bzl index 2abe7bf0fb..dc83c4b86e 100644 --- a/bazel/kotlin_test.bzl +++ b/bazel/kotlin_test.bzl @@ -1,3 +1,4 @@ +load("@build_bazel_rules_android//android:rules.bzl", "android_library", "android_local_test") load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") load("//bazel:kotlin_lib.bzl", "native_lib_name") @@ -67,7 +68,7 @@ def envoy_mobile_kt_test(name, srcs, deps = [], repository = "", exec_properties # A basic macro to run android based (robolectric) tests with native dependencies def envoy_mobile_android_test(name, srcs, deps = [], native_deps = [], repository = "", library_path = "library/common/jni", exec_properties = {}): lib_name = native_lib_name(native_deps[0])[3:] - native.android_library( + android_library( name = name + "_test_lib", custom_package = "io.envoyproxy.envoymobile.test", manifest = repository + "//bazel:test_manifest.xml", @@ -76,8 +77,7 @@ def envoy_mobile_android_test(name, srcs, deps = [], native_deps = [], repositor exports = deps, testonly = True, ) - - native.android_local_test( + android_local_test( name = name, srcs = srcs, data = native_deps, diff --git a/dist/sonatype_nexus_upload.py b/ci/sonatype_nexus_upload.py similarity index 96% rename from dist/sonatype_nexus_upload.py rename to ci/sonatype_nexus_upload.py index 98a4d016b3..4a91ea10e5 100755 --- a/dist/sonatype_nexus_upload.py +++ b/ci/sonatype_nexus_upload.py @@ -133,7 +133,7 @@ def _upload_files(staging_id, version, files, ascs, sha256): # aggregate all the files for uploading all_files = files + ascs + sha256 for file in all_files: - # This will output "dist/envoy", ".aar" for "dist/envoy.aar + # This will output "envoy", ".aar" for "envoy.aar print("Uploading file {}".format(file)) suffix, file_extension = _resolve_name(file) basename = "{name}-{version}{suffix}.{extension}".format( @@ -281,10 +281,10 @@ def _build_parser(): Files to upload The checklist for Envoy Mobile files are: - dist/envoy.aar - dist/envoy-pom.xml - dist/envoy-sources.jar - dist/envoy-javadoc.jar + envoy.aar + envoy-pom.xml + envoy-sources.jar + envoy-javadoc.jar """) parser.add_argument("--signed_files", nargs="+", required=False, help=""" @@ -292,10 +292,10 @@ def _build_parser(): Sonatype requires uploaded artifacts to be gpg signed GPG signed: - dist/envoy.aar.asc - dist/envoy-pom.xml.asc - dist/envoy-sources.jar.asc - dist/envoy-javadoc.jar.asc + envoy.aar.asc + envoy-pom.xml.asc + envoy-sources.jar.asc + envoy-javadoc.jar.asc """) return parser diff --git a/dist/BUILD b/dist/BUILD deleted file mode 100644 index 2657e4bc00..0000000000 --- a/dist/BUILD +++ /dev/null @@ -1,30 +0,0 @@ -load("@build_bazel_rules_android//android:rules.bzl", "aar_import") -load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_framework_import") - -licenses(["notice"]) # Apache 2 - -# NOTE: You must first build the top-level targets //:ios_dist and //:android_dist to use the -# artifacts referenced here. -# You can also download the distributables referenced here from envoy-mobile's releases page: -# https://github.com/envoyproxy/envoy-mobile/releases - -aar_import( - name = "envoy_mobile_android", - aar = "envoy.aar", - visibility = ["//visibility:public"], -) - -apple_static_framework_import( - name = "envoy_mobile_ios", - framework_imports = glob(["Envoy.framework/**"]), - sdk_dylibs = [ - "resolv.9", - "c++", - ], - sdk_frameworks = [ - "Network", - "SystemConfiguration", - "UIKit", - ], - visibility = ["//visibility:public"], -) diff --git a/docs/root/start/building/building.rst b/docs/root/start/building/building.rst index ef30a6428c..acacc68450 100644 --- a/docs/root/start/building/building.rst +++ b/docs/root/start/building/building.rst @@ -71,12 +71,12 @@ This command is defined in the main :repo:`BUILD ` file of the repo, and ``./bazelw build android_dist --config=android --fat_apk_cpu=`` -Upon completion of the build, you'll see an ``envoy.aar`` file at :repo:`dist/envoy.aar `. +Upon completion of the build, you'll see an ``envoy.aar`` file at :repo:`bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy.aar`. Alternatively, you can use the **prebuilt artifact** from Envoy Mobile's releases_ or from :ref:`Maven `. -The ``envoy_mobile_android`` Bazel rule defined in the :repo:`dist BUILD file ` provides +The ``envoy_mobile_android`` Bazel rule defined in the :repo:`root BUILD file ` provides an example of how this artifact may be used. **When building the artifact for release** (usage outside of development), be sure to include the @@ -97,15 +97,11 @@ This command is defined in the main :repo:`BUILD ` file of the repo, and ``./bazelw build ios_dist --config=ios`` -Upon completion of the build, you'll see a ``Envoy.framework`` directory at -:repo:`dist/Envoy.framework `. +Upon completion of the build, you'll see a ``ios_framework.zip`` file at output in a path bazel picks. Alternatively, you can use the prebuilt artifact from Envoy Mobile's releases_ (envoy_android_aar_sources.zip) or from :ref:`CocoaPods `. -The ``envoy_mobile_ios`` Bazel rule defined in the :repo:`dist BUILD file ` provides an -example of how this artifact may be used. - **When building the artifact for release** (usage outside of development), be sure to include the ``--config=release-ios`` option, along with the architectures for which the artifact is being built: @@ -176,7 +172,7 @@ To deploy Envoy Mobile's aar to your local maven repository, run the following c ./bazelw build android_dist --config=android --fat_apk_cpu=x86 # To publish to local maven. - dist/sonatype_nexus_upload.py --files dist/envoy.aar dist/envoy-pom.xml --local + ci/sonatype_nexus_upload.py --local --files bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy.aar bazel-bin/library/kotlin/io/envoyproxy/envoymobile/envoy-pom.xml The version deployed will be ``LOCAL-SNAPSHOT``. These artifacts can be found in your local maven directory (``~/.m2/repository/io/envoyproxy/envoymobile/envoy/LOCAL-SNAPSHOT/``) diff --git a/examples/java/hello_world/BUILD b/examples/java/hello_world/BUILD index eda8ee3f20..fe3739a27e 100644 --- a/examples/java/hello_world/BUILD +++ b/examples/java/hello_world/BUILD @@ -28,7 +28,7 @@ kt_android_library( "res/layout/activity_main.xml", ], deps = [ - "//dist:envoy_mobile_android", + "//:envoy_mobile_android", "//examples/kotlin/shared:hello_envoy_shared_lib", artifact("androidx.recyclerview:recyclerview"), artifact("androidx.annotation:annotation"), diff --git a/examples/kotlin/hello_world/BUILD b/examples/kotlin/hello_world/BUILD index 61635225f1..07fbe4fbb7 100644 --- a/examples/kotlin/hello_world/BUILD +++ b/examples/kotlin/hello_world/BUILD @@ -29,7 +29,7 @@ kt_android_library( "res/layout/activity_main.xml", ], deps = [ - "//dist:envoy_mobile_android", + "//:envoy_mobile_android", "//examples/kotlin/shared:hello_envoy_shared_lib", artifact("androidx.recyclerview:recyclerview"), artifact("androidx.annotation:annotation"), diff --git a/examples/objective-c/hello_world/BUILD b/examples/objective-c/hello_world/BUILD index 39f19d73ce..96ba9f355f 100644 --- a/examples/objective-c/hello_world/BUILD +++ b/examples/objective-c/hello_world/BUILD @@ -10,7 +10,7 @@ objc_library( "*.h", "*.m", ]), - deps = ["//dist:envoy_mobile_ios"], + deps = ["//:envoy_mobile_ios"], ) ios_application( diff --git a/examples/swift/async_await/BUILD b/examples/swift/async_await/BUILD index 8ad89a6f80..12e6582b0d 100644 --- a/examples/swift/async_await/BUILD +++ b/examples/swift/async_await/BUILD @@ -7,7 +7,7 @@ swift_library( name = "appmain", srcs = glob(["*.swift"]), linkopts = ["-lNetwork"], - deps = ["//dist:envoy_mobile_ios"], + deps = ["//:envoy_mobile_ios"], ) ios_application( diff --git a/examples/swift/hello_world/BUILD b/examples/swift/hello_world/BUILD index 7599269040..123d5abc1c 100644 --- a/examples/swift/hello_world/BUILD +++ b/examples/swift/hello_world/BUILD @@ -7,7 +7,7 @@ licenses(["notice"]) # Apache 2 swift_library( name = "appmain", srcs = glob(["*.swift"]), - deps = ["//dist:envoy_mobile_ios"], + deps = ["//:envoy_mobile_ios"], ) ios_application( diff --git a/library/java/io/envoyproxy/envoymobile/engine/BUILD b/library/java/io/envoyproxy/envoymobile/engine/BUILD index 3b0f29c85e..3cd8171616 100644 --- a/library/java/io/envoyproxy/envoymobile/engine/BUILD +++ b/library/java/io/envoyproxy/envoymobile/engine/BUILD @@ -1,3 +1,4 @@ +load("@build_bazel_rules_android//android:rules.bzl", "android_library") load("@rules_java//java:defs.bzl", "java_library") licenses(["notice"]) # Apache 2 diff --git a/library/java/org/chromium/net/BUILD b/library/java/org/chromium/net/BUILD index 64bc1d6db3..dd4c59e1e4 100644 --- a/library/java/org/chromium/net/BUILD +++ b/library/java/org/chromium/net/BUILD @@ -1,3 +1,4 @@ +load("@build_bazel_rules_android//android:rules.bzl", "android_library") load("@rules_jvm_external//:defs.bzl", "artifact") licenses(["notice"]) # Apache 2 diff --git a/test/java/io/envoyproxy/envoymobile/engine/testing/BUILD b/test/java/io/envoyproxy/envoymobile/engine/testing/BUILD index fcdd93891c..efcd796cfa 100644 --- a/test/java/io/envoyproxy/envoymobile/engine/testing/BUILD +++ b/test/java/io/envoyproxy/envoymobile/engine/testing/BUILD @@ -1,3 +1,4 @@ +load("@build_bazel_rules_android//android:rules.bzl", "android_library") load("@envoy//bazel:envoy_build_system.bzl", "envoy_package") load("@envoy_mobile//bazel:kotlin_test.bzl", "envoy_mobile_android_test") diff --git a/test/kotlin/apps/baseline/BUILD b/test/kotlin/apps/baseline/BUILD index 61635225f1..07fbe4fbb7 100644 --- a/test/kotlin/apps/baseline/BUILD +++ b/test/kotlin/apps/baseline/BUILD @@ -29,7 +29,7 @@ kt_android_library( "res/layout/activity_main.xml", ], deps = [ - "//dist:envoy_mobile_android", + "//:envoy_mobile_android", "//examples/kotlin/shared:hello_envoy_shared_lib", artifact("androidx.recyclerview:recyclerview"), artifact("androidx.annotation:annotation"), diff --git a/test/kotlin/apps/experimental/BUILD b/test/kotlin/apps/experimental/BUILD index 61635225f1..07fbe4fbb7 100644 --- a/test/kotlin/apps/experimental/BUILD +++ b/test/kotlin/apps/experimental/BUILD @@ -29,7 +29,7 @@ kt_android_library( "res/layout/activity_main.xml", ], deps = [ - "//dist:envoy_mobile_android", + "//:envoy_mobile_android", "//examples/kotlin/shared:hello_envoy_shared_lib", artifact("androidx.recyclerview:recyclerview"), artifact("androidx.annotation:annotation"), diff --git a/test/swift/apps/baseline/BUILD b/test/swift/apps/baseline/BUILD index a91d847487..96a3bf4c14 100644 --- a/test/swift/apps/baseline/BUILD +++ b/test/swift/apps/baseline/BUILD @@ -7,7 +7,7 @@ licenses(["notice"]) # Apache 2 swift_library( name = "appmain", srcs = glob(["*.swift"]), - deps = ["//dist:envoy_mobile_ios"], + deps = ["//:envoy_mobile_ios"], ) ios_application( diff --git a/test/swift/apps/experimental/BUILD b/test/swift/apps/experimental/BUILD index 7599269040..123d5abc1c 100644 --- a/test/swift/apps/experimental/BUILD +++ b/test/swift/apps/experimental/BUILD @@ -7,7 +7,7 @@ licenses(["notice"]) # Apache 2 swift_library( name = "appmain", srcs = glob(["*.swift"]), - deps = ["//dist:envoy_mobile_ios"], + deps = ["//:envoy_mobile_ios"], ) ios_application( diff --git a/test/swift/integration/BUILD b/test/swift/integration/BUILD index 47f604fe5f..f5531c3971 100644 --- a/test/swift/integration/BUILD +++ b/test/swift/integration/BUILD @@ -1,3 +1,4 @@ +load("@rules_cc//cc:defs.bzl", "objc_library") load("@envoy_mobile//bazel:apple_test.bzl", "envoy_mobile_swift_test") load("@envoy_mobile//bazel:envoy_mobile_test_extensions.bzl", "TEST_EXTENSIONS") load("@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library") diff --git a/tools/check_format.sh b/tools/check_format.sh index d1373d26fb..d57fff5c4d 100755 --- a/tools/check_format.sh +++ b/tools/check_format.sh @@ -23,7 +23,7 @@ TARGET_PATH="$2" # TODO(mattklein123): WORKSPACE is excluded due to warning about @bazel_tools reference. Fix here # or in the upstream checker. ENVOY_BAZEL_PREFIX=@envoy envoy/tools/code_format/check_format.py \ - --add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/Envoy.framework/ ./library/common/config_template.cc ./bazel/envoy_mobile_swift_bazel_support.bzl ./bazel/envoy_mobile_repositories.bzl \ + --add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/ ./library/common/config_template.cc ./bazel/envoy_mobile_swift_bazel_support.bzl ./bazel/envoy_mobile_repositories.bzl \ --skip_envoy_build_rule_check "$ENVOY_FORMAT_ACTION" $TARGET_PATH \ --namespace_check_excluded_paths ./envoy ./examples/ ./library/java/ ./library/kotlin ./library/objective-c ./test/java ./test/java ./test/objective-c ./test/swift ./experimental/swift \ --build_fixer_check_excluded_paths ./envoy ./BUILD ./dist ./examples ./library/java ./library/kotlin ./library/objective-c ./library/swift ./library/common/extensions ./test/java ./test/kotlin ./test/objective-c ./test/swift ./experimental/swift