forked from tensorflow/tfjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
110 lines (101 loc) · 2.78 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test", "pkg_npm")
load("//tools:copy_to_dist.bzl", "copy_to_dist", "copy_ts_library_to_dist")
load("//tools:tfjs_bundle.bzl", "tfjs_bundle")
load("//tools:tfjs_web_test.bzl", "tfjs_web_test")
package(default_visibility = ["//visibility:public"])
nodejs_test(
name = "tfjs-backend-cpu_test",
data = [
"//tfjs-backend-cpu/src:tfjs-backend-cpu_test_lib",
],
entry_point = "//tfjs-backend-cpu/src:run_tests.ts",
link_workspace_root = True,
tags = ["ci"],
)
tfjs_web_test(
name = "tfjs-backend-cpu_browser_test",
srcs = [
"//tfjs-backend-cpu/src:tfjs-backend-cpu_test_bundle",
],
args = [],
browsers = [
"bs_chrome_mac",
],
headless = False,
presubmit_browsers = [
"bs_chrome_mac",
],
)
tfjs_bundle(
name = "tf-backend-cpu",
entry_point = "//tfjs-backend-cpu/src:index.ts",
external = [
"@tensorflow/tfjs-core",
"crypto",
"node-fetch",
"seedrandom",
"util",
],
globals = {
"@tensorflow/tfjs-core": "tf",
"seedrandom": "seedrandom",
},
umd_name = "tf",
deps = [
"//tfjs-backend-cpu/src:tfjs-backend-cpu_lib",
"//tfjs-backend-cpu/src:tfjs-backend-cpu_src_lib",
],
)
copy_ts_library_to_dist(
name = "copy_src_to_dist",
srcs = [
"//tfjs-backend-cpu/src:tfjs-backend-cpu_lib",
"//tfjs-backend-cpu/src:tfjs-backend-cpu_src_lib",
],
root = "src",
)
copy_to_dist(
name = "copy_bundles",
srcs = [
":tf-backend-cpu",
":tf-backend-cpu.es2017",
":tf-backend-cpu.es2017.min",
":tf-backend-cpu.fesm",
":tf-backend-cpu.fesm.min",
":tf-backend-cpu.min",
":tf-backend-cpu.node",
],
)
pkg_npm(
name = "tfjs-backend-cpu_pkg",
package_name = "@tensorflow/tfjs-backend-cpu",
srcs = [
"README.md",
"package.json",
],
tags = ["ci"],
deps = [
":copy_bundles",
":copy_src_to_dist",
],
)
test_suite(
name = "tests",
tests = [
":tfjs-backend-cpu_test",
],
)