Updates TensorFlowLiteC podspec.

PiperOrigin-RevId: 242194312
This commit is contained in:
A. Unique TensorFlower
2019-04-05 14:28:27 -07:00
committed by TensorFlower Gardener
parent 841d6de2ee
commit 6a059c00dd
8 changed files with 64 additions and 68 deletions

View File

@@ -58,6 +58,7 @@ NCCL_LIB_PATHS = [
# 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'
]

View File

@@ -1,4 +1,4 @@
package(default_visibility = ["//visibility:private"])
package(default_visibility = [":experimental"])
package_group(
name = "experimental",

View File

@@ -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"],
)

View File

@@ -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"],
)

View File

@@ -6,7 +6,7 @@ Pod::Spec.new do |s|
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

View File

@@ -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",
]

View File

@@ -4,6 +4,7 @@ package(default_visibility = ["//visibility:private"])
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 @@ API_HEADERS = glob([
"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 @@ TEST_COPTS = RELEASE_COPTS + [
"-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 @@ objc_library(
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 @@ objc_library(
"//tensorflow/lite:testdata/add.bin",
"//tensorflow/lite:testdata/add_quantized.bin",
],
tags = DEFAULT_TAGS,
tags = TFL_DEFAULT_TAGS,
deps = [
":TensorFlowLite",
],

View File

@@ -4,21 +4,15 @@ package(default_visibility = ["//visibility:private"])
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 @@ swift_library(
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 @@ ios_application(
],
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 @@ swift_library(
name = "TestsLib",
testonly = 1,
srcs = glob(["Tests/*.swift"]),
tags = DEFAULT_TAGS,
tags = TFL_DEFAULT_TAGS,
deps = [
":Resources",
":TensorFlowLite",
@@ -74,7 +63,7 @@ swift_library(
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 @@ objc_library(
"//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 @@ objc_library(
data = glob([
"TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Base.lproj/*.storyboard",
]),
tags = DEFAULT_TAGS + ["manual"],
tags = TFL_DEFAULT_TAGS + ["manual"],
deps = [
":Resources",
],