@@ -55,7 +55,6 @@ APPLICATION_CONFIG = COMMON_CONFIG + [
55
55
TEST_CONFIG = COMMON_CONFIG + [
56
56
"@dev-infra//bazel/browsers/chromium" ,
57
57
"@dev-infra//bazel/browsers/firefox" ,
58
-
59
58
"//:ng-base-test-config" ,
60
59
":ng-test-config" ,
61
60
"//:node_modules/karma" ,
@@ -76,7 +75,6 @@ TEST_DEPS = [
76
75
E2E_CONFIG = COMMON_CONFIG + [
77
76
"@dev-infra//bazel/browsers/chromium" ,
78
77
"@dev-infra//bazel/browsers/firefox" ,
79
-
80
78
"//:ng-base-test-config" ,
81
79
":ng-e2e-config" ,
82
80
"//:node_modules/jasmine-spec-reporter" ,
@@ -89,28 +87,27 @@ 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
-
114
111
def ng_app (name , project_name = None , deps = [], test_deps = [], e2e_deps = [], ** kwargs ):
115
112
"""
116
113
Macro for Angular applications, creating various targets aligning with the Angular CLI.
@@ -137,44 +134,44 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [],
137
134
138
135
test_srcs = native .glob (["src/test.ts" , "src/**/*.spec.ts" ])
139
136
140
- e2e_srcs = native .glob (["e2e/src/**/*.ts" ])
137
+ e2e_srcs = native .glob (["e2e/src/**/*.ts" ])
141
138
142
139
tags = kwargs .pop ("tags" , [])
143
140
144
141
# config files
145
142
copy_to_bin (
146
143
name = "ng-app-config" ,
147
144
srcs = [
148
- "tsconfig.app.json" ,
145
+ "tsconfig.app.json" ,
149
146
],
150
147
visibility = ["//visibility:private" ],
151
148
)
152
149
copy_to_bin (
153
150
name = "ng-test-config" ,
154
151
srcs = [
155
- "karma.conf.js" ,
156
- "tsconfig.spec.json" ,
152
+ "karma.conf.js" ,
153
+ "tsconfig.spec.json" ,
157
154
],
158
155
visibility = ["//visibility:private" ],
159
156
)
160
157
copy_to_bin (
161
158
name = "ng-e2e-config" ,
162
159
srcs = [
163
- "e2e/tsconfig.json" ,
164
- "e2e/protractor.conf.js" ,
160
+ "e2e/tsconfig.json" ,
161
+ "e2e/protractor.conf.js" ,
165
162
],
166
163
visibility = ["//visibility:private" ],
167
164
)
168
165
169
166
# 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
- )
167
+ if native .package_name () != "" :
168
+ copy_to_bin (
169
+ name = "lint-config" ,
170
+ srcs = [
171
+ ".eslintrc.json" ,
172
+ ],
173
+ visibility = ["//visibility:private" ],
174
+ )
178
175
179
176
project_name = project_name if project_name else name
180
177
@@ -239,7 +236,7 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [],
239
236
_architect_test (
240
237
project_name ,
241
238
"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 []),
239
+ srcs = srcs + test_srcs + e2e_srcs + deps + test_deps + NG_COMMON_DEPS + LINT_DEPS + LINT_CONFIG + ([":lint-config" ] if native .package_name () != "" else []),
243
240
tags = tags + ["lint" ],
244
241
** kwargs
245
242
)
@@ -248,8 +245,9 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], *
248
245
output_dir = "%s%s" % (project_name , ".%s" % configuration if configuration else "" )
249
246
250
247
args = [
251
- "%s:build%s" % (project_name , ":%s" % configuration if configuration else "" ),
252
- "--output-path" , output_dir
248
+ "%s:build%s" % (project_name , ":%s" % configuration if configuration else "" ),
249
+ "--output-path" ,
250
+ output_dir ,
253
251
] + args
254
252
255
253
architect_cli .architect (
@@ -258,13 +256,13 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], *
258
256
args = args ,
259
257
out_dirs = [output_dir ],
260
258
srcs = srcs ,
261
- ** kwargs ,
259
+ ** kwargs
262
260
)
263
261
264
262
def _architect_test (project_name , command , configuration = None , args = [], srcs = [], ** kwargs ):
265
263
to_root = ""
266
264
if native .package_name () != "" :
267
- to_root = "" .join (["../" for _ in native .package_name ().split ("/" )])
265
+ to_root = "" .join (["../" for _ in native .package_name ().split ("/" )])
268
266
269
267
env = {
270
268
"CHROME_BIN" : to_root + "$(CHROMIUM)" ,
@@ -275,25 +273,24 @@ def _architect_test(project_name, command, configuration = None, args = [], srcs
275
273
name = "%s%s" % (command , ".%s" % configuration if configuration else "" ),
276
274
chdir = native .package_name (),
277
275
args = [
278
- "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" )
276
+ "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" ),
279
277
] + args ,
280
278
data = srcs ,
281
279
env = env ,
282
280
toolchains = [
283
281
"@dev-infra//bazel/browsers/chromium:toolchain_alias" ,
284
282
"@dev-infra//bazel/browsers/firefox:toolchain_alias" ,
285
283
],
286
- ** kwargs ,
284
+ ** kwargs
287
285
)
288
286
289
287
def _architect_binary (project_name , command , configuration = None , args = [], srcs = [], ** kwargs ):
290
288
architect_cli .architect_binary (
291
289
name = "%s%s" % (command , ".%s" % configuration if configuration else "" ),
292
290
chdir = native .package_name (),
293
291
args = [
294
- "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" )
292
+ "%s:%s%s" % (project_name , command , ":%s" % configuration if configuration else "" ),
295
293
] + args ,
296
294
data = srcs ,
297
- ** kwargs ,
295
+ ** kwargs
298
296
)
299
-
0 commit comments