blob: edf04f4f4a1cfb04f4b47ebabc29606a5b73e070 [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
17load("@npm_angular_bazel//:index.bzl", "ng_module")
18load("@npm_bazel_typescript//:index.bzl", "ts_library")
19
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
30ng_module(
31 name = "gui2-fw-lib",
32 srcs = glob(
33 include = [
34 "**/*.ts",
35 "public_api.ts",
36 ],
37 exclude = [
38 "**/*.spec.ts",
39 "test.ts",
40 ],
41 ),
42 assets = glob([
43 "src/lib/**/*.css",
44 "src/lib/**/*.html",
45 ]),
46 bundle_dts = True,
47 entry_point = ":src/public_api.ts",
48 # tsconfig = "tsconfig.json",
49 generate_ve_shims = True,
50 module_name = "gui2-fw-lib",
51 deps = [
52 "@npm//@angular/animations",
53 "@npm//@angular/common",
54 "@npm//@angular/platform-browser",
55 "@npm//@angular/router",
56 "@npm//d3",
57 "@npm//rxjs",
58 ],
59)
60
61#filegroup(
62# name = "rxjs_umd_modules",
63# srcs = [
64# # do not sort
65# "@npm//:node_modules/rxjs/bundles/rxjs.umd.js",
66# ":rxjs_shims.js",
67# ],
68#)
69#
70#ts_library(
71# name = "test_lib",
72# testonly = 1,
73# srcs = glob(["**/*.spec.ts"]),
74# deps = [
75# ":gui2-fw-lib",
76# "@npm//@angular/common",
77# "@npm//@angular/core",
78# "@npm//@angular/platform-browser",
79# "@npm//@angular/router",
80# "@npm//@types",
81# "@npm//rxjs",
82# ],
83#)
84#
85#ts_library(
86# name = "initialize_testbed",
87# testonly = 1,
88# srcs = [
89# "initialize_testbed.ts",
90# ],
91# deps = [
92# "@npm//@angular/core",
93# "@npm//@angular/platform-browser-dynamic",
94# "@npm//@types",
95# ],
96#)
97#
98#ng_package(
99# name = "gui2-fw-lib-pkg",
100# srcs = [
101# "package.json",
102# ],
103# data = glob(
104# include = [
105# "src/assets/**",
106# ],
107# exclude = [
108# "**/*.spec.ts",
109# ],
110# ),
111# entry_point = ":src/public-api.ts", # In reality this is ignored and index.ts is used
112# # include_devmode_srcs = False,
113# readme_md = "README.md",
114# deps = [
115# ":gui2-fw-lib",
116# "@npm//@angular/animations",
117# "@npm//@angular/common",
118# "@npm//@angular/core",
119# "@npm//@angular/platform-browser-dynamic",
120# "@npm//@angular/router",
121# "@npm//@types",
122# "@npm//d3",
123# "@npm//rxjs",
124# ],
125#)
126#
127#genrule(
128# name = "onos-gui2-fw-ng-build",
129# srcs = [
130# ":gui2-fw-lib-pkg",
131# ],
132# outs = [
133# "gui2-fw-ng-build-prod.log",
134# "gui2-fw-lib-ver.tgz",
135# ],
136# cmd = "ROOT=`pwd` &&" +
137# " mkdir -p package &&" +
138# " cp -r bazel-out/k8-fastbuild/bin/web/gui2-fw-lib/projects/gui2-fw-lib/gui2-fw-lib-pkg/* package &&" +
139# " tar -czhf $$ROOT/$(location gui2-fw-lib-ver.tgz) package &&" +
140# " touch $$ROOT/$(location gui2-fw-ng-build-prod.log)", # to get the log always as the 2nd file
141# message = "GUI FW Lib build",
142# visibility = ["//visibility:public"],
143#)
144#
145#ts_web_test_suite(
146# name = "gui2-fw-lib-test",
147# srcs = [
148# "@npm//:node_modules/tslib/tslib.js",
149# ],
150# # do not sort
151# bootstrap = [
152# "@npm//:node_modules/zone.js/dist/zone-testing-bundle.js",
153# "@npm//:node_modules/reflect-metadata/Reflect.js",
154# ],
155# browsers = [
156# "@io_bazel_rules_webtesting//browsers:chromium-local",
157# ],
158# runtime_deps = [
159# ":initialize_testbed",
160# ],
161# deps = [
162# ":rxjs_umd_modules",
163# ":test_lib",
164# "@npm//karma-jasmine",
165# ],
166#)
167#
168#jdk_genrule(
169# name = "gui2_fw_lib_ext_css",
170# srcs = glob(
171# [
172# "src/lib/widget/panel.css",
173# "src/lib/widget/panel-theme.css",
174# "src/lib/widget/table.css",
175# "src/lib/widget/table.theme.css",
176# "src/lib/widget/table.theme.css",
177# "src/lib/layer/loading.service.css",
178# ],
179# ),
180# outs = ["gui2_fw_lib_css.jar"],
181# cmd = " ROOT=`pwd` &&" +
182# " cd web/gui2-fw-lib/projects/gui2-fw-lib/src/lib &&" +
183# " jar Mcf $$ROOT/$@ .",
184# visibility = ["//visibility:public"],
185#)