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"]) package(default_visibility = ["//visibility:private"])
@ -83,11 +83,13 @@ ios_unit_test(
"notsan", "notsan",
"nomsan", "nomsan",
], ],
deps = [":TensorFlowLiteTestsLib"], deps = [
":TestsLib",
],
) )
objc_library( objc_library(
name = "TensorFlowLiteTestsLib", name = "TestsLib",
testonly = 1, testonly = 1,
srcs = glob([ srcs = glob([
"tests/*.m", "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 [TensorFlow Lite](https://www.tensorflow.org/lite/) is TensorFlow's lightweight
solution for Objective-C developers. It enables low-latency inference of solution for Objective-C developers. It enables low-latency inference of
@ -44,9 +44,11 @@ bazel test tensorflow/lite/experimental/objc:TensorFlowLiteTests
### Tulsi ### Tulsi
Open the `TensorFlowLiteObjc.tulsiproj` using the Tulsi application on Mac or by Open the `TensorFlowLite.tulsiproj` using the
running the following command in Terminal from the root source directory: [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 ```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:TensorFlowLite",
"//tensorflow/lite/experimental/objc:TensorFlowLiteTests", "//tensorflow/lite/experimental/objc:TensorFlowLiteTests",
], ],
"projectName" : "TensorFlowLiteObjC", "projectName" : "TensorFlowLite",
"optionSet" : { "optionSet" : {
"LaunchActionPreActionScript" : { "LaunchActionPreActionScript" : {
"p" : "$(inherited)" "p" : "$(inherited)"

View File

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

View File

@ -1,4 +1,4 @@
# TensorFlow Lite for Swift. # TensorFlow Lite for Swift
package(default_visibility = ["//visibility:private"]) package(default_visibility = ["//visibility:private"])
@ -11,10 +11,6 @@ load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
MINIMUM_OS_VERSION = "9.0" MINIMUM_OS_VERSION = "9.0"
SWIFT_COPTS = [
"-wmo",
]
# Default tags for filtering targets. Targets in this file are restricted to Apple platforms. # Default tags for filtering targets. Targets in this file are restricted to Apple platforms.
DEFAULT_TAGS = [ DEFAULT_TAGS = [
"apple", "apple",
@ -24,7 +20,6 @@ DEFAULT_TAGS = [
swift_library( swift_library(
name = "TensorFlowLite", name = "TensorFlowLite",
srcs = glob(["Sources/*.swift"]), srcs = glob(["Sources/*.swift"]),
copts = SWIFT_COPTS,
module_name = "TensorFlowLite", module_name = "TensorFlowLite",
tags = DEFAULT_TAGS, tags = DEFAULT_TAGS,
deps = [ deps = [
@ -42,31 +37,11 @@ ios_unit_test(
"nomsan", "nomsan",
"notsan", "notsan",
], ],
deps = [":TensorFlowLiteTestsLib"],
)
swift_library(
name = "TensorFlowLiteTestsLib",
testonly = 1,
srcs = glob(["Tests/*.swift"]),
copts = SWIFT_COPTS,
tags = DEFAULT_TAGS,
deps = [ deps = [
":TensorFlowLite", ":TestsLib",
":TestResources",
], ],
) )
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( ios_application(
name = "TensorFlowLiteApp", name = "TensorFlowLiteApp",
app_icons = glob(["TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Assets.xcassets/AppIcon.appiconset/**"]), app_icons = glob(["TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Assets.xcassets/AppIcon.appiconset/**"]),
@ -82,25 +57,50 @@ ios_application(
"CoreGraphics", "CoreGraphics",
], ],
tags = DEFAULT_TAGS, tags = DEFAULT_TAGS,
deps = [":TensorFlowLiteAppLib"], deps = [
":AppLib",
],
) )
swift_library( 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"]), srcs = glob(["TestApps/TensorFlowLiteApp/TensorFlowLiteApp/*.swift"]),
module_name = "TensorFlowLiteAppLib", module_name = "TensorFlowLiteAppLib",
tags = DEFAULT_TAGS, tags = DEFAULT_TAGS,
deps = [ deps = [
":AppResources",
":TensorFlowLite", ":TensorFlowLite",
":TensorFlowLiteAppResources",
], ],
) )
objc_library( 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([ data = glob([
"TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Base.lproj/*.storyboard", "TestApps/TensorFlowLiteApp/TensorFlowLiteApp/Base.lproj/*.storyboard",
]), ]),
tags = DEFAULT_TAGS, 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 ### Tulsi
Open the `TensorFlowLite.tulsiproj` using the [TulsiApp](https://github.com/bazelbuild/tulsi) or by Open the `TensorFlowLite.tulsiproj` using the
running the [`generate_xcodeproj.sh`](https://github.com/bazelbuild/tulsi/blob/master/src/tools/generate_xcodeproj.sh) [TulsiApp](https://github.com/bazelbuild/tulsi)
script: 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 ```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
``` ```