Misc. phased commit fixes
This commit is contained in:
@@ -9,8 +9,9 @@ from icmtoolchain.config import FileConfig
|
|||||||
from icmtoolchain.language import MakeAssetData, MakeDataConfig
|
from icmtoolchain.language import MakeAssetData, MakeDataConfig
|
||||||
from icmtoolchain.parser import parse_arguments
|
from icmtoolchain.parser import parse_arguments
|
||||||
from icmtoolchain.project_graph import Artifact, ProjectGraph
|
from icmtoolchain.project_graph import Artifact, ProjectGraph
|
||||||
from icmtoolchain.shell import attention, success
|
from icmtoolchain.logger import attention, success
|
||||||
from icmtoolchain.task import TASKS
|
from icmtoolchain.task import TASKS
|
||||||
|
import icmtoolchain.builtin_tasks
|
||||||
|
|
||||||
startup_millis = time()
|
startup_millis = time()
|
||||||
build_command = "--release ensureProjectExists clearOutput --force buildScripts compileNative compileJava buildResources buildInfo buildPackage"
|
build_command = "--release ensureProjectExists clearOutput --force buildScripts compileNative compileJava buildResources buildInfo buildPackage"
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ def find_project_config(path: str) -> Optional['MakeDataConfig']:
|
|||||||
working_directory = dirname(working_directory)
|
working_directory = dirname(working_directory)
|
||||||
|
|
||||||
def iterate_config_directories(path: str, max_depth: int = 5) -> Iterable['MakeDataConfig']:
|
def iterate_config_directories(path: str, max_depth: int = 5) -> Iterable['MakeDataConfig']:
|
||||||
|
from .language import MakeDataConfig
|
||||||
path = abspath(path)
|
path = abspath(path)
|
||||||
for dirpath, dirnames, filenames in os.walk(path):
|
for dirpath, dirnames, filenames in os.walk(path):
|
||||||
if max_depth >= 0 and dirpath.count(os.sep, len(path) + 1) > max_depth:
|
if max_depth >= 0 and dirpath.count(os.sep, len(path) + 1) > max_depth:
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ from .utils import (copy_directory, copy_file, ensure_directory,
|
|||||||
|
|
||||||
def build_resources() -> int:
|
def build_resources() -> int:
|
||||||
# TODO: Separate that shit, we do not need to rebuild EVERYTHING with thousands of resources...
|
# 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("gui")
|
||||||
GLOBALS.PROJECT_STRUCTURE.cleanup_target("minecraft_resource_pack")
|
GLOBALS.PROJECT_STRUCTURE.cleanup_target("resource_packs")
|
||||||
GLOBALS.PROJECT_STRUCTURE.cleanup_target("minecraft_behavior_pack")
|
GLOBALS.PROJECT_STRUCTURE.cleanup_target("behavior_packs")
|
||||||
|
|
||||||
overall_result = 0
|
overall_result = 0
|
||||||
for resource in GLOBALS.MAKE_CONFIG.iterate_resources():
|
for resource in GLOBALS.MAKE_CONFIG.iterate_resources():
|
||||||
@@ -29,7 +29,7 @@ def build_resources() -> int:
|
|||||||
resource_name = basename(source_path)
|
resource_name = basename(source_path)
|
||||||
if resource.type in ("resource_directory", "gui"):
|
if resource.type in ("resource_directory", "gui"):
|
||||||
target = GLOBALS.PROJECT_STRUCTURE.declare_target(
|
target = GLOBALS.PROJECT_STRUCTURE.declare_target(
|
||||||
keyword=resource.type,
|
keyword="resources" if resource.type == "resource_directory" else "gui",
|
||||||
relative_path=resource_name,
|
relative_path=resource_name,
|
||||||
declare={
|
declare={
|
||||||
"resourceType": "resource" if resource.type == "resource_directory" else resource.type
|
"resourceType": "resource" if resource.type == "resource_directory" else resource.type
|
||||||
@@ -37,7 +37,7 @@ def build_resources() -> int:
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
target = GLOBALS.PROJECT_STRUCTURE.declare_target(
|
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,
|
relative_path=resource_name,
|
||||||
exclude=True,
|
exclude=True,
|
||||||
declare_default={
|
declare_default={
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def rebuild_build_target(source: MakeScriptData, target_path: str) -> str:
|
|||||||
if ensure_not_whitespace(source.source_name):
|
if ensure_not_whitespace(source.source_name):
|
||||||
declare["sourceName"] = 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(
|
return GLOBALS.PROJECT_STRUCTURE.declare_target(
|
||||||
keyword=target_type,
|
keyword=target_type,
|
||||||
relative_path=target_path,
|
relative_path=target_path,
|
||||||
|
|||||||
Reference in New Issue
Block a user