Migrate tf_backend to webfiles rules.

Change: 146938071
This commit is contained in:
Dandelion Mané 2017-02-08 11:53:22 -08:00 committed by TensorFlower Gardener
parent f006837ce0
commit 42dc6764a0
4 changed files with 99 additions and 3 deletions

View File

@ -13,8 +13,11 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
declare function stub(el: string, obj: any): void;
declare function fixture(id: string): void;
describe('audio dashboard tests', function() {
describe(
'audio dashboard tests', function() {
var audioDash;
var reloadCount = 0;
beforeEach(function() {

View File

@ -0,0 +1,79 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "webfiles")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
licenses(["notice"]) # Apache 2.0
# TODO(dandelion): Add webfiles support for the test code.
webfiles(
name = "tf_backend",
srcs = [
"tf-backend.html",
":ts",
],
path = "/tf-backend",
deps = [
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/vz_sorting",
"@org_polymer",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = [
"backend.ts",
"behavior.ts",
"requestManager.ts",
"router.ts",
"urlPathHelpers.ts",
],
typings = [
"@org_definitelytyped//:d3.d.ts",
"@org_definitelytyped//:lodash.d.ts",
"//tensorflow/tensorboard/components/vz_sorting:ts_typings",
],
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-backend.html",
":legacy_ts",
],
visibility = ["//visibility:public"],
destdir = "tf-backend",
deps = [
"//tensorflow/tensorboard/components:tf_imports",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
tensorboard_ts_library(
name = "legacy_ts",
srcs = [
"backend.ts",
"behavior.ts",
"requestManager.ts",
"router.ts",
"urlPathHelpers.ts",
],
deps = [
"//tensorflow/tensorboard/components:common_deps",
"//tensorflow/tensorboard/components/vz_sorting:legacy_ts",
],
)

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
var assert = chai.assert;
declare function fixture(id: string): void; window.HTMLImports.whenReady(() => {
declare function fixture(id: string): void;
window.HTMLImports.whenReady(() => {
Polymer({
is: 'autoreload-test-element',
behaviors: [TF.TensorBoard.AutoReloadBehavior],

View File

@ -41,6 +41,20 @@ def tensorboard_typescript_genrule(name, srcs, typings=[], **kwargs):
tools = ["@com_microsoft_typescript//:tsc"],
**kwargs
)
native.genrule(
name = name + "_typings",
srcs = _DEFAULT_TYPINGS + typings + srcs,
outs = [src[:-3] + ".d.ts" for src in srcs],
cmd = "$(location @com_microsoft_typescript//:tsc)" +
" --inlineSourceMap" +
" --inlineSources" +
" --outDir $(@D)" +
" --declaration" +
" $(SRCS)",
tools = ["@com_microsoft_typescript//:tsc"],
**kwargs
)
def tensorboard_ts_library(**kwargs):
"""Rules referencing this will be deleted from the codebase soon."""