Updated iOS framework names

This commit is contained in:
Prianka Liz Kariat 2023-04-27 02:15:16 +05:30
parent 3390325250
commit 9c98435027
5 changed files with 36 additions and 32 deletions

View File

@ -27,13 +27,13 @@ package(default_visibility = ["//visibility:public"])
licenses(["notice"])
# list of targets to be added in avoid_deps of ":MediaPipeTaskVision_framework"
# and ":MediaPipeTaskText_framework".
# list of targets to be added in avoid_deps of ":MediaPipeTasksVision_framework"
# and ":MediaPipeTasksText_framework".
# The transitive closure of the following targets are used for building the
# frameworks but are avoided from the framework binaries to avoid duplicate symbols
# error when included in an xcode project:
# 1. iOS classes shared amongst the various vision and text tasks. These classes
# will be built with ":MediaPipeTaskCommon_framework"
# will be built with ":MediaPipeTasksCommon_framework"
# 2. Task graphs. These will be built with ":MediaPipeTaskGraphs_library".
# 3. gpu targets which will be built with the ":MediaPipeTaskGraphs_library".
OBJC_COMMON_DEPS = [
@ -73,7 +73,7 @@ strip_api_include_path_prefix(
)
apple_static_xcframework(
name = "MediaPipeTaskText_framework",
name = "MediaPipeTasksText_framework",
public_hdrs = [
":MPPBaseOptions.h",
":MPPCategory.h",
@ -90,7 +90,7 @@ apple_static_xcframework(
":MPPTextEmbedderOptions.h",
":MPPTextEmbedderResult.h",
],
bundle_name = "MediaPipeTaskText",
bundle_name = "MediaPipeTasksText",
ios = {
"simulator" : ["arm64", "x86_64"],
"device" : ["arm64"],
@ -102,14 +102,14 @@ apple_static_xcframework(
"//mediapipe/tasks/ios/text/text_classifier:MPPTextClassifier",
"//mediapipe/tasks/ios/text/text_embedder:MPPTextEmbedder",
],
# avoid dependencies of ":MediaPipeCommon_framework" and
# avoid dependencies of ":MediaPipeTasksCommon_framework" and
# ":MediaPipeTaskGraphs_library in order to prevent duplicate symbols error
# when the frameworks are imported in iOS projects.
avoid_deps = OBJC_COMMON_DEPS
)
apple_static_xcframework(
name = "MediaPipeTaskVision_framework",
name = "MediaPipeTasksVision_framework",
public_hdrs = [
":MPPBaseOptions.h",
":MPPCategory.h",
@ -127,7 +127,7 @@ apple_static_xcframework(
":MPPObjectDetectorOptions.h",
":MPPObjectDetectionResult.h",
],
bundle_name = "MediaPipeTaskVision",
bundle_name = "MediaPipeTasksVision",
ios = {
"simulator" : ["arm64", "x86_64"],
"device" : ["arm64"],
@ -139,7 +139,7 @@ apple_static_xcframework(
"//mediapipe/tasks/ios/vision/image_classifier:MPPImageClassifier",
"//mediapipe/tasks/ios/vision/object_detector:MPPObjectDetector",
],
# Avoids dependencies of ":MediaPipeCommon_framework" and
# Avoids dependencies of ":MediaPipeTasksCommon_framework" and
# ":MediaPipeTaskGraphs_library in order to prevent duplicate symbols error
# when the frameworks are imported in iOS projects.
# Also avoids opencv since it will be built with
@ -171,8 +171,8 @@ apple_static_library(
)
apple_static_xcframework(
name = "MediaPipeTaskCommon_framework",
bundle_name = "MediaPipeTaskCommon",
name = "MediaPipeTasksCommon_framework",
bundle_name = "MediaPipeTasksCommon",
ios = {
"simulator" : ["arm64", "x86_64"],
"device" : ["arm64"],

View File

@ -1,5 +1,5 @@
Pod::Spec.new do |s|
s.name = 'MediaPipeTaskCommon'
s.name = 'MediaPipeTasksCommon'
s.version = '${MPP_BUILD_VERSION}'
s.authors = 'Google Inc.'
s.license = { :type => 'Apache',:file => "LICENSE" }
@ -10,14 +10,14 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '11.0'
s.module_name = 'MediaPipeTaskCommon'
s.module_name = 'MediaPipeTasksCommon'
s.static_framework = true
s.user_target_xcconfig = {
'OTHER_LDFLAGS[sdk=iphonesimulator*]' => '$(inherited) -force_load "${PODS_ROOT}/MediaPipeTaskCommon/frameworks/graph_libraries/libMediaPipeTaskCommon_simulator_graph.a"',
'OTHER_LDFLAGS[sdk=iphoneos*]' => '$(inherited) -force_load "$(PODS_ROOT)/MediaPipeTaskCommon/frameworks/graph_libraries/libMediaPipeTaskCommon_device_graph.a"',
'OTHER_LDFLAGS[sdk=iphonesimulator*]' => '$(inherited) -force_load "${PODS_ROOT}/MediaPipeTasksCommon/frameworks/graph_libraries/libMediaPipeTasksCommon_simulator_graph.a"',
'OTHER_LDFLAGS[sdk=iphoneos*]' => '$(inherited) -force_load "$(PODS_ROOT)/MediaPipeTasksCommon/frameworks/graph_libraries/libMediaPipeTasksCommon_device_graph.a"',
}
s.frameworks = 'Accelerate', 'CoreMedia', 'AssetsLibrary', 'CoreFoundation', 'CoreGraphics', 'CoreImage', 'QuartzCore', 'AVFoundation', 'CoreVideo'
s.preserve_paths ='frameworks/graph_libraries/*.a'
s.library = 'c++'
s.vendored_frameworks = 'frameworks/MediaPipeTaskCommon.xcframework'
s.vendored_frameworks = 'frameworks/MediaPipeTasksCommon.xcframework'
end

View File

@ -1,5 +1,5 @@
Pod::Spec.new do |s|
s.name = 'MediaPipeTaskText'
s.name = 'MediaPipeTasksText'
s.version = '${MPP_BUILD_VERSION}'
s.authors = 'Google Inc.'
s.license = { :type => 'Apache',:file => "LICENSE" }
@ -10,9 +10,9 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '11.0'
s.module_name = 'MediaPipeTaskText'
s.module_name = 'MediaPipeTasksText'
s.static_framework = true
s.dependency 'MediaPipeTaskCommonObjects'
s.dependency 'MediaPipeTasksCommon'
s.library = 'c++'
s.vendored_frameworks = 'frameworks/MediaPipeTaskText.xcframework'
s.vendored_frameworks = 'frameworks/MediaPipeTasksText.xcframework'
end

View File

@ -1,5 +1,5 @@
Pod::Spec.new do |s|
s.name = 'MediaPipeTaskVision'
s.name = 'MediaPipeTasksVision'
s.version = '${MPP_BUILD_VERSION}'
s.authors = 'Google Inc.'
s.license = { :type => 'Apache',:file => "LICENSE" }
@ -10,9 +10,9 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '11.0'
s.module_name = 'MediaPipeTaskVision'
s.module_name = 'MediaPipeTasksVision'
s.static_framework = true
s.dependency 'MediaPipeTaskCommonObjects'
s.dependency 'MediaPipeTasksCommon'
s.library = 'c++'
s.vendored_frameworks = 'frameworks/MediaPipeTaskVision.xcframework'
s.vendored_frameworks = 'frameworks/MediaPipeTasksVision.xcframework'
end

View File

@ -16,7 +16,7 @@
# Set the following variables as appropriate.
# * BAZEL: path to bazel. defaults to the first one available in PATH
# * FRAMEWORK_NAME: name of the iOS framework to be built. Currently the
# * accepted values are MediaPipeTaskCommon, MediaPipeTaskText, MediaPipeTaskVision.
# * accepted values are MediaPipeTasksCommon, MediaPipeTasksText, MediaPipeTasksVision.
# * MPP_BUILD_VERSION: to specify the release version. defaults to 0.0.1-dev
# * IS_RELEASE_BUILD: set as true if this build should be a release build
# * ARCHIVE_FRAMEWORK: set as true if the framework should be archived
@ -47,10 +47,14 @@ if [ -z ${FRAMEWORK_NAME+x} ]; then
fi
case $FRAMEWORK_NAME in
"MediaPipeTaskText")
"MediaPipeTasksText")
;;
"MediaPipeTasksVision")
;;
"MediaPipeTasksCommon")
;;
*)
echo "Wrong framework name. The following framework names are allowed: MediaPipeTaskText"
echo "Wrong framework name. The following framework names are allowed: MediaPipeTasksText, MediaPipeTasksVision, MediaPipeTasksCommon"
exit 1
;;
esac
@ -106,11 +110,11 @@ function build_ios_frameworks_and_libraries {
local FRAMEWORK_CQUERY_COMMAND="-c opt --apple_generate_dsym=false ${FULL_FRAMEWORK_TARGET}"
IOS_FRAMEWORK_PATH="$(build_target "${FRAMEWORK_CQUERY_COMMAND}")"
# `MediaPipeTaskCommon`` pods must also include the task graph libraries which
# `MediaPipeTasksCommon`` pods must also include the task graph libraries which
# are to be force loaded. Hence the graph libraies are only built if the framework
# name is `MediaPipeTaskCommon`.`
# name is `MediaPipeTasksCommon`.`
case $FRAMEWORK_NAME in
"MediaPipeTaskCommon")
"MediaPipeTasksCommon")
local IOS_SIM_FAT_LIBRARY_CQUERY_COMMAND="-c opt --config=ios_sim_fat --apple_generate_dsym=false //mediapipe/tasks/ios:MediaPipeTaskGraphs_library"
IOS_GRAPHS_SIMULATOR_LIBRARY_PATH="$(build_target "${IOS_SIM_FAT_LIBRARY_CQUERY_COMMAND}")"
@ -141,10 +145,10 @@ function create_framework_archive {
echo ${IOS_FRAMEWORK_PATH}
unzip "${IOS_FRAMEWORK_PATH}" -d "${FRAMEWORKS_DIR}"
# If the framwork being built is `MediaPipeTaskCommon`, the built graph
# If the framwork being built is `MediaPipeTasksCommon`, the built graph
# libraries should be copied to the output directory which is to be archived.
case $FRAMEWORK_NAME in
"MediaPipeTaskCommon")
"MediaPipeTasksCommon")
local GRAPH_LIBRARIES_DIR="graph_libraries"