Cleans up supporting files for Swift and ObjC TensorFlow Lite libraries to make them consistent.

PiperOrigin-RevId: 236400962
This commit is contained in:
A. Unique TensorFlower 2019-03-01 16:38:56 -08:00 committed by TensorFlower Gardener
parent 3f9baa80cd
commit 9d952151b5
6 changed files with 51 additions and 45 deletions

View File

@ -1,4 +1,4 @@
# TensorFlow Lite Objective-C API.
# TensorFlow Lite for Objective-C
package(default_visibility = ["//visibility:private"])
@ -83,11 +83,13 @@ ios_unit_test(
"notsan",
"nomsan",
],
deps = [":TensorFlowLiteTestsLib"],
deps = [
":TestsLib",
],
)
objc_library(
name = "TensorFlowLiteTestsLib",
name = "TestsLib",
testonly = 1,
srcs = glob([
"tests/*.m",

View File

@ -1,4 +1,4 @@
# TensorFlow Lite Objective-C Library
# TensorFlow Lite for Objective-C
[TensorFlow Lite](https://www.tensorflow.org/lite/) is TensorFlow's lightweight
solution for Objective-C developers. It enables low-latency inference of
@ -44,9 +44,11 @@ bazel test tensorflow/lite/experimental/objc:TensorFlowLiteTests
### Tulsi
Open the `TensorFlowLiteObjc.tulsiproj` using the Tulsi application on Mac or by
running the following command in Terminal from the root source directory:
Open the `TensorFlowLite.tulsiproj` using the
[TulsiApp](https://github.com/bazelbuild/tulsi) or by running the
[`generate_xcodeproj.sh`](https://github.com/bazelbuild/tulsi/blob/master/src/tools/generate_xcodeproj.sh)
script from the root `tensorflow` directory:
```shell
generate_xcodeproj.sh --genconfig tensorflow/lite/experimental/objc/TensorFlowLiteObjc.tulsiproj:TensorFlowLiteObjC --outputfolder ~/path/to/xcodeproj
generate_xcodeproj.sh --genconfig tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj:TensorFlowLite --outputfolder ~/path/to/generated/TensorFlowLite.xcodeproj
```

View File

@ -15,7 +15,7 @@
"//tensorflow/lite/experimental/objc:TensorFlowLite",
"//tensorflow/lite/experimental/objc:TensorFlowLiteTests",
],
"projectName" : "TensorFlowLiteObjC",
"projectName" : "TensorFlowLite",
"optionSet" : {
"LaunchActionPreActionScript" : {
"p" : "$(inherited)"

View File

@ -9,7 +9,7 @@
},
}
},
"projectName" : "TensorFlowLiteObjC",
"projectName" : "TensorFlowLite",
"packages" : [
"tensorflow/lite/experimental/objc"
],

View File

@ -1,4 +1,4 @@
# TensorFlow Lite for Swift.
# TensorFlow Lite for Swift
package(default_visibility = ["//visibility:private"])
@ -11,10 +11,6 @@ load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
MINIMUM_OS_VERSION = "9.0"
SWIFT_COPTS = [
"-wmo",
]
# Default tags for filtering targets. Targets in this file are restricted to Apple platforms.
DEFAULT_TAGS = [
"apple",
@ -24,7 +20,6 @@ DEFAULT_TAGS = [
swift_library(
name = "TensorFlowLite",
srcs = glob(["Sources/*.swift"]),
copts = SWIFT_COPTS,
module_name = "TensorFlowLite",
tags = DEFAULT_TAGS,
deps = [
@ -42,31 +37,11 @@ ios_unit_test(
"nomsan",
"notsan",
],
deps = [":TensorFlowLiteTestsLib"],
)
swift_library(
name = "TensorFlowLiteTestsLib",
testonly = 1,
srcs = glob(["Tests/*.swift"]),
copts = SWIFT_COPTS,
tags = DEFAULT_TAGS,
deps = [
":TensorFlowLite",
":TestResources",
":TestsLib",
],
)
objc_library(
name = "TestResources",
data = [
"//tensorflow/lite:testdata/add.bin",
"//tensorflow/lite:testdata/add_quantized.bin",
"//tensorflow/lite:testdata/multi_add.bin",
],
tags = DEFAULT_TAGS,
)
ios_application(
name = "TensorFlowLiteApp",
app_icons = glob(["TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Assets.xcassets/AppIcon.appiconset/**"]),
@ -82,25 +57,50 @@ ios_application(
"CoreGraphics",
],
tags = DEFAULT_TAGS,
deps = [":TensorFlowLiteAppLib"],
deps = [
":AppLib",
],
)
swift_library(
name = "TensorFlowLiteAppLib",
name = "TestsLib",
testonly = 1,
srcs = glob(["Tests/*.swift"]),
tags = DEFAULT_TAGS,
deps = [
":Resources",
":TensorFlowLite",
],
)
swift_library(
name = "AppLib",
srcs = glob(["TestApps/TensorFlowLiteApp/TensorFlowLiteApp/*.swift"]),
module_name = "TensorFlowLiteAppLib",
tags = DEFAULT_TAGS,
deps = [
":AppResources",
":TensorFlowLite",
":TensorFlowLiteAppResources",
],
)
objc_library(
name = "TensorFlowLiteAppResources",
name = "Resources",
data = [
"//tensorflow/lite:testdata/add.bin",
"//tensorflow/lite:testdata/add_quantized.bin",
"//tensorflow/lite:testdata/multi_add.bin",
],
tags = DEFAULT_TAGS,
)
objc_library(
name = "AppResources",
data = glob([
"TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Base.lproj/*.storyboard",
]),
tags = DEFAULT_TAGS,
deps = [":TestResources"],
deps = [
":Resources",
],
)

View File

@ -52,10 +52,12 @@ Note that `--swiftcopt=-enable-testing` is required for optimized builds (`-c op
### Tulsi
Open the `TensorFlowLite.tulsiproj` using the [TulsiApp](https://github.com/bazelbuild/tulsi) or by
running the [`generate_xcodeproj.sh`](https://github.com/bazelbuild/tulsi/blob/master/src/tools/generate_xcodeproj.sh)
script:
Open the `TensorFlowLite.tulsiproj` using the
[TulsiApp](https://github.com/bazelbuild/tulsi)
or by running the
[`generate_xcodeproj.sh`](https://github.com/bazelbuild/tulsi/blob/master/src/tools/generate_xcodeproj.sh)
script from the root `tensorflow` directory:
```shell
generate_xcodeproj.sh --genconfig tensorflow/lite/swift/TensorFlowLite.tulsiproj:TensorFlowLite --outputfolder ~/path/to/generated/TensorFlowLite.xcodeproj
generate_xcodeproj.sh --genconfig tensorflow/lite/experimental/swift/TensorFlowLite.tulsiproj:TensorFlowLite --outputfolder ~/path/to/generated/TensorFlowLite.xcodeproj
```