Skip to content

Commit 2727e4b

Browse files
committed
build: do not generate flat module bundles for testonly targets
This is necessary as `ng_module` rules with a `module_name` either need a `public-api.ts` or `module.ts` file.
1 parent af7e968 commit 2727e4b

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

src/cdk-experimental/testing/tests/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_librar
44

55
ng_module(
66
name = "test_components",
7+
testonly = True,
78
srcs = glob(
89
["**/*.ts"],
910
exclude = [
@@ -12,7 +13,6 @@ ng_module(
1213
],
1314
),
1415
assets = glob(["**/*.html"]),
15-
module_name = "@angular/cdk-experimental/testing/tests",
1616
deps = [
1717
"//src/cdk/keycodes",
1818
"@npm//@angular/forms",

src/e2e-app/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exports_files([
1313

1414
ng_module(
1515
name = "e2e-app",
16+
testonly = True,
1617
srcs = glob(
1718
["**/*.ts"],
1819
exclude = ["test-util/**"],
@@ -87,6 +88,7 @@ sass_binary(
8788

8889
ts_devserver(
8990
name = "devserver",
91+
testonly = True,
9092
# Root paths can be used simplify the loading of files from external Bazel repositories
9193
# (such as the Bazel managed deps repository called "npm")
9294
additional_root_paths = [

src/e2e-app/component-harness/component-harness-e2e-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {TestComponentsModule} from '@angular/cdk-experimental/testing/tests';
8+
import {TestComponentsModule} from '../../cdk-experimental/testing/tests';
99
import {CommonModule} from '@angular/common';
1010
import {NgModule} from '@angular/core';
1111
import {FormsModule} from '@angular/forms';

src/material/testing/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("//tools:defaults.bzl", "ng_module")
44

55
ng_module(
66
name = "testing",
7+
testonly = True,
78
srcs = glob(["**/*.ts"]),
89
module_name = "@angular/material/testing",
910
deps = [

0 commit comments

Comments
 (0)