From 0ce9b6fd1d72139921ad3a20cb1933eb35873eb8 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Mon, 20 Nov 2023 14:31:56 -0600 Subject: [PATCH] Add two new COMSTR environment variables --- SConstruct | 6 +++--- core/SCsub | 12 ++++-------- core/input/SCsub | 2 +- editor/SCsub | 10 +++++----- editor/icons/SCsub | 2 +- editor/themes/SCsub | 2 +- main/SCsub | 6 +++--- methods.py | 15 +++++++++++---- modules/SCsub | 2 -- modules/gdscript/editor/script_templates/SCsub | 2 +- modules/mono/editor/script_templates/SCsub | 2 +- .../text_server_adv/gdextension_build/methods.py | 8 ++++++++ .../text_server_fb/gdextension_build/methods.py | 8 ++++++++ scene/theme/icons/SCsub | 4 +--- 14 files changed, 48 insertions(+), 33 deletions(-) diff --git a/SConstruct b/SConstruct index b7809dfe42a..b6de04a9102 100644 --- a/SConstruct +++ b/SConstruct @@ -930,17 +930,17 @@ if selected_platform in platform_list: GLSL_BUILDERS = { "RD_GLSL": env.Builder( - action=env.Run(glsl_builders.build_rd_headers, 'Building RD_GLSL header: "$TARGET"'), + action=env.Run(glsl_builders.build_rd_headers), suffix="glsl.gen.h", src_suffix=".glsl", ), "GLSL_HEADER": env.Builder( - action=env.Run(glsl_builders.build_raw_headers, 'Building GLSL header: "$TARGET"'), + action=env.Run(glsl_builders.build_raw_headers), suffix="glsl.gen.h", src_suffix=".glsl", ), "GLES3_GLSL": env.Builder( - action=env.Run(gles3_builders.build_gles3_headers, 'Building GLES3 GLSL header: "$TARGET"'), + action=env.Run(gles3_builders.build_gles3_headers), suffix="glsl.gen.h", src_suffix=".glsl", ), diff --git a/core/SCsub b/core/SCsub index 3b1a7ca79a1..1f2166937ac 100644 --- a/core/SCsub +++ b/core/SCsub @@ -202,27 +202,23 @@ env.Depends( env.CommandNoCache( "#core/io/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", - env.Run(core_builders.make_certs_header, "Building ca-certificates header."), + env.Run(core_builders.make_certs_header), ) # Authors env.Depends("#core/authors.gen.h", "../AUTHORS.md") -env.CommandNoCache( - "#core/authors.gen.h", "../AUTHORS.md", env.Run(core_builders.make_authors_header, "Generating authors header.") -) +env.CommandNoCache("#core/authors.gen.h", "../AUTHORS.md", env.Run(core_builders.make_authors_header)) # Donors env.Depends("#core/donors.gen.h", "../DONORS.md") -env.CommandNoCache( - "#core/donors.gen.h", "../DONORS.md", env.Run(core_builders.make_donors_header, "Generating donors header.") -) +env.CommandNoCache("#core/donors.gen.h", "../DONORS.md", env.Run(core_builders.make_donors_header)) # License env.Depends("#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"]) env.CommandNoCache( "#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"], - env.Run(core_builders.make_license_header, "Generating license header."), + env.Run(core_builders.make_license_header), ) # Chain load SCsubs diff --git a/core/input/SCsub b/core/input/SCsub index b12bf561de5..da296371357 100644 --- a/core/input/SCsub +++ b/core/input/SCsub @@ -14,7 +14,7 @@ controller_databases = [ gensource = env.CommandNoCache( "default_controller_mappings.gen.cpp", controller_databases, - env.Run(input_builders.make_default_controller_mappings, "Generating default controller mappings."), + env.Run(input_builders.make_default_controller_mappings), ) env.add_source_files(env.core_sources, "*.cpp") diff --git a/editor/SCsub b/editor/SCsub index bbb40ff3032..c88fd5e16aa 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -68,7 +68,7 @@ if env.editor_build: env.CommandNoCache( "#editor/doc_data_compressed.gen.h", docs, - env.Run(editor_builders.make_doc_header, "Generating documentation header."), + env.Run(editor_builders.make_doc_header), ) # Editor interface and class reference translations incur a significant size @@ -83,7 +83,7 @@ if env.editor_build: env.CommandNoCache( "#editor/editor_translations.gen.h", tlist, - env.Run(editor_builders.make_editor_translations_header, "Generating editor translations header."), + env.Run(editor_builders.make_editor_translations_header), ) # Property translations @@ -92,7 +92,7 @@ if env.editor_build: env.CommandNoCache( "#editor/property_translations.gen.h", tlist, - env.Run(editor_builders.make_property_translations_header, "Generating property translations header."), + env.Run(editor_builders.make_property_translations_header), ) # Documentation translations @@ -101,7 +101,7 @@ if env.editor_build: env.CommandNoCache( "#editor/doc_translations.gen.h", tlist, - env.Run(editor_builders.make_doc_translations_header, "Generating translations header."), + env.Run(editor_builders.make_doc_translations_header), ) # Extractable translations @@ -110,7 +110,7 @@ if env.editor_build: env.CommandNoCache( "#editor/extractable_translations.gen.h", tlist, - env.Run(editor_builders.make_extractable_translations_header, "Generating extractable translations header."), + env.Run(editor_builders.make_extractable_translations_header), ) env.add_source_files(env.editor_sources, "*.cpp") diff --git a/editor/icons/SCsub b/editor/icons/SCsub index cbbfe1d7eaf..d2d752cff45 100644 --- a/editor/icons/SCsub +++ b/editor/icons/SCsub @@ -7,7 +7,7 @@ import editor_icons_builders env["BUILDERS"]["MakeEditorIconsBuilder"] = Builder( - action=env.Run(editor_icons_builders.make_editor_icons_action, "Generating editor icons header."), + action=env.Run(editor_icons_builders.make_editor_icons_action), suffix=".h", src_suffix=".svg", ) diff --git a/editor/themes/SCsub b/editor/themes/SCsub index 41b20f8a78f..65cfb6a8be2 100644 --- a/editor/themes/SCsub +++ b/editor/themes/SCsub @@ -16,7 +16,7 @@ env.Depends("#editor/themes/builtin_fonts.gen.h", flist) env.CommandNoCache( "#editor/themes/builtin_fonts.gen.h", flist, - env.Run(editor_theme_builders.make_fonts_header, "Generating builtin fonts header."), + env.Run(editor_theme_builders.make_fonts_header), ) env.add_source_files(env.editor_sources, "*.cpp") diff --git a/main/SCsub b/main/SCsub index 79dc4bff15f..3e7680bf899 100644 --- a/main/SCsub +++ b/main/SCsub @@ -17,7 +17,7 @@ env_main.Depends("#main/splash.gen.h", "#main/splash.png") env_main.CommandNoCache( "#main/splash.gen.h", "#main/splash.png", - env.Run(main_builders.make_splash, "Building splash screen header."), + env.Run(main_builders.make_splash), ) if not env_main["no_editor_splash"]: @@ -25,14 +25,14 @@ if not env_main["no_editor_splash"]: env_main.CommandNoCache( "#main/splash_editor.gen.h", "#main/splash_editor.png", - env.Run(main_builders.make_splash_editor, "Building editor splash screen header."), + env.Run(main_builders.make_splash_editor), ) env_main.Depends("#main/app_icon.gen.h", "#main/app_icon.png") env_main.CommandNoCache( "#main/app_icon.gen.h", "#main/app_icon.png", - env.Run(main_builders.make_app_icon, "Building application icon."), + env.Run(main_builders.make_app_icon), ) lib = env_main.add_library("main", env.main_sources) diff --git a/methods.py b/methods.py index 88c8e7043e5..7e889195c03 100644 --- a/methods.py +++ b/methods.py @@ -607,6 +607,12 @@ def no_verbose(sys, env): java_library_message = "{}Creating Java Archive {}$TARGET{} ...{}".format( colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] ) + compiled_resource_message = "{}Creating Compiled Resource {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + generated_file_message = "{}Generating {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) env.Append(CXXCOMSTR=[compile_source_message]) env.Append(CCCOMSTR=[compile_source_message]) @@ -618,6 +624,8 @@ def no_verbose(sys, env): env.Append(LINKCOMSTR=[link_program_message]) env.Append(JARCOMSTR=[java_library_message]) env.Append(JAVACCOMSTR=[java_compile_source_message]) + env.Append(RCCOMSTR=[compiled_resource_message]) + env.Append(GENCOMSTR=[generated_file_message]) def detect_visual_c_compiler_version(tools_env): @@ -817,15 +825,14 @@ def CommandNoCache(env, target, sources, command, **args): return result -def Run(env, function, short_message, subprocess=True): +def Run(env, function, subprocess=True): from SCons.Script import Action from platform_methods import run_in_subprocess - output_print = short_message if not env["verbose"] else "" if not subprocess: - return Action(function, output_print) + return Action(function, "$GENCOMSTR") else: - return Action(run_in_subprocess(function), output_print) + return Action(run_in_subprocess(function), "$GENCOMSTR") def detect_darwin_sdk_path(platform, env): diff --git a/modules/SCsub b/modules/SCsub index 7c9946170f4..87c59c3bcca 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -19,7 +19,6 @@ env.CommandNoCache( Value(env.module_list), env.Run( modules_builders.generate_modules_enabled, - "Generating enabled modules header.", # NOTE: No need to run in subprocess since this is still executed serially. subprocess=False, ), @@ -58,7 +57,6 @@ if env["tests"]: test_headers, env.Run( modules_builders.generate_modules_tests, - "Generating modules tests header.", # NOTE: No need to run in subprocess since this is still executed serially. subprocess=False, ), diff --git a/modules/gdscript/editor/script_templates/SCsub b/modules/gdscript/editor/script_templates/SCsub index 2266ef2d01a..5db7e3fc3ba 100644 --- a/modules/gdscript/editor/script_templates/SCsub +++ b/modules/gdscript/editor/script_templates/SCsub @@ -5,7 +5,7 @@ Import("env") import editor.template_builders as build_template_gd env["BUILDERS"]["MakeGDTemplateBuilder"] = Builder( - action=env.Run(build_template_gd.make_templates, "Generating GDScript templates header."), + action=env.Run(build_template_gd.make_templates), suffix=".h", src_suffix=".gd", ) diff --git a/modules/mono/editor/script_templates/SCsub b/modules/mono/editor/script_templates/SCsub index 39f6cb5c01c..01c293c25db 100644 --- a/modules/mono/editor/script_templates/SCsub +++ b/modules/mono/editor/script_templates/SCsub @@ -5,7 +5,7 @@ Import("env") import editor.template_builders as build_template_cs env["BUILDERS"]["MakeCSharpTemplateBuilder"] = Builder( - action=env.Run(build_template_cs.make_templates, "Generating C# templates header."), + action=env.Run(build_template_cs.make_templates), suffix=".h", src_suffix=".cs", ) diff --git a/modules/text_server_adv/gdextension_build/methods.py b/modules/text_server_adv/gdextension_build/methods.py index e58bc3abecb..327097a3df5 100644 --- a/modules/text_server_adv/gdextension_build/methods.py +++ b/modules/text_server_adv/gdextension_build/methods.py @@ -42,6 +42,12 @@ def no_verbose(sys, env): java_library_message = "{}Creating Java Archive {}$TARGET{} ...{}".format( colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] ) + compiled_resource_message = "{}Creating Compiled Resource {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + generated_file_message = "{}Generating {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) env.Append(CXXCOMSTR=[compile_source_message]) env.Append(CCCOMSTR=[compile_source_message]) @@ -53,6 +59,8 @@ def no_verbose(sys, env): env.Append(LINKCOMSTR=[link_program_message]) env.Append(JARCOMSTR=[java_library_message]) env.Append(JAVACCOMSTR=[java_compile_source_message]) + env.Append(RCCOMSTR=[compiled_resource_message]) + env.Append(GENCOMSTR=[generated_file_message]) def disable_warnings(self): diff --git a/modules/text_server_fb/gdextension_build/methods.py b/modules/text_server_fb/gdextension_build/methods.py index e58bc3abecb..327097a3df5 100644 --- a/modules/text_server_fb/gdextension_build/methods.py +++ b/modules/text_server_fb/gdextension_build/methods.py @@ -42,6 +42,12 @@ def no_verbose(sys, env): java_library_message = "{}Creating Java Archive {}$TARGET{} ...{}".format( colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] ) + compiled_resource_message = "{}Creating Compiled Resource {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + generated_file_message = "{}Generating {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) env.Append(CXXCOMSTR=[compile_source_message]) env.Append(CCCOMSTR=[compile_source_message]) @@ -53,6 +59,8 @@ def no_verbose(sys, env): env.Append(LINKCOMSTR=[link_program_message]) env.Append(JARCOMSTR=[java_library_message]) env.Append(JAVACCOMSTR=[java_compile_source_message]) + env.Append(RCCOMSTR=[compiled_resource_message]) + env.Append(GENCOMSTR=[generated_file_message]) def disable_warnings(self): diff --git a/scene/theme/icons/SCsub b/scene/theme/icons/SCsub index fa9f3cb1ceb..46133ccceb9 100644 --- a/scene/theme/icons/SCsub +++ b/scene/theme/icons/SCsub @@ -6,9 +6,7 @@ import default_theme_icons_builders env["BUILDERS"]["MakeDefaultThemeIconsBuilder"] = Builder( - action=env.Run( - default_theme_icons_builders.make_default_theme_icons_action, "Generating default project theme icons header." - ), + action=env.Run(default_theme_icons_builders.make_default_theme_icons_action), suffix=".h", src_suffix=".svg", )