Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 1 | """ |
| 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 Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 17 | load("@npm//@bazel/typescript:index.bzl", "ts_library") |
| 18 | load("@npm//@bazel/karma:index.bzl", "karma_web_test") |
Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 19 | |
| 20 | package(default_visibility = ["//:__subpackages__"]) |
| 21 | |
| 22 | exports_files(["lib/widget/panel.css"]) |
| 23 | |
| 24 | # We don't import from these, but the generated ngfactory code will |
| 25 | NG_FACTORY_ADDED_IMPORTS = [ |
| 26 | "@npm//@angular/animations", |
| 27 | "@npm//@angular/forms", |
| 28 | ] |
| 29 | |
Sean Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 30 | ts_library( |
Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 31 | name = "gui2-fw-lib", |
| 32 | srcs = glob( |
| 33 | include = [ |
| 34 | "**/*.ts", |
| 35 | "public_api.ts", |
| 36 | ], |
| 37 | exclude = [ |
| 38 | "**/*.spec.ts", |
Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 39 | ], |
| 40 | ), |
Sean Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 41 | angular_assets = glob([ |
Sean Condon | 3dd062f | 2020-04-14 09:25:00 +0100 | [diff] [blame] | 42 | "lib/**/*.css", |
| 43 | "lib/**/*.html", |
Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 44 | ]), |
Sean Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 45 | module_name = "org_onosproject_onos/web/gui2-fw-lib", |
| 46 | # entry_point = ":public_api.ts", |
Sean Condon | a3ad779 | 2020-01-04 19:26:34 +0000 | [diff] [blame] | 47 | tsconfig = "//web/gui2:tsconfig.json", |
Sean Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 48 | use_angular_plugin = True, |
Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 49 | deps = [ |
| 50 | "@npm//@angular/animations", |
| 51 | "@npm//@angular/common", |
Sean Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 52 | "@npm//@angular/compiler-cli", |
| 53 | "@npm//@angular/core", |
Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 54 | "@npm//@angular/platform-browser", |
| 55 | "@npm//@angular/router", |
Sean Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 56 | "@npm//@bazel/typescript", |
Sean Condon | 98b6ddb | 2019-12-24 08:07:40 +0000 | [diff] [blame] | 57 | "@npm//d3", |
| 58 | "@npm//rxjs", |
| 59 | ], |
| 60 | ) |
| 61 | |
Sean Condon | a3ad779 | 2020-01-04 19:26:34 +0000 | [diff] [blame] | 62 | ts_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 Condon | a3ad779 | 2020-01-04 19:26:34 +0000 | [diff] [blame] | 76 | "@npm//@angular/platform-browser", |
| 77 | "@npm//@angular/router", |
| 78 | "@npm//@types/jasmine", |
| 79 | "@npm//rxjs", |
| 80 | ], |
| 81 | ) |
| 82 | |
Sean Condon | e4e8f6a | 2020-04-13 10:30:35 +0100 | [diff] [blame] | 83 | karma_web_test( |
Sean Condon | f86cfc9 | 2020-04-14 15:10:03 +0100 | [diff] [blame] | 84 | name = "test-not-coverage", # coverage is to avoid being picked up by 'ot' alias |
Sean Condon | a3ad779 | 2020-01-04 19:26:34 +0000 | [diff] [blame] | 85 | 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 Condon | f86cfc9 | 2020-04-14 15:10:03 +0100 | [diff] [blame] | 96 | config_file = "//web/gui2/src/main/webapp:karma.conf.js", |
Sean Condon | a3ad779 | 2020-01-04 19:26:34 +0000 | [diff] [blame] | 97 | 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 Condon | f86cfc9 | 2020-04-14 15:10:03 +0100 | [diff] [blame] | 106 | "@npm//@angular-devkit/build-angular", |
| 107 | "@npm//karma-coverage-istanbul-reporter", |
| 108 | "@npm//karma-jasmine-html-reporter", |
Sean Condon | a3ad779 | 2020-01-04 19:26:34 +0000 | [diff] [blame] | 109 | ], |
| 110 | ) |
Sean Condon | e4e8f6a | 2020-04-13 10:30:35 +0100 | [diff] [blame] | 111 | |
Sean Condon | 0bd777c | 2021-01-01 14:23:29 +0000 | [diff] [blame] | 112 | filegroup( |
| 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 Condon | e4e8f6a | 2020-04-13 10:30:35 +0100 | [diff] [blame] | 119 | ], |
| 120 | ) |