blob: cbf7358d4311ce130a416b174e9e49c9fd786d19 [file] [log] [blame]
Sean Condon98b6ddb2019-12-24 08:07:40 +00001"""
2 Copyright 2020-present Open Networking Foundation
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15"""
16
Sean Condon0bd777c2021-01-01 14:23:29 +000017load("@npm//@bazel/typescript:index.bzl", "ts_library")
18load("@npm//@bazel/karma:index.bzl", "karma_web_test")
Sean Condon98b6ddb2019-12-24 08:07:40 +000019
20package(default_visibility = ["//:__subpackages__"])
21
22exports_files(["lib/widget/panel.css"])
23
24# We don't import from these, but the generated ngfactory code will
25NG_FACTORY_ADDED_IMPORTS = [
26 "@npm//@angular/animations",
27 "@npm//@angular/forms",
28]
29
Sean Condon0bd777c2021-01-01 14:23:29 +000030ts_library(
Sean Condon98b6ddb2019-12-24 08:07:40 +000031 name = "gui2-fw-lib",
32 srcs = glob(
33 include = [
34 "**/*.ts",
35 "public_api.ts",
36 ],
37 exclude = [
38 "**/*.spec.ts",
Sean Condon98b6ddb2019-12-24 08:07:40 +000039 ],
40 ),
Sean Condon0bd777c2021-01-01 14:23:29 +000041 angular_assets = glob([
Sean Condon3dd062f2020-04-14 09:25:00 +010042 "lib/**/*.css",
43 "lib/**/*.html",
Sean Condon98b6ddb2019-12-24 08:07:40 +000044 ]),
Sean Condon0bd777c2021-01-01 14:23:29 +000045 module_name = "org_onosproject_onos/web/gui2-fw-lib",
46 # entry_point = ":public_api.ts",
Sean Condona3ad7792020-01-04 19:26:34 +000047 tsconfig = "//web/gui2:tsconfig.json",
Sean Condon0bd777c2021-01-01 14:23:29 +000048 use_angular_plugin = True,
Sean Condon98b6ddb2019-12-24 08:07:40 +000049 deps = [
50 "@npm//@angular/animations",
51 "@npm//@angular/common",
Sean Condon0bd777c2021-01-01 14:23:29 +000052 "@npm//@angular/compiler-cli",
53 "@npm//@angular/core",
Sean Condon98b6ddb2019-12-24 08:07:40 +000054 "@npm//@angular/platform-browser",
55 "@npm//@angular/router",
Sean Condon0bd777c2021-01-01 14:23:29 +000056 "@npm//@bazel/typescript",
Sean Condon98b6ddb2019-12-24 08:07:40 +000057 "@npm//d3",
58 "@npm//rxjs",
59 ],
60)
61
Sean Condona3ad7792020-01-04 19:26:34 +000062ts_library(
63 name = "test_lib",
64 testonly = 1,
65 srcs = glob(
66 include = ["**/*.spec.ts"],
67 # TODO re-enable this test
68 exclude = ["lib/nav/nav.service.spec.ts"],
69 ),
70 tsconfig = "//web/gui2:tsconfig-test",
71 deps = [
72 ":gui2-fw-lib",
73 "@npm//@angular/common",
74 "@npm//@angular/core",
75 "@npm//@angular/forms",
Sean Condona3ad7792020-01-04 19:26:34 +000076 "@npm//@angular/platform-browser",
77 "@npm//@angular/router",
78 "@npm//@types/jasmine",
79 "@npm//rxjs",
80 ],
81)
82
Sean Condone4e8f6a2020-04-13 10:30:35 +010083karma_web_test(
Sean Condonf86cfc92020-04-14 15:10:03 +010084 name = "test-not-coverage", # coverage is to avoid being picked up by 'ot' alias
Sean Condona3ad7792020-01-04 19:26:34 +000085 srcs = [
86 # We are manaully adding the bazel generated named-UMD d3 bundle here as
87 # named-UMD bundles for non-APF npm packages are not yet automatically added.
88 # This file is generated by the npm_umd_bundle @npm//d3
89 # rule that is setup by yarn_install.
90 ],
91 # do not sort
92 bootstrap = [
93 "@npm//:node_modules/zone.js/dist/zone-testing-bundle.js",
94 "@npm//:node_modules/reflect-metadata/Reflect.js",
95 ],
Sean Condonf86cfc92020-04-14 15:10:03 +010096 config_file = "//web/gui2/src/main/webapp:karma.conf.js",
Sean Condona3ad7792020-01-04 19:26:34 +000097 tags = ["native"],
98 runtime_deps = [
99 "//web/gui2/src/main/webapp:initialize_testbed",
100 ],
101 deps = [
102 ":test_lib",
103 "//web/gui:src/main/webapp/data",
104 "//web/gui2/src/main/webapp:d3_requirejs",
105 "//web/gui2/src/main/webapp:rxjs_umd_modules",
Sean Condonf86cfc92020-04-14 15:10:03 +0100106 "@npm//@angular-devkit/build-angular",
107 "@npm//karma-coverage-istanbul-reporter",
108 "@npm//karma-jasmine-html-reporter",
Sean Condona3ad7792020-01-04 19:26:34 +0000109 ],
110)
Sean Condone4e8f6a2020-04-13 10:30:35 +0100111
Sean Condon0bd777c2021-01-01 14:23:29 +0000112filegroup(
113 name = "extra_css",
114 srcs = [
115 "lib/widget/panel.css",
116 "lib/widget/panel-theme.css",
117 "lib/widget/table.css",
118 "lib/widget/table.theme.css",
Sean Condone4e8f6a2020-04-13 10:30:35 +0100119 ],
120)