From e54017539522518a75a8bae5594cdd1ecfc35f12 Mon Sep 17 00:00:00 2001 From: MaXFeeD Date: Thu, 23 Jul 2026 20:35:27 +0300 Subject: [PATCH] Misc. phased commit fixes --- examples/config-variants/__main__.py | 3 ++- src/icmtoolchain/context.py | 1 + src/icmtoolchain/resources.py | 10 +++++----- src/icmtoolchain/script_build.py | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/config-variants/__main__.py b/examples/config-variants/__main__.py index 906a59d..93daeba 100644 --- a/examples/config-variants/__main__.py +++ b/examples/config-variants/__main__.py @@ -9,8 +9,9 @@ from icmtoolchain.config import FileConfig from icmtoolchain.language import MakeAssetData, MakeDataConfig from icmtoolchain.parser import parse_arguments from icmtoolchain.project_graph import Artifact, ProjectGraph -from icmtoolchain.shell import attention, success +from icmtoolchain.logger import attention, success from icmtoolchain.task import TASKS +import icmtoolchain.builtin_tasks startup_millis = time() build_command = "--release ensureProjectExists clearOutput --force buildScripts compileNative compileJava buildResources buildInfo buildPackage" diff --git a/src/icmtoolchain/context.py b/src/icmtoolchain/context.py index 7dca33d..cc84cdd 100644 --- a/src/icmtoolchain/context.py +++ b/src/icmtoolchain/context.py @@ -30,6 +30,7 @@ def find_project_config(path: str) -> Optional['MakeDataConfig']: working_directory = dirname(working_directory) def iterate_config_directories(path: str, max_depth: int = 5) -> Iterable['MakeDataConfig']: + from .language import MakeDataConfig path = abspath(path) for dirpath, dirnames, filenames in os.walk(path): if max_depth >= 0 and dirpath.count(os.sep, len(path) + 1) > max_depth: diff --git a/src/icmtoolchain/resources.py b/src/icmtoolchain/resources.py index 0c50c25..08f5d41 100644 --- a/src/icmtoolchain/resources.py +++ b/src/icmtoolchain/resources.py @@ -13,10 +13,10 @@ from .utils import (copy_directory, copy_file, ensure_directory, def build_resources() -> int: # TODO: Separate that shit, we do not need to rebuild EVERYTHING with thousands of resources... - GLOBALS.PROJECT_STRUCTURE.cleanup_target("resource_directory") + GLOBALS.PROJECT_STRUCTURE.cleanup_target("resources") GLOBALS.PROJECT_STRUCTURE.cleanup_target("gui") - GLOBALS.PROJECT_STRUCTURE.cleanup_target("minecraft_resource_pack") - GLOBALS.PROJECT_STRUCTURE.cleanup_target("minecraft_behavior_pack") + GLOBALS.PROJECT_STRUCTURE.cleanup_target("resource_packs") + GLOBALS.PROJECT_STRUCTURE.cleanup_target("behavior_packs") overall_result = 0 for resource in GLOBALS.MAKE_CONFIG.iterate_resources(): @@ -29,7 +29,7 @@ def build_resources() -> int: resource_name = basename(source_path) if resource.type in ("resource_directory", "gui"): target = GLOBALS.PROJECT_STRUCTURE.declare_target( - keyword=resource.type, + keyword="resources" if resource.type == "resource_directory" else "gui", relative_path=resource_name, declare={ "resourceType": "resource" if resource.type == "resource_directory" else resource.type @@ -37,7 +37,7 @@ def build_resources() -> int: ) else: target = GLOBALS.PROJECT_STRUCTURE.declare_target( - keyword=resource.type, + keyword="resource_packs" if resource.type == "minecraft_resource_pack" else "behavior_packs" if resource.type == "minecraft_behavior_pack" else resource.type, relative_path=resource_name, exclude=True, declare_default={ diff --git a/src/icmtoolchain/script_build.py b/src/icmtoolchain/script_build.py index 4674b20..0b9d042 100644 --- a/src/icmtoolchain/script_build.py +++ b/src/icmtoolchain/script_build.py @@ -35,7 +35,7 @@ def rebuild_build_target(source: MakeScriptData, target_path: str) -> str: if ensure_not_whitespace(source.source_name): declare["sourceName"] = source.source_name - target_type = "script_library" if source.type == "library" else "script_source" + target_type = "libraries" if source.type == "library" else "scripts" return GLOBALS.PROJECT_STRUCTURE.declare_target( keyword=target_type, relative_path=target_path,