Merge branch 'main' into LoadPipelineFromGitHub
This commit is contained in:
@@ -20,6 +20,7 @@ Assumptions for running automation:
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from pathlib import PurePath, Path
|
||||
from subprocess import CalledProcessError
|
||||
|
||||
import six
|
||||
@@ -120,6 +121,7 @@ class AndroidLauncher(Launcher):
|
||||
self._adb_prefix_command = ['adb']
|
||||
self._device_id = None
|
||||
self.launch_proc = None
|
||||
self.android_vfs_setreg_path = None
|
||||
self.package_name = get_package_name(os.path.join(self.workspace.paths.dev(),
|
||||
self.workspace.project))
|
||||
self._device_id = self.get_device_config(config_file=self.workspace.paths.devices_file(),
|
||||
@@ -181,6 +183,9 @@ class AndroidLauncher(Launcher):
|
||||
def teardown(self):
|
||||
ly_test_tools.mobile.android.undo_tcp_port_changes(self._device_id)
|
||||
self.restore_settings()
|
||||
# Remove temporary vfs file if created
|
||||
if self.android_vfs_setreg_path and os.path.isfile(self.android_vfs_setreg_path):
|
||||
os.remove(self.android_vfs_setreg_path)
|
||||
self.workspace.shader_compiler.stop()
|
||||
super(AndroidLauncher, self).teardown()
|
||||
|
||||
@@ -190,12 +195,22 @@ class AndroidLauncher(Launcher):
|
||||
|
||||
:return: None
|
||||
"""
|
||||
self.workspace.settings.modify_bootstrap_setting('sys_game_folder', self.workspace.project)
|
||||
self.workspace.settings.modify_bootstrap_setting('connect_to_remote', 1)
|
||||
self.workspace.settings.modify_bootstrap_setting('android_connect_to_remote', 1)
|
||||
self.workspace.settings.modify_bootstrap_setting('wait_for_connect', 1)
|
||||
self.workspace.settings.modify_bootstrap_setting('remote_ip', '127.0.0.1')
|
||||
self.workspace.settings.modify_bootstrap_setting('remote_port', '45643')
|
||||
|
||||
# Write the Android vfs settings to a settings registry file within the user's registry folder
|
||||
user_registry_path = Path(self.workspace.project) / 'user' / 'Registry'
|
||||
user_registry_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Create a python dictionary that can serialize to a json file with JSON pointer of
|
||||
# /Amazon/AzCore/Bootstrap/<settings>
|
||||
vfs_settings = { 'Amazon' : { 'AzCore' : { 'Bootstrap' : {} }}}
|
||||
vfs_settings['Amazon']['AzCore']['Bootstrap']['connect_to_remote'] = 1
|
||||
vfs_settings['Amazon']['AzCore']['Bootstrap']['android_connect_to_remote'] = 1
|
||||
vfs_settings['Amazon']['AzCore']['Bootstrap']['wait_for_connect'] = 1
|
||||
vfs_settings['Amazon']['AzCore']['Bootstrap']['remote_ip'] = '127.0.0.1'
|
||||
vfs_settings['Amazon']['AzCore']['Bootstrap']['remote_port'] = 45643
|
||||
self.android_vfs_setreg_path = user_registry_path / 'test_android_vfs_settings.android.setreg'
|
||||
with self.android_vfs_setreg_path.open('w') as android_vfs_setreg:
|
||||
json.dump(vfs_settings, android_vfs_setreg, indent=4)
|
||||
|
||||
self.workspace.settings.modify_platform_setting('r_AssetProcessorShaderCompiler', 1)
|
||||
self.workspace.settings.modify_platform_setting('r_ShadersAsyncCompiling', 0)
|
||||
|
||||
@@ -140,7 +140,6 @@ class Launcher(object):
|
||||
Perform settings configuration, must be called after a backup of settings has been created with
|
||||
backup_settings(). Preferred ways to modify settings are:
|
||||
|
||||
self.workspace.settings.modify_bootstrap_setting()
|
||||
self.workspace.settings.modify_platform_setting()
|
||||
|
||||
:return: None
|
||||
@@ -156,7 +155,6 @@ class Launcher(object):
|
||||
"""
|
||||
backup_path = self.workspace.settings.get_temp_path()
|
||||
log.debug(f"Restoring backup of bootstrap, platform and user settings in path {backup_path}")
|
||||
self.workspace.settings.restore_bootstrap_settings(backup_path)
|
||||
self.workspace.settings.restore_platform_settings(backup_path)
|
||||
self.workspace.settings.restore_shader_compiler_settings(backup_path)
|
||||
|
||||
|
||||
@@ -163,13 +163,12 @@ class WinLauncher(Launcher):
|
||||
|
||||
:return: None
|
||||
"""
|
||||
# Update settings
|
||||
# Update settings via the settings registry to avoid modifying the bootstrap.cfg
|
||||
host_ip = '127.0.0.1'
|
||||
|
||||
self.workspace.settings.modify_bootstrap_setting("sys_game_folder", self.workspace.project)
|
||||
self.workspace.settings.modify_bootstrap_setting("remote_ip", host_ip)
|
||||
self.workspace.settings.modify_bootstrap_setting("wait_for_connect", 1)
|
||||
self.workspace.settings.modify_bootstrap_setting("white_list", host_ip)
|
||||
self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/project_path={self.workspace.project}"')
|
||||
self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/remote_ip={host_ip}"')
|
||||
self.args.append('--regset="/Amazon/AzCore/Bootstrap/wait_for_connect=1"')
|
||||
self.args.append(f'--regset="/Amazon/AzCore/Bootstrap/allowed_list={host_ip}"')
|
||||
|
||||
self.workspace.settings.modify_platform_setting("r_AssetProcessorShaderCompiler", 1)
|
||||
self.workspace.settings.modify_platform_setting("r_ShaderCompilerServer", host_ip)
|
||||
@@ -194,7 +193,7 @@ class WinEditor(WinLauncher):
|
||||
|
||||
def __init__(self, build, args):
|
||||
super(WinEditor, self).__init__(build, args)
|
||||
self.args.append("--regset=\"/Amazon/Settings/EnableSourceControl=false\"")
|
||||
self.args.append('--regset="/Amazon/Settings/EnableSourceControl=false"')
|
||||
|
||||
def binary_path(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user