@@ -53,9 +53,8 @@ APPLICATION_CONFIG = COMMON_CONFIG + [
53
53
54
54
# Common dependencies of Angular CLI test suites
55
55
TEST_CONFIG = COMMON_CONFIG + [
56
- "@dev-infra//bazel/browsers/chromium" ,
57
- "@dev-infra//bazel/browsers/firefox" ,
58
-
56
+ "@devinfra//bazel/browsers/chromium" ,
57
+ "@devinfra//bazel/browsers/firefox" ,
59
58
"//:ng-base-test-config" ,
60
59
":ng-test-config" ,
61
60
"//:node_modules/karma" ,
@@ -74,9 +73,8 @@ TEST_DEPS = [
74
73
75
74
# Common dependencies of Angular CLI e2e tests
76
75
E2E_CONFIG = COMMON_CONFIG + [
77
- "@dev-infra//bazel/browsers/chromium" ,
78
- "@dev-infra//bazel/browsers/firefox" ,
79
-
76
+ "@devinfra//bazel/browsers/chromium" ,
77
+ "@devinfra//bazel/browsers/firefox" ,
80
78
"//:ng-base-test-config" ,
81
79
":ng-e2e-config" ,
82
80
"//:node_modules/jasmine-spec-reporter" ,
@@ -89,28 +87,28 @@ E2E_DEPS = [
89
87
]
90
88
91
89
LINT_CONFIG = COMMON_CONFIG + [
92
- # Lint uses the e2e config
93
- "//:ng-base-test-config" ,
94
- ":ng-e2e-config" ,
95
- "//:ng-base-lint-config" ,
96
- "//:node_modules/@angular-eslint/builder" ,
97
- "//:node_modules/@angular-eslint/eslint-plugin" ,
98
- "//:node_modules/@angular-eslint/eslint-plugin-template" ,
99
- "//:node_modules/@angular-eslint/template-parser" ,
100
- "//:node_modules/eslint-plugin-ban" ,
101
- "//:node_modules/eslint-plugin-import" ,
102
- "//:node_modules/eslint-plugin-jsdoc" ,
103
- "//:node_modules/eslint-plugin-prefer-arrow" ,
104
- "//:node_modules/@typescript-eslint/eslint-plugin" ,
105
- "//:node_modules/@typescript-eslint/parser" ,
106
- "//:node_modules/@stylistic/eslint-plugin" ,
90
+ # Lint uses the e2e config
91
+ "//:ng-base-test-config" ,
92
+ ":ng-e2e-config" ,
93
+ "//:ng-base-lint-config" ,
94
+ "//:node_modules/@angular-eslint/builder" ,
95
+ "//:node_modules/@angular-eslint/eslint-plugin" ,
96
+ "//:node_modules/@angular-eslint/eslint-plugin-template" ,
97
+ "//:node_modules/@angular-eslint/template-parser" ,
98
+ "//:node_modules/eslint-plugin-ban" ,
99
+ "//:node_modules/eslint-plugin-import" ,
100
+ "//:node_modules/eslint-plugin-jsdoc" ,
101
+ "//:node_modules/eslint-plugin-prefer-arrow" ,
102
+ "//:node_modules/@typescript-eslint/eslint-plugin" ,
103
+ "//:node_modules/@typescript-eslint/parser" ,
104
+ "//:node_modules/@stylistic/eslint-plugin" ,
107
105
]
108
106
LINT_DEPS = [
109
- # TODO(bazel): this should be included as a transitive of @angular-devkit/architect-cli!?
110
- "//:node_modules/@angular-devkit/architect" ,
107
+ # TODO(bazel): this should be included as a transitive of @angular-devkit/architect-cli!?
108
+ "//:node_modules/@angular-devkit/architect" ,
111
109
]
112
110
113
-
111
+ # buildifier: disable=unused-variable
114
112
def ng_app (name , project_name = None , deps = [], test_deps = [], e2e_deps = [], ** kwargs ):
115
113
"""
116
114
Macro for Angular applications, creating various targets aligning with the Angular CLI.
@@ -137,44 +135,44 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [],
137
135
138
136
test_srcs = native .glob (["src/test.ts" , "src/**/*.spec.ts" ])
139
137
140
- e2e_srcs = native .glob (["e2e/src/**/*.ts" ])
138
+ e2e_srcs = native .glob (["e2e/src/**/*.ts" ])
141
139
142
140
tags = kwargs .pop ("tags" , [])
143
141
144
142
# config files
145
143
copy_to_bin (
146
144
name = "ng-app-config" ,
147
145
srcs = [
148
- "tsconfig.app.json" ,
146
+ "tsconfig.app.json" ,
149
147
],
150
148
visibility = ["//visibility:private" ],
151
149
)
152
150
copy_to_bin (
153
151
name = "ng-test-config" ,
154
152
srcs = [
155
- "karma.conf.js" ,
156
- "tsconfig.spec.json" ,
153
+ "karma.conf.js" ,
154
+ "tsconfig.spec.json" ,
157
155
],
158
156
visibility = ["//visibility:private" ],
159
157
)
160
158
copy_to_bin (
161
159
name = "ng-e2e-config" ,
162
160
srcs = [
163
- "e2e/tsconfig.json" ,
164
- "e2e/protractor.conf.js" ,
161
+ "e2e/tsconfig.json" ,
162
+ "e2e/protractor.conf.js" ,
165
163
],
166
164
visibility = ["//visibility:private" ],
167
165
)
168
166
169
167
# Lint config files in addition to the root
170
- if native .package_name () != '' :
171
- copy_to_bin (
172
- name = "lint-config" ,
173
- srcs = [
174
- ".eslintrc.json" ,
175
- ],
176
- visibility = ["//visibility:private" ],
177
- )
168
+ if native .package_name () != "" :
169
+ copy_to_bin (
170
+ name = "lint-config" ,
171
+ srcs = [
172
+ ".eslintrc.json" ,
173
+ ],
174
+ visibility = ["//visibility:private" ],
175
+ )
178
176
179
177
project_name = project_name if project_name else name
180
178
@@ -239,7 +237,7 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [],
239
237
_architect_test (
240
238
project_name ,
241
239
"lint" ,
242
- srcs = srcs + test_srcs + e2e_srcs + deps + test_deps + NG_COMMON_DEPS + LINT_DEPS + LINT_CONFIG + ([":lint-config" ] if native .package_name () != '' else []),
240
+ srcs = srcs + test_srcs + e2e_srcs + deps + test_deps + NG_COMMON_DEPS + LINT_DEPS + LINT_CONFIG + ([":lint-config" ] if native .package_name () != "" else []),
243
241
tags = tags + ["lint" ],
244
242
** kwargs
245
243
)
@@ -248,8 +246,9 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], *
248
246
output_dir = "%s%s" % (project_name , ".%s" % configuration if configuration else "" )
249
247
250
248
args = [
251
- "%s:build%s" % (project_name , ":%s" % configuration if configuration else "" ),
252
- "--output-path" , output_dir
249
+ "%s:build%s" % (project_name , ":%s" % configuration if configuration else "" ),
250
+ "--output-path" ,
251
+ output_dir ,
253
252
] + args
254
253
255
254
architect_cli .architect (
@@ -258,13 +257,13 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], *
258
257
args = args ,
259
258
out_dirs = [output_dir ],
260
259
srcs = srcs ,
261
- ** kwargs ,
260
+ ** kwargs
262
261
)
263
262
264
263
def _architect_test (project_name , command , configuration = None , args = [], srcs = [], ** kwargs ):
265
264
to_root = ""
266
265
if native .package_name () != "" :
267
- to_root = "" .join (["../" for _ in native .package_name ().split ("/" )])
266
+ to_root = "" .join (["../" for _ in native .package_name ().split ("/" )])
268
267
269
268
env = {
270
269
"CHROME_BIN" : to_root + "$(CHROMIUM)" ,
@@ -275,25 +274,24 @@ def _architect_test(project_name, command, configuration = None, args = [], srcs
275
274
name = "%s%s" % (command , ".%s" % configuration if configuration else "" ),
276
275
chdir = native .package_name (),
277
276
args = [
278
- "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" )
277
+ "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" ),
279
278
] + args ,
280
279
data = srcs ,
281
280
env = env ,
282
281
toolchains = [
283
- "@dev-infra //bazel/browsers/chromium:toolchain_alias" ,
284
- "@dev-infra //bazel/browsers/firefox:toolchain_alias" ,
282
+ "@devinfra //bazel/browsers/chromium:toolchain_alias" ,
283
+ "@devinfra //bazel/browsers/firefox:toolchain_alias" ,
285
284
],
286
- ** kwargs ,
285
+ ** kwargs
287
286
)
288
287
289
288
def _architect_binary (project_name , command , configuration = None , args = [], srcs = [], ** kwargs ):
290
289
architect_cli .architect_binary (
291
290
name = "%s%s" % (command , ".%s" % configuration if configuration else "" ),
292
291
chdir = native .package_name (),
293
292
args = [
294
- "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" )
293
+ "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" ),
295
294
] + args ,
296
295
data = srcs ,
297
- ** kwargs ,
296
+ ** kwargs
298
297
)
299
-
0 commit comments