diff --git a/tensorflow/lite/experimental/objc/BUILD.apple b/tensorflow/lite/experimental/objc/BUILD.apple index e53de173b2b..fb1bda2f642 100644 --- a/tensorflow/lite/experimental/objc/BUILD.apple +++ b/tensorflow/lite/experimental/objc/BUILD.apple @@ -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", diff --git a/tensorflow/lite/experimental/objc/README.md b/tensorflow/lite/experimental/objc/README.md index 2940e052408..9dd5aa69739 100644 --- a/tensorflow/lite/experimental/objc/README.md +++ b/tensorflow/lite/experimental/objc/README.md @@ -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 ``` diff --git a/tensorflow/lite/experimental/objc/TensorFlowLiteObjc.tulsiproj/Configs/TensorFlowLiteObjc.tulsigen b/tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj/Configs/TensorFlowLite.tulsigen similarity index 97% rename from tensorflow/lite/experimental/objc/TensorFlowLiteObjc.tulsiproj/Configs/TensorFlowLiteObjc.tulsigen rename to tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj/Configs/TensorFlowLite.tulsigen index 091ef4e2ea8..04a2a2c19cd 100644 --- a/tensorflow/lite/experimental/objc/TensorFlowLiteObjc.tulsiproj/Configs/TensorFlowLiteObjc.tulsigen +++ b/tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj/Configs/TensorFlowLite.tulsigen @@ -15,7 +15,7 @@ "//tensorflow/lite/experimental/objc:TensorFlowLite", "//tensorflow/lite/experimental/objc:TensorFlowLiteTests", ], - "projectName" : "TensorFlowLiteObjC", + "projectName" : "TensorFlowLite", "optionSet" : { "LaunchActionPreActionScript" : { "p" : "$(inherited)" diff --git a/tensorflow/lite/experimental/objc/TensorFlowLiteObjc.tulsiproj/project.tulsiconf b/tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj/project.tulsiconf similarity index 86% rename from tensorflow/lite/experimental/objc/TensorFlowLiteObjc.tulsiproj/project.tulsiconf rename to tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj/project.tulsiconf index 0b6fedff3f6..e92cb481386 100644 --- a/tensorflow/lite/experimental/objc/TensorFlowLiteObjc.tulsiproj/project.tulsiconf +++ b/tensorflow/lite/experimental/objc/TensorFlowLite.tulsiproj/project.tulsiconf @@ -9,7 +9,7 @@ }, } }, - "projectName" : "TensorFlowLiteObjC", + "projectName" : "TensorFlowLite", "packages" : [ "tensorflow/lite/experimental/objc" ], diff --git a/tensorflow/lite/experimental/swift/BUILD.apple b/tensorflow/lite/experimental/swift/BUILD.apple index 7528b42751b..78a476c3fab 100644 --- a/tensorflow/lite/experimental/swift/BUILD.apple +++ b/tensorflow/lite/experimental/swift/BUILD.apple @@ -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", + ], ) diff --git a/tensorflow/lite/experimental/swift/README.md b/tensorflow/lite/experimental/swift/README.md index 754ecd68193..716ab33f8d6 100644 --- a/tensorflow/lite/experimental/swift/README.md +++ b/tensorflow/lite/experimental/swift/README.md @@ -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 ```