Skip to content

Commit

Permalink
fix: validate bundle_id
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed Nov 24, 2021
1 parent 4921db1 commit 06423ca
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,11 @@ You cannot build native libraries for Android on Windows 10, so use [Docker for
1. (Optional) Install Xcode
1. (Optional) If you'd like to build for iOS, open [`mediapipe_api/objc/BUILD`](https://github.com/homuler/MediaPipeUnityPlugin/blob/master/mediapipe_api/objc/BUILD#L29) and modify `bundle_id`.
1. (Optional) Install Android SDK and Android NDK, and set environment variables
```sh
# bash
export ANDROID_HOME=/path/to/SDK
# ATTENTION!: Currently Bazel does not support NDK r22, so use NDK r21 instead.
export ANDROID_NDK_HOME=/path/to/ndk/21.4.7075529
Expand Down
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ http_archive(
patches = [
# Bypass checking ios unit test runner when building MP ios applications.
"@com_google_mediapipe//third_party:build_bazel_rules_apple_bypass_test_runner_check.diff",
"@//third_party:rules_apple_fix.diff",
],
sha256 = "55f4dc1c9bf21bb87442665f4618cff1f1343537a2bd89252078b987dcd9c382",
url = "https://github.com/bazelbuild/rules_apple/releases/download/0.20.0/rules_apple.0.20.0.tar.gz",
Expand Down
2 changes: 1 addition & 1 deletion mediapipe_api/objc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ objc_library(

ios_framework(
name = "MediaPipeUnity",
bundle_id = "YOUR_BUNDLE_ID_HERE.MediaPipeUnity",
bundle_id = "PLEASE_SET_YOUR_BUNDLE_ID_HERE.MediaPipeUnity",
families = [
"iphone",
"ipad",
Expand Down
20 changes: 20 additions & 0 deletions third_party/rules_apple_fix.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/apple/internal/ios_rules.bzl b/apple/internal/ios_rules.bzl
index ce76a4a..1f11b84 100644
--- a/apple/internal/ios_rules.bzl
+++ b/apple/internal/ios_rules.bzl
@@ -91,6 +91,7 @@ def _ios_application_impl(ctx):
binary_artifact = binary_target[apple_common.AppleExecutableBinary].binary

bundle_id = ctx.attr.bundle_id
+
bundle_verification_targets = [struct(target = ext) for ext in ctx.attr.extensions]
embeddable_targets = ctx.attr.frameworks + ctx.attr.extensions
if ctx.attr.watch_application:
@@ -198,6 +199,7 @@ def _ios_framework_impl(ctx):
binary_artifact = binary_target[apple_common.AppleDylibBinary].binary

bundle_id = ctx.attr.bundle_id
+ bundling_support.validate_bundle_id(bundle_id)

signed_frameworks = []
if getattr(ctx.file, "provisioning_profile", None):

0 comments on commit 06423ca

Please sign in to comment.