diff options
author | zaverden <zaverden@yandex-team.com> | 2024-06-11 08:00:26 +0300 |
---|---|---|
committer | zaverden <zaverden@yandex-team.com> | 2024-06-11 08:15:47 +0300 |
commit | 799669481bc899de3c441756546785fca22d2423 (patch) | |
tree | 3ec9854cdb538283fe0de625d948c7611898386e /build/plugins/nots.py | |
parent | ca4183836a7f147ab01cf4c617b09f2f0ebd9155 (diff) | |
download | ydb-799669481bc899de3c441756546785fca22d2423.tar.gz |
feat(conf+builder): build without contrib/typescript
89c8f9767a1ef610f9ee050e1a5da5728bba02d7
Diffstat (limited to 'build/plugins/nots.py')
-rw-r--r-- | build/plugins/nots.py | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/build/plugins/nots.py b/build/plugins/nots.py index 8fe01aeacd..909efcb546 100644 --- a/build/plugins/nots.py +++ b/build/plugins/nots.py @@ -542,20 +542,39 @@ def _select_matching_version(erm_json, resource_name, range_str, dep_is_required @_with_report_configure_error def on_prepare_deps_configure(unit): - # Originally this peerdir was in .conf file - # but it kept taking default value of NPM_CONTRIBS_PATH - # before it was updated by CUSTOM_CONTRIB_TYPESCRIPT() - # so I moved it here. - unit.onpeerdir(unit.get("NPM_CONTRIBS_PATH")) + contrib_path = unit.get("NPM_CONTRIBS_PATH") + if contrib_path == '-': + unit.on_prepare_deps_configure_no_contrib() + return + unit.onpeerdir(contrib_path) pm = _create_pm(unit) pj = pm.load_package_json_from_dir(pm.sources_path) has_deps = pj.has_dependencies() ins, outs = pm.calc_prepare_deps_inouts(unit.get("_TARBALLS_STORE"), has_deps) - if pj.has_dependencies(): + if has_deps: + unit.onpeerdir(pm.get_local_peers_from_package_json()) + __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("input", ["hide"], sorted(ins))) + __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", ["hide"], sorted(outs))) + + else: + __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", [], sorted(outs))) + unit.set(["_PREPARE_DEPS_CMD", "$_PREPARE_NO_DEPS_CMD"]) + + +@_with_report_configure_error +def on_prepare_deps_configure_no_contrib(unit): + pm = _create_pm(unit) + pj = pm.load_package_json_from_dir(pm.sources_path) + has_deps = pj.has_dependencies() + ins, outs, resources = pm.calc_prepare_deps_inouts_and_resources(unit.get("_TARBALLS_STORE"), has_deps) + + if has_deps: unit.onpeerdir(pm.get_local_peers_from_package_json()) __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("input", ["hide"], sorted(ins))) __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", ["hide"], sorted(outs))) + unit.set(["_PREPARE_DEPS_RESOURCES", " ".join([f'${{resource:"{uri}"}}' for uri in sorted(resources)])]) + unit.set(["_PREPARE_DEPS_USE_RESOURCES_FLAG", "--resource-root $(RESOURCE_ROOT)"]) else: __set_append(unit, "_PREPARE_DEPS_INOUTS", _build_directives("output", [], sorted(outs))) |