From 41058c42312edf94c5cbc64f014d22b31d56e29c Mon Sep 17 00:00:00 2001 From: MaXFeeD Date: Tue, 28 Jul 2026 12:46:02 +0300 Subject: [PATCH] Removed useless watching build mode --- src/icmtoolchain/builtin_tasks.py | 12 ------------ src/icmtoolchain/script_build.py | 31 ++----------------------------- src/icmtoolchain/tsconfig.py | 15 --------------- 3 files changed, 2 insertions(+), 56 deletions(-) diff --git a/src/icmtoolchain/builtin_tasks.py b/src/icmtoolchain/builtin_tasks.py index a91ac35..14fd9dd 100644 --- a/src/icmtoolchain/builtin_tasks.py +++ b/src/icmtoolchain/builtin_tasks.py @@ -70,18 +70,6 @@ def task_build_scripts() -> int: from .script_build import build_all_scripts return build_all_scripts() -@task( - "watchScripts", - locks=["script", "cleanup", "push"], - description="Recompiles changed scripts instantly using tsc, interruption will end watching." -) -def task_watch_scripts() -> int: - if not GLOBALS.MAKE_CONFIG.supports_scripts: - failure("You cannot have scripts to watch because your project does not support them.") - return 1 - from .script_build import build_all_scripts - return build_all_scripts(watch=True) - @task( "updateIncludes", description="Overrides the contents of 'tsconfig.json' based on script files." diff --git a/src/icmtoolchain/script_build.py b/src/icmtoolchain/script_build.py index 0b9d042..171485a 100644 --- a/src/icmtoolchain/script_build.py +++ b/src/icmtoolchain/script_build.py @@ -11,7 +11,7 @@ from .utils import (RuntimeCodeError, copy_file, ensure_not_whitespace, walk_all_files) -def build_all_scripts(watch: bool = False) -> int: +def build_all_scripts() -> int: GLOBALS.PROJECT_STRUCTURE.cleanup_target("scripts") GLOBALS.PROJECT_STRUCTURE.cleanup_target("libraries") @@ -20,7 +20,7 @@ def build_all_scripts(watch: bool = False) -> int: if not isdir(join(get_config_directory(), "declarations")): attention("Not found 'declarations', in most cases build will be failed, please install it via tasks.") - return build_composite_project() if not watch else watch_composite_project() + return build_composite_project() def rebuild_build_target(source: MakeScriptData, target_path: str) -> str: declare: MutableMapping[str, Any] = { @@ -218,30 +218,3 @@ def build_composite_project() -> int: copy_build_targets(computed_composite, computed_includes) GLOBALS.PROJECT_STRUCTURE.generate_config() return overall_result - -def watch_composite_project() -> int: - if not request_typescript(): - failure("Watching is not supported for legacy JavaScript!") - return 1 - overall_result = 0 - - # Recomputing existing changes before watching, changes here doesn't make sence - # since it will be recomputed after watching interruption - compute_and_capture_changed_scripts() - GLOBALS.TSC_COMPOSITE.flush() - GLOBALS.TSC_COMPOSITE.watch() - GLOBALS.PROJECT_STRUCTURE.cleanup_target("scripts") - GLOBALS.PROJECT_STRUCTURE.cleanup_target("libraries") - GLOBALS.TSC_COMPOSITE.reset() - - composite, computed_composite, includes, computed_includes = compute_and_capture_changed_scripts() - - for included in includes: - if not GLOBALS.MAKE_CONFIG.get_value("project.useReferences", False) or included[2] == "javascript": - overall_result += included[0].build(included[1], included[2]) - if overall_result != 0: - return overall_result - - copy_build_targets(computed_composite, computed_includes) - GLOBALS.PROJECT_STRUCTURE.generate_config() - return overall_result diff --git a/src/icmtoolchain/tsconfig.py b/src/icmtoolchain/tsconfig.py index cae1461..d367a49 100644 --- a/src/icmtoolchain/tsconfig.py +++ b/src/icmtoolchain/tsconfig.py @@ -270,18 +270,3 @@ class CompositeProject: *GLOBALS.MAKE_CONFIG.get_value("development.tsc", list()), *args ], shell=platform.system() == "Windows") - - def watch(self, *args: str) -> int: - from .script_setup import request_typescript - tsc = request_typescript() - if not tsc: - raise RuntimeError("A tsc is required to watch project, make sure it is present before calling this function.") - try: - return subprocess.call([ - tsc, - "--watch", - *GLOBALS.MAKE_CONFIG.get_value("development.watch", list()), - *args - ], cwd=dirname(self.get_tsconfig()).replace("/", os.path.sep), shell=platform.system() == "Windows") - except KeyboardInterrupt: - return 0