Misc. phased commit fixes

This commit is contained in:
MaXFeeD
2026-07-23 20:35:27 +03:00
parent 82d7aa35f2
commit e540175395
4 changed files with 9 additions and 7 deletions
+2 -1
View File
@@ -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"
+1
View File
@@ -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:
+5 -5
View File
@@ -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={
+1 -1
View File
@@ -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,