https://github.com/angular/angular
Raw File
Tip revision: 7f8d6c1066651022a7d774784d62b97990fb72c6 authored by Matias Niemelä on 29 August 2018, 04:39:18 UTC
release: cut the v6.1.5 release
Tip revision: 7f8d6c1
BUILD.bazel
package(default_visibility = ["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_package")

ng_module(
    name = "core",
    srcs = glob(
        [
            "*.ts",
            "src/**/*.ts",
        ],
        exclude = ["src/ivy_switch.ts"],
    ) + [
        ":ivy_switch",
    ],
    module_name = "@angular/core",
    deps = [
        "//packages:types",
        "//packages/compiler",
        "@rxjs",
        "@rxjs//operators",
    ],
)

ng_package(
    name = "npm_package",
    srcs = glob(["**/*.externs.js"]) + [
        "package.json",
        "//packages/core/testing:package.json",
    ],
    entry_point = "packages/core/index.js",
    tags = [
        "ivy-jit",
        "ivy-local",
        "release-with-framework",
    ],
    deps = [
        ":core",
        "//packages/core/testing",
    ],
)

## Controls if Ivy is enabled. (Temporary target until we permanently switch over to Ivy)
##
## This file generates `src/ivy_switch.ts` file which reexports symbols for `ViewEngine` or `Ivy.`
## - append `--define=compile=legacy` (default) to `bazel` command to reexport `./ivy_switch_legacy`
##   and use `ViewEngine`
## - append `--define=compile=jit` to `bazel` command to rexport `./ivy_switch_jit` and use `Ivy`
## - append `--define=compile=local` to `bazel` command to rexport `./ivy_switch_jit` and use `Ivy`
##   in the local analysis mode. (run as part of `ngtsc`)
##
## NOTE: `--define=compile=jit` works with any `bazel` command or target across the repo.
##
## See: `//tools/bazel.rc` where `--define=ivy=false` is defined as default.
## See: `./src/ivy_switch.ts` for more details.
genrule(
    name = "ivy_switch",
    outs = ["src/ivy_switch.ts"],
    cmd = "echo export '*' from \"'./ivy_switch_$(compile)';\" > $@",
)
back to top