Revert "build(bazel): update to bazel 0.27.0 and fix compat in @angular/bazel package (#31019)" (#31267)
This reverts commit 28d3bfc416
.
Reason: this causes failures in g3 with i18n extraction. See #31267.
PR Close #31267
This commit is contained in:

committed by
Kara Erickson

parent
660800ca4e
commit
280e8563f0
@ -49,7 +49,7 @@ Try running `yarn bazel` instead.
|
||||
(If you did run that, check that you've got a fresh `yarn install`)
|
||||
|
||||
""",
|
||||
minimum_bazel_version = "0.27.0",
|
||||
minimum_bazel_version = "0.26.0",
|
||||
)
|
||||
|
||||
# Setup the Node repositories. We need a NodeJS version that is more recent than v10.15.0
|
||||
|
@ -33,6 +33,3 @@ build --define=compile=legacy
|
||||
# Turn on managed directories feature in Bazel
|
||||
# This allows us to avoid installing a second copy of node_modules
|
||||
common --experimental_allow_incremental_repository_updates
|
||||
|
||||
# Compatibility flag for Bazel 0.27.0
|
||||
common --incompatible_depset_is_not_iterable=false
|
||||
|
@ -269,7 +269,7 @@ def _expected_outs(ctx):
|
||||
# TODO(alxhub): i18n is only produced by the legacy compiler currently. This should be re-enabled
|
||||
# when ngtsc can extract messages
|
||||
if is_legacy_ngc:
|
||||
i18n_messages_files = [ctx.actions.declare_file(ctx.label.name + "_ngc_messages.xmb")]
|
||||
i18n_messages_files = [ctx.new_file(ctx.genfiles_dir, ctx.label.name + "_ngc_messages.xmb")]
|
||||
else:
|
||||
i18n_messages_files = []
|
||||
|
||||
@ -442,7 +442,7 @@ def ngc_compile_action(
|
||||
|
||||
if dts_bundles_out != None:
|
||||
# combine the inputs and outputs and filter .d.ts and json files
|
||||
filter_inputs = [f for f in inputs.to_list() + outputs if f.path.endswith(".d.ts") or f.path.endswith(".json")]
|
||||
filter_inputs = [f for f in list(inputs) + outputs if f.path.endswith(".d.ts") or f.path.endswith(".json")]
|
||||
|
||||
if _should_produce_flat_module_outs(ctx):
|
||||
dts_entry_points = ["%s.d.ts" % _flat_module_out_file(ctx)]
|
||||
|
@ -94,10 +94,6 @@ WELL_KNOWN_GLOBALS = {p: _global_name(p) for p in [
|
||||
"rxjs/operators",
|
||||
]}
|
||||
|
||||
# skydoc fails with type(depset()) so using "depset" here instead
|
||||
# TODO(gregmagolan): clean this up
|
||||
_DEPSET_TYPE = "depset"
|
||||
|
||||
def _rollup(ctx, bundle_name, rollup_config, entry_point, inputs, js_output, format = "es", package_name = "", include_tslib = False):
|
||||
map_output = ctx.actions.declare_file(js_output.basename + ".map", sibling = js_output)
|
||||
|
||||
@ -137,7 +133,7 @@ def _rollup(ctx, bundle_name, rollup_config, entry_point, inputs, js_output, for
|
||||
|
||||
args.add("--silent")
|
||||
|
||||
other_inputs = [rollup_config]
|
||||
other_inputs = [ctx.executable._rollup, rollup_config]
|
||||
if ctx.file.license_banner:
|
||||
other_inputs.append(ctx.file.license_banner)
|
||||
if ctx.version_file:
|
||||
@ -148,7 +144,6 @@ def _rollup(ctx, bundle_name, rollup_config, entry_point, inputs, js_output, for
|
||||
inputs = inputs.to_list() + other_inputs,
|
||||
outputs = [js_output, map_output],
|
||||
executable = ctx.executable._rollup,
|
||||
tools = [ctx.executable._rollup],
|
||||
arguments = [args],
|
||||
)
|
||||
return struct(
|
||||
@ -170,8 +165,7 @@ def _flatten_paths(directory):
|
||||
# Optionally can filter out files that do not belong to a specified package path.
|
||||
def _filter_out_generated_files(files, extension, package_path = None):
|
||||
result = []
|
||||
files_list = files.to_list() if type(files) == _DEPSET_TYPE else files
|
||||
for file in files_list:
|
||||
for file in files:
|
||||
# If the "package_path" parameter has been specified, filter out files
|
||||
# that do not start with the the specified package path.
|
||||
if package_path and not file.short_path.startswith(package_path):
|
||||
@ -189,10 +183,9 @@ def _esm2015_root_dir(ctx):
|
||||
return ctx.label.name + ".es6"
|
||||
|
||||
def _filter_js_inputs(all_inputs):
|
||||
all_inputs_list = all_inputs.to_list() if type(all_inputs) == _DEPSET_TYPE else all_inputs
|
||||
return [
|
||||
f
|
||||
for f in all_inputs_list
|
||||
for f in all_inputs
|
||||
if f.path.endswith(".js") or f.path.endswith(".json")
|
||||
]
|
||||
|
||||
|
@ -48,7 +48,7 @@ function addDevDependenciesToPackageJson(options: Schema) {
|
||||
|
||||
const devDependencies: {[k: string]: string} = {
|
||||
'@angular/bazel': angularCoreVersion,
|
||||
'@bazel/bazel': '^0.27.0',
|
||||
'@bazel/bazel': '^0.26.0',
|
||||
'@bazel/ibazel': '^0.10.2',
|
||||
'@bazel/karma': '0.31.1',
|
||||
'@bazel/typescript': '0.31.1',
|
||||
|
@ -113,7 +113,6 @@ describe('ng-add schematic', () => {
|
||||
const json = JSON.parse(content);
|
||||
const devDeps = Object.keys(json.devDependencies);
|
||||
expect(devDeps).toContain('@bazel/bazel');
|
||||
expect(devDeps).toContain('@bazel/hide-bazel-files');
|
||||
expect(devDeps).toContain('@bazel/ibazel');
|
||||
expect(devDeps).toContain('@bazel/karma');
|
||||
});
|
||||
|
Reference in New Issue
Block a user