Updates TensorFlowLiteC podspec.
PiperOrigin-RevId: 242194312
diff --git a/configure.py b/configure.py
index 2908e38..2d919d8 100644
--- a/configure.py
+++ b/configure.py
@@ -58,6 +58,7 @@
# List of files to configure when building Bazel on Apple platforms.
APPLE_BAZEL_FILES = [
+ 'tensorflow/lite/experimental/ios/BUILD',
'tensorflow/lite/experimental/objc/BUILD',
'tensorflow/lite/experimental/swift/BUILD'
]
diff --git a/tensorflow/lite/experimental/c/BUILD b/tensorflow/lite/experimental/c/BUILD
index b4ee103..4fcb02d 100644
--- a/tensorflow/lite/experimental/c/BUILD
+++ b/tensorflow/lite/experimental/c/BUILD
@@ -1,4 +1,4 @@
-package(default_visibility = ["//visibility:private"])
+package(default_visibility = [":experimental"])
package_group(
name = "experimental",
diff --git a/tensorflow/lite/experimental/c/TensorFlowLiteC.bazel b/tensorflow/lite/experimental/c/TensorFlowLiteC.bazel
deleted file mode 100644
index 15593f4..0000000
--- a/tensorflow/lite/experimental/c/TensorFlowLiteC.bazel
+++ /dev/null
@@ -1,28 +0,0 @@
-# Bazel rules for building the TensorFlowLiteC iOS static framework.
-#
-# Add the build rules below to `//tensorflow/lite/experimental/c/BUILD`.
-# Build the framework:
-# bazel build tensorflow/lite/experimental/c:TensorFlowLiteC_framework -c fastbuild --ios_multi_cpus=x86_64,armv7,arm64 --apple_bitcode=embedded --copt=-fembed-bitcode
-# Unzip the generated framework:
-# unzip bazel-bin/tensorflow/lite/experimental/c/TensorFlowLiteC_framework.zip -d /Users/path/to/tensorflow/Frameworks
-
-load("@build_bazel_rules_apple//apple:ios.bzl", "ios_static_framework")
-load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")
-
-apple_bundle_version(
- name = "TensorFlowLiteC_version",
- build_version = "0.1.0",
- short_version_string = "0.1",
-)
-
-ios_static_framework(
- name = "TensorFlowLiteC_framework",
- hdrs = [
- "c_api.h",
- "c_api_types.h",
- ],
- bundle_name = "TensorFlowLiteC",
- minimum_os_version = "9.0",
- version = ":TensorFlowLiteC_version",
- deps = [":c_api"],
-)
diff --git a/tensorflow/lite/experimental/ios/BUILD.apple b/tensorflow/lite/experimental/ios/BUILD.apple
new file mode 100644
index 0000000..b221e9d
--- /dev/null
+++ b/tensorflow/lite/experimental/ios/BUILD.apple
@@ -0,0 +1,31 @@
+# TensorFlow Lite for iOS
+
+package(default_visibility = ["//visibility:private"])
+
+licenses(["notice"]) # Apache 2.0
+
+load("//tensorflow/lite/experimental/ios:ios.bzl", "TFL_MINIMUM_OS_VERSION")
+load("@build_bazel_rules_apple//apple:ios.bzl", "ios_static_framework")
+load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")
+
+apple_bundle_version(
+ name = "TensorFlowLiteC_version",
+ build_version = "0.1.0",
+ short_version_string = "0.1",
+)
+
+# Build the framework:
+# bazel build tensorflow/lite/experimental/ios:TensorFlowLiteC_framework -c fastbuild --ios_multi_cpus=x86_64,armv7,arm64 --apple_bitcode=embedded --copt=-fembed-bitcode
+# Unzip the generated framework:
+# unzip bazel-bin/tensorflow/lite/experimental/ios/TensorFlowLiteC_framework.zip -d /Users/path/to/tensorflow/Frameworks
+ios_static_framework(
+ name = "TensorFlowLiteC_framework",
+ hdrs = [
+ "//tensorflow/lite/experimental/c:c_api.h",
+ "//tensorflow/lite/experimental/c:c_api_types.h",
+ ],
+ bundle_name = "TensorFlowLiteC",
+ minimum_os_version = TFL_MINIMUM_OS_VERSION,
+ version = ":TensorFlowLiteC_version",
+ deps = ["//tensorflow/lite/experimental/c:c_api"],
+)
diff --git a/tensorflow/lite/experimental/c/TensorFlowLiteC.podspec b/tensorflow/lite/experimental/ios/TensorFlowLiteC.podspec
similarity index 83%
rename from tensorflow/lite/experimental/c/TensorFlowLiteC.podspec
rename to tensorflow/lite/experimental/ios/TensorFlowLiteC.podspec
index 275fddd..81fa3df 100644
--- a/tensorflow/lite/experimental/c/TensorFlowLiteC.podspec
+++ b/tensorflow/lite/experimental/ios/TensorFlowLiteC.podspec
@@ -6,7 +6,7 @@
s.authors = 'Google Inc.'
s.license = { :type => 'Apache' }
s.homepage = 'https://github.com/tensorflow/tensorflow'
- s.source = { :http => "https://dl.google.com/dl/tensorflow/lite/frameworks/TensorFlowLiteC/#{s.version}/TensorFlowLiteC-#{s.version}.tar.gz" }
+ s.source = { :http => "https://dl.google.com/dl/cpdc/e3b0c44298fc1c14/TensorFlowLiteC-#{s.version}.tar.gz" }
s.summary = 'TensorFlow Lite'
s.description = <<-DESC
diff --git a/tensorflow/lite/experimental/ios/ios.bzl b/tensorflow/lite/experimental/ios/ios.bzl
new file mode 100644
index 0000000..976c6b0
--- /dev/null
+++ b/tensorflow/lite/experimental/ios/ios.bzl
@@ -0,0 +1,15 @@
+"""TensorFlow Lite Build Configurations for iOS"""
+
+TFL_MINIMUM_OS_VERSION = "9.0"
+
+# Default tags for filtering iOS targets. Targets are restricted to Apple platforms.
+TFL_DEFAULT_TAGS = [
+ "apple",
+]
+
+# Following sanitizer tests are not supported by iOS test targets.
+TFL_DISABLED_SANITIZER_TAGS = [
+ "noasan",
+ "nomsan",
+ "notsan",
+]
diff --git a/tensorflow/lite/experimental/objc/BUILD.apple b/tensorflow/lite/experimental/objc/BUILD.apple
index 5d3d620..b118ae4 100644
--- a/tensorflow/lite/experimental/objc/BUILD.apple
+++ b/tensorflow/lite/experimental/objc/BUILD.apple
@@ -4,6 +4,7 @@
licenses(["notice"]) # Apache 2.0
+load("//tensorflow/lite/experimental/ios:ios.bzl", "TFL_DEFAULT_TAGS", "TFL_DISABLED_SANITIZER_TAGS", "TFL_MINIMUM_OS_VERSION")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
SOURCES = glob([
@@ -16,8 +17,6 @@
"apis/*.h",
])
-MINIMUM_OS_VERSION = "9.0"
-
# Compiler flags for building regular non-test libraries.
RELEASE_COPTS = [
# Enables language-specific warnings for Objective-C, Objective-C++, C, and C++.
@@ -54,18 +53,13 @@
"-Wno-shadow",
]
-# Default tags for filtering targets. Targets in this file are restricted to Apple platforms.
-DEFAULT_TAGS = [
- "apple",
-]
-
objc_library(
name = "TensorFlowLite",
srcs = SOURCES,
hdrs = API_HEADERS,
copts = RELEASE_COPTS,
module_map = "apis/module.modulemap",
- tags = DEFAULT_TAGS,
+ tags = TFL_DEFAULT_TAGS,
deps = [
"//tensorflow/lite/experimental/c:c_api",
],
@@ -75,14 +69,8 @@
ios_unit_test(
name = "TensorFlowLiteTests",
size = "small",
- minimum_os_version = MINIMUM_OS_VERSION,
- tags = DEFAULT_TAGS + [
- # These sanitizer tests are not supported by iOS build toolchain (b/74292221).
- # Disabled these for iOS test targets.
- "noasan",
- "notsan",
- "nomsan",
- ],
+ minimum_os_version = TFL_MINIMUM_OS_VERSION,
+ tags = TFL_DEFAULT_TAGS + TFL_DISABLED_SANITIZER_TAGS,
deps = [
":TestsLib",
],
@@ -104,7 +92,7 @@
"//tensorflow/lite:testdata/add.bin",
"//tensorflow/lite:testdata/add_quantized.bin",
],
- tags = DEFAULT_TAGS,
+ tags = TFL_DEFAULT_TAGS,
deps = [
":TensorFlowLite",
],
diff --git a/tensorflow/lite/experimental/swift/BUILD.apple b/tensorflow/lite/experimental/swift/BUILD.apple
index 0322056..44e73bd 100644
--- a/tensorflow/lite/experimental/swift/BUILD.apple
+++ b/tensorflow/lite/experimental/swift/BUILD.apple
@@ -4,21 +4,15 @@
licenses(["notice"]) # Apache 2.0
+load("//tensorflow/lite/experimental/ios:ios.bzl", "TFL_DEFAULT_TAGS", "TFL_DISABLED_SANITIZER_TAGS", "TFL_MINIMUM_OS_VERSION")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_unit_test")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
-MINIMUM_OS_VERSION = "9.0"
-
-# Default tags for filtering targets. Targets in this file are restricted to Apple platforms.
-DEFAULT_TAGS = [
- "apple",
-]
-
swift_library(
name = "TensorFlowLite",
srcs = glob(["Sources/*.swift"]),
module_name = "TensorFlowLite",
- tags = DEFAULT_TAGS,
+ tags = TFL_DEFAULT_TAGS,
deps = [
"//tensorflow/lite/experimental/c:c_api",
],
@@ -27,13 +21,8 @@
ios_unit_test(
name = "TensorFlowLiteTests",
size = "small",
- minimum_os_version = MINIMUM_OS_VERSION,
- tags = DEFAULT_TAGS + [
- # DISABLED: Following sanitizer tests are not supported by iOS test targets.
- "noasan",
- "nomsan",
- "notsan",
- ],
+ minimum_os_version = TFL_MINIMUM_OS_VERSION,
+ tags = TFL_DEFAULT_TAGS + TFL_DISABLED_SANITIZER_TAGS,
deps = [
":TestsLib",
],
@@ -49,11 +38,11 @@
],
infoplists = ["TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Info.plist"],
launch_storyboard = "TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Base.lproj/LaunchScreen.storyboard",
- minimum_os_version = MINIMUM_OS_VERSION,
+ minimum_os_version = TFL_MINIMUM_OS_VERSION,
sdk_frameworks = [
"CoreGraphics",
],
- tags = DEFAULT_TAGS + ["manual"],
+ tags = TFL_DEFAULT_TAGS + ["manual"],
deps = [
":AppLib",
],
@@ -63,7 +52,7 @@
name = "TestsLib",
testonly = 1,
srcs = glob(["Tests/*.swift"]),
- tags = DEFAULT_TAGS,
+ tags = TFL_DEFAULT_TAGS,
deps = [
":Resources",
":TensorFlowLite",
@@ -74,7 +63,7 @@
name = "AppLib",
srcs = glob(["TestApps/TensorFlowLiteApp/TensorFlowLiteApp/*.swift"]),
module_name = "AppLib",
- tags = DEFAULT_TAGS + ["manual"],
+ tags = TFL_DEFAULT_TAGS + ["manual"],
deps = [
":AppResources",
":TensorFlowLite",
@@ -88,7 +77,7 @@
"//tensorflow/lite:testdata/add_quantized.bin",
"//tensorflow/lite:testdata/multi_add.bin",
],
- tags = DEFAULT_TAGS,
+ tags = TFL_DEFAULT_TAGS,
)
objc_library(
@@ -96,7 +85,7 @@
data = glob([
"TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Base.lproj/*.storyboard",
]),
- tags = DEFAULT_TAGS + ["manual"],
+ tags = TFL_DEFAULT_TAGS + ["manual"],
deps = [
":Resources",
],