|
| 1 | +load("//tools:defaults.bzl", "ng_module", "ng_package", "ng_test_library", "ng_web_test_suite") |
| 2 | +load(":esbuild-amd.bzl", "esbuild_amd") |
| 3 | + |
| 4 | +package(default_visibility = ["//visibility:public"]) |
| 5 | + |
| 6 | +ng_module( |
| 7 | + name = "material-date-fns-adapter", |
| 8 | + srcs = glob( |
| 9 | + ["**/*.ts"], |
| 10 | + exclude = ["**/*.spec.ts"], |
| 11 | + ), |
| 12 | + deps = [ |
| 13 | + "//src:dev_mode_types", |
| 14 | + "//src/material/core", |
| 15 | + "@npm//@angular/core", |
| 16 | + "@npm//date-fns", |
| 17 | + ], |
| 18 | +) |
| 19 | + |
| 20 | +ng_test_library( |
| 21 | + name = "unit_test_sources", |
| 22 | + srcs = glob( |
| 23 | + ["**/*.spec.ts"], |
| 24 | + exclude = ["**/*.e2e.spec.ts"], |
| 25 | + ), |
| 26 | + deps = [ |
| 27 | + ":material-date-fns-adapter", |
| 28 | + "//src/material/core", |
| 29 | + "@npm//date-fns", |
| 30 | + ], |
| 31 | +) |
| 32 | + |
| 33 | +ng_web_test_suite( |
| 34 | + name = "unit_tests", |
| 35 | + deps = [ |
| 36 | + ":amd_date_fns", |
| 37 | + ":amd_date_fns_locales", |
| 38 | + ":unit_test_sources", |
| 39 | + ], |
| 40 | +) |
| 41 | + |
| 42 | +esbuild_amd( |
| 43 | + name = "amd_date_fns", |
| 44 | + testonly = True, |
| 45 | + entry_point = "@npm//:node_modules/date-fns/esm/index.js", |
| 46 | + module_name = "date-fns", |
| 47 | + deps = ["@npm//date-fns"], |
| 48 | +) |
| 49 | + |
| 50 | +esbuild_amd( |
| 51 | + name = "amd_date_fns_locales", |
| 52 | + testonly = True, |
| 53 | + entry_point = "@npm//:node_modules/date-fns/esm/locale/index.js", |
| 54 | + module_name = "date-fns/locale", |
| 55 | + deps = ["@npm//date-fns"], |
| 56 | +) |
| 57 | + |
| 58 | +ng_package( |
| 59 | + name = "npm_package", |
| 60 | + srcs = ["package.json"], |
| 61 | + entry_point = ":public-api.ts", |
| 62 | + tags = ["release-package"], |
| 63 | + deps = [":material-date-fns-adapter"], |
| 64 | +) |
0 commit comments