build: upgrade bazel rules to latest (#20768)
Add enough BUILD files to make it possible to `bazel build packages/core/test` Also re-format BUILD.bazel files with Buildifier. Add a CI lint check that they stay formatted. PR Close #20768
This commit is contained in:
@ -1,12 +1,15 @@
|
||||
package(default_visibility=["//visibility:public"])
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "compiler",
|
||||
srcs = glob(["**/*.ts"], exclude=[
|
||||
"test/**",
|
||||
"testing/**",
|
||||
]),
|
||||
srcs = glob(
|
||||
[
|
||||
"*.ts",
|
||||
"src/**/*.ts",
|
||||
],
|
||||
),
|
||||
module_name = "@angular/compiler",
|
||||
tsconfig = ":tsconfig-build.json",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
)
|
||||
|
@ -43,8 +43,6 @@ const TAG_TO_PLACEHOLDER_NAMES: {[k: string]: string} = {
|
||||
* Creates unique names for placeholder with different content.
|
||||
*
|
||||
* Returns the same placeholder name when the content is identical.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export class PlaceholderRegistry {
|
||||
// Count the occurrence of the base name top generate a unique name
|
||||
|
22
packages/compiler/test/BUILD.bazel
Normal file
22
packages/compiler/test/BUILD.bazel
Normal file
@ -0,0 +1,22 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "test",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/common",
|
||||
"//packages/compiler",
|
||||
"//packages/compiler-cli",
|
||||
"//packages/compiler/testing",
|
||||
"//packages/core",
|
||||
"//packages/core/testing",
|
||||
"//packages/platform-browser",
|
||||
"//packages/platform-browser-dynamic",
|
||||
"//packages/platform-browser/testing",
|
||||
],
|
||||
)
|
@ -33,7 +33,7 @@ describe('StaticReflector', () => {
|
||||
beforeEach(() => init());
|
||||
|
||||
function simplify(context: StaticSymbol, value: any) {
|
||||
return reflector.simplify(context, value);
|
||||
return (reflector as any).simplify(context, value);
|
||||
}
|
||||
|
||||
it('should get annotations for NgFor', () => {
|
||||
@ -1079,11 +1079,11 @@ describe('StaticReflector', () => {
|
||||
'/tmp/root.ts': ``,
|
||||
'/tmp/a.ts': `export const x = 1;`,
|
||||
});
|
||||
let symbol =
|
||||
reflector.resolveExternalReference({moduleName: './a', name: 'x'}, '/tmp/root.ts');
|
||||
let symbol = reflector.resolveExternalReference(
|
||||
{moduleName: './a', name: 'x', runtime: null}, '/tmp/root.ts');
|
||||
expect(symbolResolver.getKnownModuleName(symbol.filePath)).toBeFalsy();
|
||||
|
||||
symbol = reflector.resolveExternalReference({moduleName: 'a', name: 'x'});
|
||||
symbol = reflector.resolveExternalReference({moduleName: 'a', name: 'x', runtime: null});
|
||||
expect(symbolResolver.getKnownModuleName(symbol.filePath)).toBe('a');
|
||||
});
|
||||
});
|
||||
|
12
packages/compiler/testing/BUILD.bazel
Normal file
12
packages/compiler/testing/BUILD.bazel
Normal file
@ -0,0 +1,12 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "testing",
|
||||
testonly = 1,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
module_name = "@angular/compiler/testing",
|
||||
tsconfig = "//packages:tsconfig",
|
||||
deps = ["//packages/compiler"],
|
||||
)
|
Reference in New Issue
Block a user