@@ -223,8 +223,9 @@ def run(self, env):
223223 package_configuration .uat_logs_directory = package_configuration .engine_directory + '/Programs/AutomationTool/Saved/Logs'
224224
225225
226+ env .use_ue_custom_config = env .unreal_version >= 5.3
226227 if env .variant :
227- if env .unreal_version >= 5.3 :
228+ if env .use_ue_custom_config :
228229 variant_configuration_directory = package_configuration .configuration_directory + '/Custom/' + env .variant
229230 else :
230231 variant_configuration_directory = package_configuration .configuration_directory + '/Variants/Active'
@@ -366,14 +367,14 @@ def _setup_default_config_file(config_file):
366367 if is_monorepo_behavior :
367368 _try_remove (active_configuration_directory , False )
368369 if should_configure_variant :
369- if env .unreal_version >= 5.3 :
370+ if env .use_ue_custom_config :
370371 variant_configuration_directory = f'{ project_directory } /Config/Custom/{ env .variant } '
371372 else :
372373 variant_configuration_directory = f'{ project_directory } /Config/Variants/{ env .variant } '
373374 if not os .path .exists (variant_configuration_directory ):
374375 raise FileNotFoundError (f"Variant not found : { variant_configuration_directory } " )
375376 configuration_directory = variant_configuration_directory
376- if not env .unreal_version >= 5.3 :
377+ if not env .use_ue_custom_config :
377378 logging .info ('configuring variant %s in : %s' , env .variant , active_configuration_directory )
378379 shutil .copytree (variant_configuration_directory , active_configuration_directory , copy_function = shutil .copyfile )
379380 configuration_directory = active_configuration_directory
@@ -422,7 +423,7 @@ def enumerate_unreal_configs(env):
422423 # order matters: from deepest ini to broadest (deep<-variant<-platform<-game)
423424 config_files_patterns = []
424425 if hasattr (env , 'variant' ) and env .variant :
425- if env .unreal_version >= 5.3 :
426+ if env .use_ue_custom_config :
426427 config_files_patterns .extend ([
427428 '{uproject_dir}/Config/{cook_platform}/Custom/{variant}/{cook_platform}Game.ini' ,
428429 '{uproject_dir}/Config/Custom/{variant}/DefaultGame.ini'
@@ -710,11 +711,11 @@ def cook(env, package_configuration):
710711 cook_command += shlex .split (option )
711712
712713 # Load the active variant
713- if env .unreal_version >= 5.3 :
714- if env .variant :
715- cook_command += [ f'-CustomConfig={ env .variant } ' ]
716- else :
717- cook_command += [ '-DNEConfigVariant' ]
714+ if env .variant :
715+ if env .use_ue_custom_config :
716+ cook_command += [ f'-CustomConfig={ env .variant } ' ]
717+ else :
718+ cook_command += [ '-DNEConfigVariant' ]
718719
719720 if package_configuration .shader_debug_info :
720721 sdb_path = package_configuration .project_directory + '/Saved/ShaderDebugInfo/' + package_configuration .target_platform
@@ -810,7 +811,7 @@ def stage(env, package_configuration):
810811 if env .is_dne_legacy_ue4 :
811812 stage_command += [ '-SkipPak' ]
812813
813- if env .unreal_version >= 5.3 :
814+ if env .use_ue_custom_config :
814815 if env .variant :
815816 stage_command += [ f'-CustomConfig={ env .variant } ' ]
816817
@@ -1304,7 +1305,7 @@ def package_with_uat(env, package_configuration):
13041305 if package_configuration .no_compile_packaging :
13051306 package_command += [ '-NoCompile' ]
13061307
1307- if env .unreal_version >= 5.3 :
1308+ if env .use_ue_custom_config :
13081309 if env .variant :
13091310 package_command += [ f'-CustomConfig={ env .variant } ' ]
13101311
0 commit comments