@@ -244,8 +244,6 @@ def _expected_outs(ctx):
244
244
# TODO(alxhub): i18n is only produced by the legacy compiler currently. This should be re-enabled
245
245
# when ngtsc can extract messages
246
246
if is_legacy_ngc :
247
- # TODO(manekinekko): due to bazelbuild/bazel#4858 we cannot fix the call to ctx.new_file(genfiles_dir)
248
- # so the rule is turned off for now.
249
247
i18n_messages_files = [ctx .new_file (ctx .genfiles_dir , ctx .label .name + "_ngc_messages.xmb" )]
250
248
else :
251
249
i18n_messages_files = []
@@ -270,9 +268,9 @@ def _ngc_tsconfig(ctx, files, srcs, **kwargs):
270
268
expected_outs = outs .closure_js
271
269
272
270
angular_compiler_options = {
273
- "allowEmptyCodegenFiles" : True ,
274
- "enableIvy" : _enable_ivy_value (ctx ),
275
271
"enableResourceInlining" : ctx .attr .inline_resources ,
272
+ "generateCodeForLibraries" : False ,
273
+ "allowEmptyCodegenFiles" : True ,
276
274
# Summaries are only enabled if Angular outputs are to be produced.
277
275
"enableSummariesForJit" : is_legacy_ngc ,
278
276
"enableIvy" : _enable_ivy_value (ctx ),
@@ -539,8 +537,8 @@ def ng_module_impl(ctx, ts_compile_actions):
539
537
540
538
if is_legacy_ngc :
541
539
providers ["angular" ] = {
542
- "metadata" : outs .metadata ,
543
540
"summaries" : outs .summaries ,
541
+ "metadata" : outs .metadata ,
544
542
}
545
543
providers ["ngc_messages" ] = outs .i18n_messages
546
544
@@ -570,6 +568,13 @@ local_deps_aspects = [collect_node_modules_aspect, _collect_summaries_aspect]
570
568
571
569
NG_MODULE_ATTRIBUTES = {
572
570
"srcs" : attr .label_list (allow_files = [".ts" ]),
571
+
572
+ # Note: DEPS_ASPECTS is already a list, we add the cast to workaround
573
+ # https://github.com/bazelbuild/skydoc/issues/21
574
+ "deps" : attr .label_list (
575
+ doc = "Targets that are imported by this target" ,
576
+ aspects = local_deps_aspects ,
577
+ ),
573
578
"assets" : attr .label_list (
574
579
doc = ".html and .css files needed by the Angular compiler" ,
575
580
allow_files = [
@@ -578,6 +583,14 @@ NG_MODULE_ATTRIBUTES = {
578
583
".html" ,
579
584
],
580
585
),
586
+ "factories" : attr .label_list (
587
+ allow_files = [".ts" , ".html" ],
588
+ mandatory = False ,
589
+ ),
590
+ "filter_summaries" : attr .bool (default = False ),
591
+ "type_check" : attr .bool (default = True ),
592
+ "inline_resources" : attr .bool (default = True ),
593
+ "no_i18n" : attr .bool (default = False ),
581
594
"compiler" : attr .label (
582
595
doc = """Sets a different ngc compiler binary to use for this library.
583
596
@@ -592,40 +605,16 @@ NG_MODULE_ATTRIBUTES = {
592
605
executable = True ,
593
606
cfg = "host" ,
594
607
),
595
- "factories" : attr .label_list (
596
- allow_files = [".ts" , ".html" ],
597
- mandatory = False ,
598
- ),
599
- "filter_summaries" : attr .bool (default = False ),
600
- "inline_resources" : attr .bool (default = True ),
601
608
"ng_xi18n" : attr .label (
602
609
default = Label (DEFAULT_NG_XI18N ),
603
610
executable = True ,
604
611
cfg = "host" ,
605
612
),
606
- "no_i18n" : attr .bool (default = False ),
607
- "type_check" : attr .bool (default = True ),
608
-
609
- # Note: DEPS_ASPECTS is already a list, we add the cast to workaround
610
- # https://github.com/bazelbuild/skydoc/issues/21
611
- "deps" : attr .label_list (
612
- doc = "Targets that are imported by this target" ,
613
- aspects = local_deps_aspects ,
614
- ),
615
613
"_supports_workers" : attr .bool (default = True ),
616
614
}
617
615
618
616
NG_MODULE_RULE_ATTRS = dict (dict (COMMON_ATTRIBUTES , ** NG_MODULE_ATTRIBUTES ), ** {
619
- "entry_point" : attr .string (),
620
-
621
- # Default is %{name}_public_index
622
- # The suffix points to the generated "bundle index" files that users import from
623
- # The default is intended to avoid collisions with the users input files.
624
- # Later packaging rules will point to these generated files as the entry point
625
- # into the package.
626
- # See the flatModuleOutFile documentation in
627
- # https://github.com/angular/angular/blob/master/packages/compiler-cli/src/transformers/api.ts
628
- "flat_module_out_file" : attr .string (),
617
+ "tsconfig" : attr .label (allow_single_file = True ),
629
618
"node_modules" : attr .label (
630
619
doc = """The npm packages which should be available during the compile.
631
620
0 commit comments