Building scripts from build.config, frozen messages and typo fixes

This commit is contained in:
MaXFeeD
2025-09-09 23:54:00 +03:00
parent 850508ee5c
commit ebf086073e
4 changed files with 7 additions and 6 deletions
+4 -2
View File
@@ -32,7 +32,9 @@ class BuildConfig(MakeDataConfig):
def iterate_scripts(self) -> Iterable[MakeScriptData]:
if self.get_value("defaultConfig.buildType") == "release":
# XXX: Perhaps we should do something, but scripts may no longer exist.
# It is important to leave a `compile`` field to load them.
# It is important to leave a `compile` field to load them.
from .shell import frozen
frozen("Project is set to release mode, building scripts will be skipped.")
return
library_path = self.get_value("defaultConfig.libraryDir")
@@ -56,7 +58,7 @@ class BuildConfig(MakeDataConfig):
def obtain_script_data(self, source: Config) -> MakeScriptData:
relative_path = source.get_value_unsafe("path")
type = source.get_value_unsafe("type")
type = source.get_value_unsafe("sourceType")
if not type in VALID_SOURCE_TYPES:
raise ValueError(f"Script {relative_path!r} has invalid type, it should be one of: {', '.join(VALID_SOURCE_TYPES)}!")
+1 -1
View File
@@ -23,7 +23,7 @@ def get_language_directories(compile_type: str, language_config: Config, propert
if not any(directories):
# Obtain directories from deprecated `compile` property.
directories = list(filter(
lambda source: isinstance(source, Config) and compile_type == source.get_value("type"),
lambda source: isinstance(source, Config) and compile_type == source.get_value("type", lambda: source.get_value("sourceType")),
make_config.obtain_list("compile")
))
configurables = dict()
+1 -2
View File
@@ -16,8 +16,8 @@ def build_resources() -> int:
GLOBALS.MOD_STRUCTURE.cleanup_build_target("gui")
GLOBALS.MOD_STRUCTURE.cleanup_build_target("minecraft_resource_pack")
GLOBALS.MOD_STRUCTURE.cleanup_build_target("minecraft_behavior_pack")
overall_result = 0
overall_result = 0
for resource in GLOBALS.MAKE_CONFIG.iterate_resources():
resource_files = expand_paths(GLOBALS.MAKE_CONFIG.get_relative_path(resource.relative_path))
if len(resource_files) == 0:
@@ -91,7 +91,6 @@ def build_pack_graphics() -> int:
def build_additional_resources() -> int:
overall_result = 0
for asset in GLOBALS.MAKE_CONFIG.iterate_assets():
additional_files = expand_paths(GLOBALS.MAKE_CONFIG.get_relative_path(asset.relative_path))
if len(additional_files) == 0:
+1 -1
View File
@@ -158,7 +158,7 @@ def copy_build_targets(composite: List[Tuple[str, str, str]], includes: List[Tup
continue
if not GLOBALS.BUILD_STORAGE.is_path_changed(temporary_script):
failure(f"Build target {basename(temporary_script)!r} is not changed.")
frozen(f"Build target {basename(temporary_script)!r} is not changed.")
GLOBALS.BUILD_STORAGE.save()