package(default_visibility = ["//visibility:public"])

load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle", "ts_library")
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
load("//tools/http-server:http_server.bzl", "http_server")

ng_module(
    name = "animation_world",
    srcs = ["index.ts"],
    tags = [
        "ivy-only",
        "no-ivy-jit",
    ],
    type_check = False,  # see #26462
    deps = [
        "//packages/common",
        "//packages/core",
        "//packages/core/test/bundling/util:reflect_metadata",
    ],
)

ng_rollup_bundle(
    name = "bundle",
    # TODO(alexeagle): This is inconsistent.
    # We try to teach users to always have their workspace at the start of a
    # path, to disambiguate from other workspaces.
    # Here, the rule implementation is looking in an execroot where the layout
    # has an "external" directory for external dependencies.
    # This should probably start with "angular/" and let the rule deal with it.
    entry_point = "packages/core/test/bundling/animation_world/index.js",
    tags = [
        "ivy-only",
        "no-ivy-jit",
    ],
    deps = [
        ":animation_world",
        "//packages/core",
    ],
)

js_expected_symbol_test(
    name = "symbol_test",
    src = ":bundle.min_debug.js",
    golden = ":bundle.golden_symbols.json",
    tags = [
        "ivy-aot",
        "ivy-only",
        "no-ivy-jit",
    ],
)

http_server(
    name = "devserver",
    data = [
        "animation_world.css",
        "base.css",
        "index.html",
        ":bundle.min.js",
        ":bundle.min_debug.js",
    ],
    tags = [
        "ivy-only",
        "no-ivy-jit",
    ],
)
