O3de updates restricted download (#229)
* fix project centric set current * Adding newline to project.json template * Adding newline to engine.json * Changed register -this-engine to be data driven * adding build server support * fix log dir * fix add remove * fix template creation for restricted * fix typos and descriptions * Add newline to the end of template.json * Adding newline to the end of assets_scan_folders.seteg * current_project in global project that creates/edits the .o3de/Registry/bootstrap.setreg * fix the build server flags * fix the o3de manifest server portion * disable project manager tests for now. Its changed too much and lytestools is not working at the moment. I will get back to this later. * fix the Mac build config * disable project_test, this is the project manager. It has changed too much for these tests to work at the moment. I'll get back to them Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>main
parent
b2523217c3
commit
43b474a4b2
@ -1,83 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
add_subdirectory(TextureAtlas)
|
||||
add_subdirectory(LmbrCentral)
|
||||
add_subdirectory(LyShine)
|
||||
add_subdirectory(Maestro)
|
||||
add_subdirectory(SceneProcessing)
|
||||
add_subdirectory(SurfaceData)
|
||||
add_subdirectory(EMotionFX)
|
||||
add_subdirectory(Achievements)
|
||||
add_subdirectory(CameraFramework)
|
||||
add_subdirectory(HttpRequestor)
|
||||
add_subdirectory(Gestures)
|
||||
add_subdirectory(FastNoise)
|
||||
add_subdirectory(GradientSignal)
|
||||
add_subdirectory(AudioSystem)
|
||||
add_subdirectory(AudioEngineWwise)
|
||||
add_subdirectory(GraphCanvas)
|
||||
add_subdirectory(DebugDraw)
|
||||
add_subdirectory(ImGui)
|
||||
add_subdirectory(InAppPurchases)
|
||||
add_subdirectory(LocalUser)
|
||||
add_subdirectory(LyShineExamples)
|
||||
add_subdirectory(ExpressionEvaluation)
|
||||
add_subdirectory(MessagePopup)
|
||||
add_subdirectory(PhysX)
|
||||
add_subdirectory(PhysXDebug)
|
||||
add_subdirectory(ScriptEvents)
|
||||
add_subdirectory(AssetValidation)
|
||||
add_subdirectory(VirtualGamepad)
|
||||
add_subdirectory(SaveData)
|
||||
add_subdirectory(Camera)
|
||||
add_subdirectory(GameState)
|
||||
add_subdirectory(Vegetation)
|
||||
add_subdirectory(GameStateSamples)
|
||||
add_subdirectory(SliceFavorites)
|
||||
add_subdirectory(Metastream)
|
||||
add_subdirectory(ScriptCanvas)
|
||||
add_subdirectory(ScriptedEntityTweener)
|
||||
add_subdirectory(StartingPointMovement)
|
||||
add_subdirectory(StartingPointInput)
|
||||
add_subdirectory(ScriptCanvasPhysics)
|
||||
add_subdirectory(StartingPointCamera)
|
||||
add_subdirectory(Presence)
|
||||
add_subdirectory(ScriptCanvasTesting)
|
||||
add_subdirectory(TestAssetBuilder)
|
||||
add_subdirectory(ScriptCanvasDeveloper)
|
||||
add_subdirectory(CustomAssetExample)
|
||||
add_subdirectory(AutomatedLauncherTesting)
|
||||
add_subdirectory(NvCloth)
|
||||
add_subdirectory(AssetMemoryAnalyzer)
|
||||
add_subdirectory(CertificateManager)
|
||||
add_subdirectory(TickBusOrderViewer)
|
||||
add_subdirectory(MultiplayerCompression)
|
||||
add_subdirectory(Multiplayer)
|
||||
add_subdirectory(SceneLoggingExample)
|
||||
add_subdirectory(VideoPlaybackFramework)
|
||||
add_subdirectory(CrashReporting)
|
||||
add_subdirectory(Twitch)
|
||||
add_subdirectory(EditorPythonBindings)
|
||||
add_subdirectory(QtForPython)
|
||||
add_subdirectory(Microphone)
|
||||
add_subdirectory(Atom)
|
||||
add_subdirectory(AtomLyIntegration)
|
||||
add_subdirectory(RADTelemetry)
|
||||
add_subdirectory(GraphModel)
|
||||
add_subdirectory(LandscapeCanvas)
|
||||
add_subdirectory(WhiteBox)
|
||||
add_subdirectory(Blast)
|
||||
add_subdirectory(PythonAssetBuilder)
|
||||
add_subdirectory(Prefab)
|
||||
add_subdirectory(AWSClientAuth)
|
||||
add_subdirectory(AWSCore)
|
||||
add_subdirectory(AWSMetrics)
|
||||
@ -1,56 +0,0 @@
|
||||
# {BEGIN_LICENSE}
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# This file is copied during engine registration. Edits to this file will be lost next
|
||||
# time a registration happens.
|
||||
include_guard()
|
||||
|
||||
# Read the engine name from the project_json file
|
||||
file(READ ${CMAKE_CURRENT_LIST_DIR}/project.json project_json)
|
||||
string(JSON LY_ENGINE_NAME_TO_USE ERROR_VARIABLE json_error GET ${project_json} engine)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
# Read the list of paths from ~.o3de/o3de_manifest.json
|
||||
file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory) # Windows
|
||||
if((NOT home_directory) OR (NOT EXISTS ${home_directory}))
|
||||
file(TO_CMAKE_PATH "$ENV{HOME}" home_directory)# Unix
|
||||
endif()
|
||||
|
||||
if (NOT home_directory)
|
||||
message(FATAL_ERROR "Cannot find user home directory, the o3de manifest cannot be found")
|
||||
endif()
|
||||
# Set manifest path to path in the user home directory
|
||||
set(manifest_path ${home_directory}/.o3de/o3de_manifest.json)
|
||||
|
||||
if(EXISTS ${manifest_path})
|
||||
file(READ ${manifest_path} manifest_json)
|
||||
string(JSON engines_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engines' from '${manifest_path}', error: ${json_error}")
|
||||
endif()
|
||||
math(EXPR engines_count "${engines_count}-1")
|
||||
foreach(engine_path_index RANGE ${engines_count})
|
||||
string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines ${engine_path_index})
|
||||
if(${json_error})
|
||||
message(FATAL_ERROR "Unable to read engines[${engine_path_index}] '${manifest_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,634 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import pathlib
|
||||
|
||||
from cmake.Tools import utils
|
||||
from cmake.Tools import common
|
||||
|
||||
logger = logging.getLogger()
|
||||
logging.basicConfig()
|
||||
|
||||
|
||||
def add_gem_dependency(cmake_file: str,
|
||||
gem_target: str) -> int:
|
||||
"""
|
||||
adds a gem dependency to a cmake file
|
||||
:param cmake_file: path to the cmake file
|
||||
:param gem_target: name of the cmake target
|
||||
:return: 0 for success or non 0 failure code
|
||||
"""
|
||||
if not os.path.isfile(cmake_file):
|
||||
logger.error(f'Failed to locate cmake file {cmake_file}')
|
||||
return 1
|
||||
|
||||
# on a line by basis, see if there already is Gem::{gem_name}
|
||||
# find the first occurrence of a gem, copy its formatting and replace
|
||||
# the gem name with the new one and append it
|
||||
# if the gem is already present fail
|
||||
t_data = []
|
||||
added = False
|
||||
with open(cmake_file, 'r') as s:
|
||||
for line in s:
|
||||
if f'Gem::{gem_target}' in line:
|
||||
logger.warning(f'{gem_target} is already a gem dependency.')
|
||||
return 0
|
||||
if not added and r'Gem::' in line:
|
||||
new_gem = ' ' * line.find(r'Gem::') + f'Gem::{gem_target}\n'
|
||||
t_data.append(new_gem)
|
||||
added = True
|
||||
t_data.append(line)
|
||||
|
||||
# if we didn't add it the set gem dependencies could be empty so
|
||||
# add a new gem, if empty the correct format is 1 tab=4spaces
|
||||
if not added:
|
||||
index = 0
|
||||
for line in t_data:
|
||||
index = index + 1
|
||||
if r'set(GEM_DEPENDENCIES' in line:
|
||||
t_data.insert(index, f' Gem::{gem_target}\n')
|
||||
added = True
|
||||
break
|
||||
|
||||
# if we didn't add it then it's not here, add a whole new one
|
||||
if not added:
|
||||
t_data.append('\n')
|
||||
t_data.append('set(GEM_DEPENDENCIES\n')
|
||||
t_data.append(f' Gem::{gem_target}\n')
|
||||
t_data.append(')\n')
|
||||
|
||||
# write the cmake
|
||||
os.unlink(cmake_file)
|
||||
with open(cmake_file, 'w') as s:
|
||||
s.writelines(t_data)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def get_project_gem_list(project_path: str,
|
||||
platform: str = 'Common') -> set:
|
||||
runtime_gems = get_gem_list(get_dependencies_cmake(project_path, 'runtime', platform))
|
||||
tool_gems = get_gem_list(get_dependencies_cmake(project_path, 'tool', platform))
|
||||
server_gems = get_gem_list(get_dependencies_cmake(project_path, 'server', platform))
|
||||
return runtime_gems.union(tool_gems.union(server_gems))
|
||||
|
||||
|
||||
def get_gem_list(cmake_file: str) -> set:
|
||||
"""
|
||||
Gets a list of declared gem dependencies of a cmake file
|
||||
:param cmake_file: path to the cmake file
|
||||
:return: set of gems found
|
||||
"""
|
||||
if not os.path.isfile(cmake_file):
|
||||
logger.error(f'Failed to locate cmake file {cmake_file}')
|
||||
return set()
|
||||
|
||||
gem_list = set()
|
||||
with open(cmake_file, 'r') as s:
|
||||
for line in s:
|
||||
gem_name = line.split('Gem::')
|
||||
if len(gem_name) > 1:
|
||||
# Only take the name as everything leading up to the first '.' if found
|
||||
# Gem naming conventions will have GemName.Editor, GemName.Server, and GemName
|
||||
# as different targets of the GemName Gem
|
||||
gem_list.add(gem_name[1].split('.')[0].replace('\n', ''))
|
||||
return gem_list
|
||||
|
||||
|
||||
def remove_gem_dependency(cmake_file: str,
|
||||
gem_target: str) -> int:
|
||||
"""
|
||||
removes a gem dependency from a cmake file
|
||||
:param cmake_file: path to the cmake file
|
||||
:param gem_target: cmake target name
|
||||
:return: 0 for success or non 0 failure code
|
||||
"""
|
||||
if not os.path.isfile(cmake_file):
|
||||
logger.error(f'Failed to locate cmake file {cmake_file}')
|
||||
return 1
|
||||
|
||||
# on a line by basis, remove any line with Gem::{gem_name}
|
||||
t_data = []
|
||||
# Remove the gem from the cmake_dependencies file by skipping the gem name entry
|
||||
removed = False
|
||||
with open(cmake_file, 'r') as s:
|
||||
for line in s:
|
||||
if f'Gem::{gem_target}' in line:
|
||||
removed = True
|
||||
else:
|
||||
t_data.append(line)
|
||||
|
||||
if not removed:
|
||||
logger.error(f'Failed to remove Gem::{gem_target} from cmake file {cmake_file}')
|
||||
return 1
|
||||
|
||||
# write the cmake
|
||||
os.unlink(cmake_file)
|
||||
with open(cmake_file, 'w') as s:
|
||||
s.writelines(t_data)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def add_gem_subdir(cmake_file: str,
|
||||
gem_name: str) -> int:
|
||||
"""
|
||||
adds a gem subdir to a cmake file
|
||||
:param cmake_file: path to the cmake file
|
||||
:param gem_name: name of the gem to add
|
||||
:return: 0 for success or non 0 failure code
|
||||
"""
|
||||
if not os.path.isfile(cmake_file):
|
||||
logger.error(f'Failed to locate cmake file {cmake_file}')
|
||||
return 1
|
||||
|
||||
if not utils.validate_identifier(gem_name):
|
||||
logger.error(f'{gem_name} is not a valid gem name')
|
||||
return 1
|
||||
|
||||
# on a line by basis, see if there already is Gem::{gem_name}
|
||||
# find the first occurrence of a gem, copy its formatting and replace
|
||||
# the gem name with the new one and append it
|
||||
# if the gem is already present fail
|
||||
t_data = []
|
||||
added = False
|
||||
add_line = f'add_subdirectory({gem_name})'
|
||||
with open(cmake_file, 'r') as s:
|
||||
for line in s:
|
||||
if add_line in line:
|
||||
logger.info(f'{add_line} is already in {cmake_file} - skipping.')
|
||||
return 0
|
||||
if not added and r'add_subdirectory(' in line:
|
||||
new_gem = ' ' * line.find(r'add_subdirectory(') + f'add_subdirectory({gem_name})\n'
|
||||
t_data.append(new_gem)
|
||||
added = True
|
||||
t_data.append(line)
|
||||
|
||||
if not added:
|
||||
logger.error(f'Failed to add add_subdirectory({gem_name}) from {cmake_file}.')
|
||||
return 1
|
||||
|
||||
# write the cmake
|
||||
os.unlink(cmake_file)
|
||||
with open(cmake_file, 'w') as s:
|
||||
s.writelines(t_data)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def remove_gem_subdir(cmake_file: str,
|
||||
gem_name: str) -> int:
|
||||
"""
|
||||
removes a gem subdir form a cmake file
|
||||
:param cmake_file: path to the cmake file
|
||||
:param gem_name: name of the gem to remove
|
||||
:return: 0 for success or non 0 failure code
|
||||
"""
|
||||
if not os.path.isfile(cmake_file):
|
||||
logger.error(f'Failed to locate cmake file {cmake_file}')
|
||||
return 1
|
||||
|
||||
# on a line by basis, remove any line with Gem::{gem_name}
|
||||
t_data = []
|
||||
# Remove the gem from the cmake_dependencies file by skipping the gem name entry
|
||||
removed = False
|
||||
with open(cmake_file, 'r') as s:
|
||||
for line in s:
|
||||
if f'add_subdirectory({gem_name})' in line:
|
||||
removed = True
|
||||
else:
|
||||
t_data.append(line)
|
||||
|
||||
if not removed:
|
||||
logger.error(f'Failed to remove add_subdirectory({gem_name}) from {cmake_file}')
|
||||
return 1
|
||||
|
||||
# write the cmake
|
||||
os.unlink(cmake_file)
|
||||
with open(cmake_file, 'w') as s:
|
||||
s.writelines(t_data)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def get_dependencies_cmake(project_path: str,
|
||||
dependency_type: str = 'runtime',
|
||||
platform: str = 'Common') -> str:
|
||||
if not project_path:
|
||||
return ''
|
||||
if platform == 'Common':
|
||||
dependencies_file = f'{dependency_type}_dependencies.cmake'
|
||||
gem_path = os.path.join(project_path, 'Gem', 'Code', dependencies_file)
|
||||
if os.path.isfile(gem_path):
|
||||
return gem_path
|
||||
return os.path.join(project_path, 'Code', dependencies_file)
|
||||
else:
|
||||
dependencies_file = f'{platform.lower()}_{dependency_type}_dependencies.cmake'
|
||||
gem_path = os.path.join(project_path, 'Gem', 'Code', 'Platform', platform, dependencies_file)
|
||||
if os.path.isfile(gem_path):
|
||||
return gem_path
|
||||
return os.path.join(project_path, 'Code', 'Platform', platform, dependencies_file)
|
||||
|
||||
# this function is making some not so good assumptions about gem naming
|
||||
def find_all_gems(gem_folder_list: list) -> list:
|
||||
"""
|
||||
Find all Modules which appear to be gems living within a list of folders
|
||||
This method can be replaced or improved on with something more deterministic when LYN-1942 is done
|
||||
:param gem_folder_list:
|
||||
:return: list of gem objects containing gem Name and Path
|
||||
"""
|
||||
module_gems = {}
|
||||
for folder in gem_folder_list:
|
||||
root_len = len(os.path.normpath(folder).split(os.sep))
|
||||
for root, dirs, files in os.walk(folder):
|
||||
for file in files:
|
||||
if file == 'CMakeLists.txt':
|
||||
with open(os.path.join(root, file), 'r') as s:
|
||||
for line in s:
|
||||
trimmed = line.lstrip()
|
||||
if trimmed.startswith('NAME '):
|
||||
trimmed = trimmed.rstrip(' \n')
|
||||
split_trimmed = trimmed.split(' ')
|
||||
# Is this a type indicating a gem lives here
|
||||
if len(split_trimmed) == 3 and split_trimmed[2] in ['MODULE', 'GEM_MODULE',
|
||||
'${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}']:
|
||||
# Hold our "Name parts" such as Gem.MyGem.Editor as ['Gem', 'MyGem', 'Editor']
|
||||
name_split = split_trimmed[1].split('.')
|
||||
split_folders = os.path.normpath(root).split(os.sep)
|
||||
# This verifies we were passed a folder lower in the folder structure than the
|
||||
# gem we've found, so we'll name it by the first directory. This is the common
|
||||
# case currently of being handed "Gems" where things that live under Gems are
|
||||
# known by the directory name
|
||||
if len(split_folders) > root_len:
|
||||
# Assume the gem is named by the root folder. May modules may exist
|
||||
# together within the gem that are added collectively
|
||||
gem_name = split_folders[root_len]
|
||||
else:
|
||||
# We were passed the folder with the gem already inside it, we have to name
|
||||
# it by the gem name we found
|
||||
gem_name = name_split[0]
|
||||
this_gem = module_gems.get(gem_name, None)
|
||||
if not this_gem:
|
||||
if len(split_folders) > root_len:
|
||||
# Assume the gem is named by the root folder. May modules may exist
|
||||
# together within the gem that are added collectively
|
||||
this_gem = {'Name': gem_name,
|
||||
'Path': os.path.join(folder, split_folders[root_len])}
|
||||
else:
|
||||
this_gem = {'Name': gem_name, 'Path': folder}
|
||||
# Add any module types we know to be tools only here
|
||||
if len(name_split) > 1 and name_split[1] in ['Editor', 'Builder']:
|
||||
this_gem['Tools'] = True
|
||||
else:
|
||||
this_gem['Runtime'] = True
|
||||
this_gem['Tools'] = True
|
||||
|
||||
module_gems[gem_name] = this_gem
|
||||
break
|
||||
|
||||
return sorted(list(module_gems.values()), key=lambda x: x.get('Name'))
|
||||
|
||||
|
||||
def find_gem_modules(gem_folder: str) -> list:
|
||||
"""
|
||||
Find all gem modules which appear to be gems living in this folder
|
||||
:param gem_folder: the folder to walk down
|
||||
:return: list of gem targets
|
||||
"""
|
||||
module_identifiers = [
|
||||
'MODULE',
|
||||
'GEM_MODULE',
|
||||
'${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}'
|
||||
]
|
||||
modules = []
|
||||
for root, dirs, files in os.walk(gem_folder):
|
||||
for file in files:
|
||||
if file == 'CMakeLists.txt':
|
||||
with open(os.path.join(root, file), 'r') as s:
|
||||
for line in s:
|
||||
trimmed = line.lstrip()
|
||||
if trimmed.startswith('NAME '):
|
||||
trimmed = trimmed.rstrip(' \n')
|
||||
split_trimmed = trimmed.split(' ')
|
||||
if len(split_trimmed) == 3 and split_trimmed[2] in module_identifiers:
|
||||
modules.append(split_trimmed[1])
|
||||
return modules
|
||||
|
||||
|
||||
def add_remove_gem(add: bool,
|
||||
dev_root: str,
|
||||
gem_path: str,
|
||||
gem_target: str,
|
||||
project_path: str,
|
||||
dependencies_file: str or None,
|
||||
project_restricted_path: str = 'restricted',
|
||||
runtime_dependency: bool = False,
|
||||
tool_dependency: bool = False,
|
||||
server_dependency: bool = False,
|
||||
platforms: str = 'Common',
|
||||
gem_cmake: str = None) -> int:
|
||||
"""
|
||||
add a gem to a project
|
||||
:param add: should we add a gem, if false we remove a gem
|
||||
:param dev_root: the dev root of the engine
|
||||
:param gem_path: path to the gem to add
|
||||
:param gem_target: the name of teh cmake gem module
|
||||
:param project_path: path to the project to add the gem to
|
||||
:param dependencies_file: if this dependency goes/is in a specific file
|
||||
:param project_restricted_path: path to the projects restricted folder
|
||||
:param runtime_dependency: bool to specify this is a runtime gem for the game
|
||||
:param tool_dependency: bool to specify this is a tool gem for the editor
|
||||
:param server_dependency: bool to specify this is a server gem for the server
|
||||
:param platforms: str to specify common or which specific platforms
|
||||
:param gem_cmake: str to specify that this gem should be removed from the Gems/CMakeLists.txt
|
||||
:return: 0 for success or non 0 failure code
|
||||
"""
|
||||
|
||||
# if no dev root error
|
||||
if not dev_root:
|
||||
logger.error('Dev root cannot be empty.')
|
||||
return 1
|
||||
if not os.path.isabs(dev_root):
|
||||
dev_root = os.path.abspath(dev_root)
|
||||
dev_root = pathlib.Path(dev_root)
|
||||
if not dev_root.is_dir():
|
||||
logger.error(f'Dev root {dev_root} is not a folder.')
|
||||
return 1
|
||||
|
||||
# if no project path error
|
||||
if not project_path:
|
||||
logger.error('Project path cannot be empty.')
|
||||
return 1
|
||||
if not os.path.isabs(project_path):
|
||||
project_path = f'{dev_root}/{project_path}'
|
||||
project_path = pathlib.Path(project_path)
|
||||
if not project_path.is_dir():
|
||||
logger.error(f'Project path {project_path} is not a folder.')
|
||||
return 1
|
||||
|
||||
project_restricted_path = project_restricted_path.replace('\\', '/')
|
||||
if not os.path.isabs(project_restricted_path):
|
||||
project_restricted_path = f'{dev_root}/{project_restricted_path}'
|
||||
project_restricted_path = pathlib.Path(project_restricted_path)
|
||||
if not project_restricted_path.is_dir():
|
||||
logger.error(f'Project Restricted path {project_restricted_path} is not a folder.')
|
||||
return 1
|
||||
|
||||
# if no gem path error
|
||||
if not gem_path:
|
||||
logger.error('Gem path cannot be empty.')
|
||||
return 1
|
||||
if not os.path.isabs(gem_path):
|
||||
gem_path = f'{dev_root}/Gems/{gem_path}'
|
||||
gem_path = pathlib.Path(gem_path)
|
||||
# make sure this gem already exists if we're adding. We can always remove a gem.
|
||||
if add and not gem_path.is_dir():
|
||||
logger.error(f'{gem_path} dir does not exist.')
|
||||
return 1
|
||||
|
||||
# find all available modules in this gem_path
|
||||
modules = find_gem_modules(gem_path)
|
||||
if len(modules) == 0:
|
||||
logger.error(f'No gem modules found.')
|
||||
return 1
|
||||
|
||||
# if gem target not specified, see if there is only 1 module
|
||||
if not gem_target:
|
||||
if len(modules) == 1:
|
||||
gem_target = modules[0]
|
||||
else:
|
||||
logger.error(f'Gem target not specified: {modules}')
|
||||
return 1
|
||||
elif gem_target not in modules:
|
||||
logger.error(f'Gem target not in gem modules: {modules}')
|
||||
return 1
|
||||
|
||||
# gem cmake list text file is assumed to be in the parent folder is not specified
|
||||
if add or isinstance(gem_cmake, str):
|
||||
if not gem_cmake:
|
||||
gem_cmake = gem_path.parent / 'CMakeLists.txt'
|
||||
if not os.path.isabs(gem_cmake):
|
||||
gem_cmake = f'{dev_root}/{gem_cmake}'
|
||||
gem_cmake = pathlib.Path(gem_cmake)
|
||||
if not gem_cmake.is_file():
|
||||
logger.error(f'CMakeLists.txt file {gem_cmake} does not exist.')
|
||||
return 1
|
||||
|
||||
# if the user has not specified either we will assume they meant the most common which is runtime
|
||||
if not runtime_dependency and not tool_dependency and not server_dependency and not dependencies_file:
|
||||
logger.warning("Dependency type not specified: Assuming '--runtime-dependency'")
|
||||
runtime_dependency = True
|
||||
|
||||
ret_val = 0
|
||||
|
||||
# if the user has specified the dependencies file then ignore the runtime_dependency and tool_dependency flags
|
||||
if dependencies_file:
|
||||
dependencies_file = pathlib.Path(dependencies_file)
|
||||
# make sure this is a project has a dependencies_file
|
||||
if not dependencies_file.is_file():
|
||||
logger.error(f'Dependencies file {dependencies_file} is not present.')
|
||||
return 1
|
||||
if add:
|
||||
# add the dependency
|
||||
ret_val = add_gem_dependency(dependencies_file, gem_target)
|
||||
else:
|
||||
# remove the dependency
|
||||
ret_val = remove_gem_dependency(dependencies_file, gem_target)
|
||||
else:
|
||||
if ',' in platforms:
|
||||
platforms = platforms.split(',')
|
||||
else:
|
||||
platforms = [platforms]
|
||||
for platform in platforms:
|
||||
if runtime_dependency:
|
||||
# make sure this is a project has a runtime_dependencies.cmake file
|
||||
project_runtime_dependencies_file = pathlib.Path(get_dependencies_cmake(project_path, 'runtime', platform))
|
||||
if not project_runtime_dependencies_file.is_file():
|
||||
logger.error(f'Runtime dependencies file {project_runtime_dependencies_file} is not present.')
|
||||
return 1
|
||||
|
||||
if add:
|
||||
# add the dependency
|
||||
ret_val = add_gem_dependency(project_runtime_dependencies_file, gem_target)
|
||||
else:
|
||||
# remove the dependency
|
||||
ret_val = remove_gem_dependency(project_runtime_dependencies_file, gem_target)
|
||||
|
||||
if (ret_val == 0 or not add) and tool_dependency:
|
||||
# make sure this is a project has a tool_dependencies.cmake file
|
||||
project_tool_dependencies_file = pathlib.Path(get_dependencies_cmake(project_path, 'tool', platform))
|
||||
if not project_tool_dependencies_file.is_file():
|
||||
logger.error(f'Tool dependencies file {project_tool_dependencies_file} is not present.')
|
||||
return 1
|
||||
|
||||
if add:
|
||||
# add the dependency
|
||||
ret_val = add_gem_dependency(project_tool_dependencies_file, gem_target)
|
||||
else:
|
||||
# remove the dependency
|
||||
ret_val = remove_gem_dependency(project_tool_dependencies_file, gem_target)
|
||||
|
||||
if (ret_val == 0 or not add) and server_dependency:
|
||||
# make sure this is a project has a tool_dependencies.cmake file
|
||||
project_server_dependencies_file = pathlib.Path(get_dependencies_cmake(project_path, 'server', platform))
|
||||
if not project_server_dependencies_file.is_file():
|
||||
logger.error(f'Server dependencies file {project_server_dependencies_file} is not present.')
|
||||
return 1
|
||||
|
||||
if add:
|
||||
# add the dependency
|
||||
ret_val = add_gem_dependency(project_server_dependencies_file, gem_target)
|
||||
else:
|
||||
# remove the dependency
|
||||
ret_val = remove_gem_dependency(project_server_dependencies_file, gem_target)
|
||||
|
||||
if add:
|
||||
# add the gem subdir to the CMakeList.txt
|
||||
ret_val = add_gem_subdir(gem_cmake, gem_path.name)
|
||||
elif gem_cmake:
|
||||
# remove the gem subdir from the CMakeList.txt
|
||||
ret_val = remove_gem_subdir(gem_cmake, gem_path.name)
|
||||
|
||||
return ret_val
|
||||
|
||||
|
||||
def _run_add_gem(args: argparse) -> int:
|
||||
return add_remove_gem(True,
|
||||
common.determine_engine_root(),
|
||||
args.gem_path,
|
||||
args.gem_target,
|
||||
args.project_path,
|
||||
args.dependencies_file,
|
||||
args.project_restricted_path,
|
||||
args.runtime_dependency,
|
||||
args.tool_dependency,
|
||||
args.server_dependency,
|
||||
args.platforms,
|
||||
args.add_to_cmake)
|
||||
|
||||
|
||||
def _run_remove_gem(args: argparse) -> int:
|
||||
return add_remove_gem(False,
|
||||
common.determine_engine_root(),
|
||||
args.gem_path,
|
||||
args.gem_target,
|
||||
args.project_path,
|
||||
args.dependencies_file,
|
||||
args.project_restricted_path,
|
||||
args.runtime_dependency,
|
||||
args.tool_dependency,
|
||||
args.server_dependency,
|
||||
args.platforms,
|
||||
args.remove_from_cmake)
|
||||
|
||||
|
||||
def add_args(parser, subparsers) -> None:
|
||||
"""
|
||||
add_args is called to add expected parser arguments and subparsers arguments to each command such that it can be
|
||||
invoked locally or aggregated by a central python file.
|
||||
Ex. Directly run from this file alone with: python add_remove_gem.py add_gem --gem TestGem --project TestProject
|
||||
OR
|
||||
lmbr.py can aggregate commands by importing add_remove_gem, call add_args and
|
||||
execute: python lmbr.py add_gem --gem TestGem --project TestProject
|
||||
:param parser: the caller instantiates a parser and passes it in here
|
||||
:param subparsers: the caller instantiates subparsers and passes it in here
|
||||
"""
|
||||
add_gem_subparser = subparsers.add_parser('add-gem')
|
||||
add_gem_subparser.add_argument('-pp', '--project-path', type=str, required=True,
|
||||
help='The path to the project, can be absolute or dev root relative')
|
||||
add_gem_subparser.add_argument('-prp', '--project-restricted-path', type=str, required=False,
|
||||
default='restricted',
|
||||
help='The path to the projects restricted folder, can be absolute or dev root'
|
||||
' relative')
|
||||
add_gem_subparser.add_argument('-gp', '--gem-path', type=str, required=True,
|
||||
help='The path to the gem, can be absolute or dev root/Gems relative')
|
||||
add_gem_subparser.add_argument('-gt', '--gem-target', type=str, required=False,
|
||||
help='The cmake target name to add. If not specified it will assume gem_name')
|
||||
add_gem_subparser.add_argument('-df', '--dependencies-file', type=str, required=False,
|
||||
help='The cmake dependencies file in which the gem dependencies are specified.'
|
||||
'If not specified it will assume ')
|
||||
add_gem_subparser.add_argument('-rd', '--runtime-dependency', action='store_true', required=False,
|
||||
default=False,
|
||||
help='Optional toggle if this gem should be added as a runtime dependency')
|
||||
add_gem_subparser.add_argument('-td', '--tool-dependency', action='store_true', required=False,
|
||||
default=False,
|
||||
help='Optional toggle if this gem should be added as a tool dependency')
|
||||
add_gem_subparser.add_argument('-sd', '--server-dependency', action='store_true', required=False,
|
||||
default=False,
|
||||
help='Optional toggle if this gem should be added as a server dependency')
|
||||
add_gem_subparser.add_argument('-pl', '--platforms', type=str, required=False,
|
||||
default='Common',
|
||||
help='Optional list of platforms this gem should be added to.'
|
||||
' Ex. --platforms Mac,Windows,Linux')
|
||||
add_gem_subparser.add_argument('-a', '--add-to-cmake', type=str, required=False,
|
||||
default=None,
|
||||
help='Add the gem folder to the CMakeLists.txt so that it builds. If not'
|
||||
' specified it will assume the CMakeLists.txt file in the parent folder of'
|
||||
' the gem_path.')
|
||||
add_gem_subparser.set_defaults(func=_run_add_gem)
|
||||
|
||||
remove_gem_subparser = subparsers.add_parser('remove-gem')
|
||||
remove_gem_subparser.add_argument('-pp', '--project-path', type=str, required=True,
|
||||
help='The path to the project, can be absolute or dev root relative')
|
||||
remove_gem_subparser.add_argument('-prp', '--project-restricted-path', type=str, required=False,
|
||||
default='restricted',
|
||||
help='The path to the projects restricted folder, can be absolute or dev root'
|
||||
' relative')
|
||||
remove_gem_subparser.add_argument('-gp', '--gem-path', type=str, required=True,
|
||||
help='The path to the gem, can be absolute or dev root/Gems relative')
|
||||
remove_gem_subparser.add_argument('-gt', '--gem-target', type=str, required=False,
|
||||
help='The cmake target name to add. If not specified it will assume gem_name')
|
||||
remove_gem_subparser.add_argument('-df', '--dependencies-file', type=str, required=False,
|
||||
help='The cmake dependencies file in which the gem dependencies are specified.'
|
||||
'If not specified it will assume ')
|
||||
remove_gem_subparser.add_argument('-rd', '--runtime-dependency', action='store_true', required=False,
|
||||
default=False,
|
||||
help='Optional toggle if this gem should be removed as a runtime dependency')
|
||||
remove_gem_subparser.add_argument('-td', '--tool-dependency', action='store_true', required=False,
|
||||
default=False,
|
||||
help='Optional toggle if this gem should be removed as a server dependency')
|
||||
remove_gem_subparser.add_argument('-sd', '--server-dependency', action='store_true', required=False,
|
||||
default=False,
|
||||
help='Optional toggle if this gem should be removed as a server dependency')
|
||||
remove_gem_subparser.add_argument('-pl', '--platforms', type=str, required=False,
|
||||
default='Common',
|
||||
help='Optional list of platforms this gem should be removed from'
|
||||
' Ex. --platforms Mac,Windows,Linux')
|
||||
remove_gem_subparser.add_argument('-r', '--remove-from-cmake', type=str, required=False,
|
||||
default=None,
|
||||
help='Remove the gem folder from the CMakeLists.txt that includes it so that it '
|
||||
'no longer builds build. If not specified it will assume you dont want to'
|
||||
' remove it.')
|
||||
remove_gem_subparser.set_defaults(func=_run_remove_gem)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# parse the command line args
|
||||
the_parser = argparse.ArgumentParser()
|
||||
|
||||
# add subparsers
|
||||
the_subparsers = the_parser.add_subparsers(help='sub-command help')
|
||||
|
||||
# add args to the parser
|
||||
add_args(the_parser, the_subparsers)
|
||||
|
||||
# parse args
|
||||
the_args = the_parser.parse_args()
|
||||
|
||||
# run
|
||||
ret = the_args.func(the_args)
|
||||
|
||||
# return
|
||||
sys.exit(ret)
|
||||
@ -1,117 +0,0 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
|
||||
from cmake.Tools import common
|
||||
|
||||
logger = logging.getLogger()
|
||||
logging.basicConfig()
|
||||
|
||||
|
||||
def set_current_project(dev_root: str,
|
||||
project_path: str) -> int:
|
||||
"""
|
||||
set what the current project is
|
||||
:param dev_root: the dev root of the engine
|
||||
:param project_path: the path of the project you want to set
|
||||
:return: 0 for success or non 0 failure code
|
||||
"""
|
||||
project_path = project_path.strip()
|
||||
if not project_path.isalnum():
|
||||
logger.error('Project Name invalid. Set current project failed.')
|
||||
return 1
|
||||
try:
|
||||
with open(os.path.join(dev_root, 'bootstrap.cfg'), 'r') as s:
|
||||
data = s.read()
|
||||
data = re.sub(r'(.*project_path\s*?[=:]\s*?)([^\n]+)\n', r'\1 {}\n'.format(project_path),
|
||||
data, flags=re.IGNORECASE)
|
||||
if os.path.isfile(os.path.join(dev_root, 'bootstrap.cfg')):
|
||||
os.unlink(os.path.join(dev_root, 'bootstrap.cfg'))
|
||||
with open(os.path.join(dev_root, 'bootstrap.cfg'), 'w') as s:
|
||||
s.write(data)
|
||||
except Exception as e:
|
||||
logger.error('Set current project failed.' + str(e))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
def get_current_project(dev_root: str) -> str:
|
||||
"""
|
||||
get what the current project set is
|
||||
:param dev_root: the dev root of the engine
|
||||
:return: project_path or None on failure
|
||||
"""
|
||||
try:
|
||||
with open(os.path.join(dev_root, 'bootstrap.cfg'), 'r') as s:
|
||||
data = s.read()
|
||||
project_path = re.search(r'(.*project_path\s*?[=:]\s*?)(?P<project_path>[^\n]+)\n',
|
||||
data, flags=re.IGNORECASE).group('project_path').strip()
|
||||
except Exception as e:
|
||||
logger.error('Failed to get current project. Exception: ' + str(e))
|
||||
return ''
|
||||
return project_path
|
||||
|
||||
|
||||
def _run_get_current_project(args: argparse) -> int:
|
||||
project_path = get_current_project(common.determine_engine_root())
|
||||
if project_path:
|
||||
print(project_path)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
def _run_set_current_project(args: argparse) -> int:
|
||||
return set_current_project(common.determine_engine_root(), args.project_path)
|
||||
|
||||
|
||||
def add_args(parser, subparsers) -> None:
|
||||
"""
|
||||
add_args is called to add expected parser arguments and subparsers arguments to each command such that it can be
|
||||
invoked locally or aggregated by a central python file.
|
||||
Ex. Directly run from this file alone with: python current_project.py set_current_project --project TestProject
|
||||
OR
|
||||
lmbr.py can aggregate commands by importing current_project, call add_args and
|
||||
execute: python lmbr.py set_current_project --project TestProject
|
||||
:param parser: the caller instantiates a parser and passes it in here
|
||||
:param subparsers: the caller instantiates subparsers and passes it in here
|
||||
"""
|
||||
get_current_project_subparser = subparsers.add_parser('get-current-project')
|
||||
get_current_project_subparser.set_defaults(func=_run_get_current_project)
|
||||
|
||||
set_current_project_subparser = subparsers.add_parser('set-current-project')
|
||||
set_current_project_subparser.add_argument('-pp', '--project-path', required=True,
|
||||
help='The path to the project, can be absolute or dev root relative')
|
||||
set_current_project_subparser.set_defaults(func=_run_set_current_project)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# parse the command line args
|
||||
the_parser = argparse.ArgumentParser()
|
||||
|
||||
# add subparsers
|
||||
the_subparsers = the_parser.add_subparsers(help='sub-command help')
|
||||
|
||||
# add args to the parser
|
||||
add_args(the_parser, the_subparsers)
|
||||
|
||||
# parse args
|
||||
the_args = the_parser.parse_args()
|
||||
|
||||
# run
|
||||
ret = the_args.func(the_args)
|
||||
|
||||
# return
|
||||
sys.exit(ret)
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,168 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import pathlib
|
||||
import json
|
||||
import cmake.Tools.registration as registration
|
||||
|
||||
logger = logging.getLogger()
|
||||
logging.basicConfig()
|
||||
|
||||
|
||||
def set_global_project(project_name: str or None,
|
||||
project_path: str or pathlib.Path or None) -> int:
|
||||
"""
|
||||
set what the current project is
|
||||
:param project_name: the name of the project you want to set, resolves project_path
|
||||
:param project_path: the path of the project you want to set
|
||||
:return: 0 for success or non 0 failure code
|
||||
"""
|
||||
if project_path and project_name:
|
||||
logger.error(f'Project Name and Project Path provided, these are mutually exclusive.')
|
||||
return 1
|
||||
|
||||
if not project_name and not project_path:
|
||||
logger.error('Must specify either a Project name or Project Path.')
|
||||
return 1
|
||||
|
||||
if project_name and not project_path:
|
||||
project_path = registration.get_registered(project_name=project_name)
|
||||
|
||||
if not project_path:
|
||||
logger.error(f'Project Path {project_path} has not been registered.')
|
||||
return 1
|
||||
|
||||
project_path = pathlib.Path(project_path).resolve()
|
||||
|
||||
bootstrap_setreg_file = registration.get_o3de_registry_folder() / 'bootstrap.setreg'
|
||||
if bootstrap_setreg_file.is_file():
|
||||
with bootstrap_setreg_file.open('r') as f:
|
||||
try:
|
||||
json_data = json.load(f)
|
||||
except Exception as e:
|
||||
logger.error(f'Bootstrap.setreg failed to load: {str(e)}')
|
||||
else:
|
||||
try:
|
||||
json_data["Amazon"]["AzCore"]["Bootstrap"]["project_path"] = project_path
|
||||
except Exception as e:
|
||||
logger.error(f'Bootstrap.setreg failed to load: {str(e)}')
|
||||
else:
|
||||
try:
|
||||
os.unlink(bootstrap_setreg_file)
|
||||
except Exception as e:
|
||||
logger.error(f'Failed to unlink bootstrap file {bootstrap_setreg_file}: {str(e)}')
|
||||
return 1
|
||||
else:
|
||||
json_data = {}
|
||||
json_data.update({"Amazon":{"AzCore":{"Bootstrap":{"project_path":project_path.as_posix()}}}})
|
||||
|
||||
with bootstrap_setreg_file.open('w') as s:
|
||||
s.write(json.dumps(json_data, indent=4))
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def get_global_project() -> pathlib.Path or None:
|
||||
"""
|
||||
get what the current project set is
|
||||
:return: project_path or None on failure
|
||||
"""
|
||||
bootstrap_setreg_file = registration.get_o3de_registry_folder() / 'bootstrap.setreg'
|
||||
if not bootstrap_setreg_file.is_file():
|
||||
logger.error(f'Bootstrap.setreg file {bootstrap_setreg_file} does not exist.')
|
||||
return None
|
||||
|
||||
with bootstrap_setreg_file.open('r') as f:
|
||||
try:
|
||||
json_data = json.load(f)
|
||||
except Exception as e:
|
||||
logger.error(f'Bootstrap.setreg failed to load: {str(e)}')
|
||||
else:
|
||||
try:
|
||||
project_path = json_data["Amazon"]["AzCore"]["Bootstrap"]["project_path"]
|
||||
except Exception as e:
|
||||
logger.error(f'Bootstrap.setreg cannot find Amazon:AzCore:Bootstrap:project_path: {str(e)}')
|
||||
else:
|
||||
return pathlib.Path(project_path).resolve()
|
||||
return None
|
||||
|
||||
def _run_get_global_project(args: argparse) -> int:
|
||||
if args.override_home_folder:
|
||||
registration.override_home_folder = args.override_home_folder
|
||||
|
||||
project_path = get_global_project()
|
||||
if project_path:
|
||||
print(project_path.as_posix())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
def _run_set_global_project(args: argparse) -> int:
|
||||
if args.override_home_folder:
|
||||
registration.override_home_folder = args.override_home_folder
|
||||
|
||||
return set_global_project(args.project_name,
|
||||
args.project_path)
|
||||
|
||||
|
||||
def add_args(parser, subparsers) -> None:
|
||||
"""
|
||||
add_args is called to add expected parser arguments and subparsers arguments to each command such that it can be
|
||||
invoked locally or aggregated by a central python file.
|
||||
Ex. Directly run from this file alone with: python global_project.py set_global_project --project-name TestProject
|
||||
OR
|
||||
o3de.py can aggregate commands by importing global_project, call add_args and
|
||||
execute: python o3de.py set_global_project --project-path C:/TestProject
|
||||
:param parser: the caller instantiates a parser and passes it in here
|
||||
:param subparsers: the caller instantiates subparsers and passes it in here
|
||||
"""
|
||||
get_global_project_subparser = subparsers.add_parser('get-global-project')
|
||||
get_global_project_subparser.add_argument('-ohf', '--override-home-folder', type=str, required=False,
|
||||
help='By default the home folder is the user folder, override it to this folder.')
|
||||
|
||||
get_global_project_subparser.set_defaults(func=_run_get_global_project)
|
||||
|
||||
set_global_project_subparser = subparsers.add_parser('set-global-project')
|
||||
group = set_global_project_subparser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument('-pn', '--project-name', required=False,
|
||||
help='The name of the project. If supplied this will resolve the --project-path.')
|
||||
group.add_argument('-pp', '--project-path', required=False,
|
||||
help='The path to the project')
|
||||
|
||||
set_global_project_subparser.add_argument('-ohf', '--override-home-folder', type=str, required=False,
|
||||
help='By default the home folder is the user folder, override it to this folder.')
|
||||
|
||||
set_global_project_subparser.set_defaults(func=_run_set_global_project)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# parse the command line args
|
||||
the_parser = argparse.ArgumentParser()
|
||||
|
||||
# add subparsers
|
||||
the_subparsers = the_parser.add_subparsers(help='sub-command help')
|
||||
|
||||
# add args to the parser
|
||||
add_args(the_parser, the_subparsers)
|
||||
|
||||
# parse args
|
||||
the_args = the_parser.parse_args()
|
||||
|
||||
# run
|
||||
ret = the_args.func(the_args)
|
||||
|
||||
# return
|
||||
sys.exit(ret)
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,986 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
# Set the user home directory
|
||||
set(O3DE_HOME_PATH "" CACHE PATH "Override the user home to this path")
|
||||
if(O3DE_HOME_PATH)
|
||||
set(home_directory ${O3DE_HOME_PATH})
|
||||
elseif(CMAKE_HOST_WIN32)
|
||||
file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory)
|
||||
else()
|
||||
file(TO_CMAKE_PATH "$ENV{HOME}" home_directory)
|
||||
endif()
|
||||
if (NOT home_directory)
|
||||
message(FATAL_ERROR "Cannot find user home directory, without the user home directory the o3de manifest cannot be found")
|
||||
endif()
|
||||
|
||||
# Optionally delete the home directory
|
||||
if(O3DE_DELETE_HOME_PATH)
|
||||
message(STATUS "O3DE_DELETE_HOME_PATH=${O3DE_DELETE_HOME_PATH}")
|
||||
if(EXISTS ${home_directory}/.o3de)
|
||||
message(STATUS "Deleting ${home_directory}/.o3de")
|
||||
file(REMOVE_RECURSE ${home_directory}/.o3de)
|
||||
else()
|
||||
message(STATUS "Home path ${home_directory}/.o3de doesnt exist.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
########################################################################################################################
|
||||
# If O3DE_REGISTER_ENGINE_PATH variable is set on the commandline this will allow registration of anything using
|
||||
# O3DE_REGISTER_ENGINE_PATH o3de script. This is handy for situations like build servers which download the code and
|
||||
# are expected to build without the need for someone to register o3de objects like this engine by manually typing it in.
|
||||
# If O3DE_REGISTER_THIS_ENGINE=TRUE is set on the commandline when O3DE_REGISTER_ENGINE_PATH is also set this will call:
|
||||
# O3DE_REGISTER_ENGINE_PATH/scripts>o3de register --this-engine --override-home-folder <home_directory>
|
||||
# Note: register --this-engine will automatically register anything it finds in known folders, so if you put your
|
||||
# o3de objects like projects/gems/templates/restricted/etc... in known folders for those types they will get registered
|
||||
# automatically. Known folders for types are your .o3de/Projects and .o3de/Gems etc. So if I wanted my project to be
|
||||
# registered and built by this build server I could simply put them in those known folders on the build server and they
|
||||
# would get registered automatically by this call.
|
||||
# OR
|
||||
# I could put them on the commandline as well. This would be the way if the o3de objects we need to regiater are NOT
|
||||
# in known folders or you do not intend to call with O3DE_REGISTER_THIS_ENGINE=TRUE Ex.
|
||||
# -DO3DE_REGISTER_ENGINE_PATH=C:\this\engine
|
||||
# -DO3DE_REGISTER_PROJECT_PATHS=C:\ThisGame;C:\ThatGame
|
||||
# -DO3DE_REGISTER_GEM_PATHS=C:\ThisGem;C:\ThatGem;C:\And\Some\Other\Gem
|
||||
# -DO3DE_REGISTER_RESTRICTED_PATHS=C:\this\engine\Restricted;C:\ThisGame\Restricted;C:\ThisGem\Restricted
|
||||
########################################################################################################################
|
||||
if(O3DE_REGISTER_ENGINE_PATH)
|
||||
message(STATUS "O3DE_REGISTER_ENGINE_PATH=${O3DE_REGISTER_ENGINE_PATH}")
|
||||
|
||||
if(O3DE_REGISTER_THIS_ENGINE)
|
||||
message(STATUS "O3DE_REGISTER_THIS_ENGINE=${O3DE_REGISTER_THIS_ENGINE}")
|
||||
message(STATUS "register --this-engine")
|
||||
if(CMAKE_HOST_WIN32)
|
||||
execute_process(
|
||||
COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --this-engine --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_this_engine_cmd_result
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --this-engine --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_this_engine_cmd_result
|
||||
)
|
||||
endif()
|
||||
if(o3de_register_this_engine_cmd_result)
|
||||
message(FATAL_ERROR "An error occured trying to register --this-engine: ${o3de_register_this_engine_cmd_result}")
|
||||
else()
|
||||
message(STATUS "Engine ${O3DE_REGISTER_ENGINE_PATH} registration successfull.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(O3DE_REGISTER_RESTRICTED_PATHS)
|
||||
message(STATUS "O3DE_REGISTER_RESTRICTED_PATHS=${O3DE_REGISTER_RESTRICTED_PATHS}")
|
||||
foreach(restricted_path ${O3DE_REGISTER_RESTRICTED_PATHS})
|
||||
if(CMAKE_HOST_WIN32)
|
||||
execute_process(
|
||||
COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --restricted-path ${restricted_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_restricted_cmd_result
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --restricted-path ${restricted_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_restricted_cmd_result
|
||||
)
|
||||
endif()
|
||||
if(o3de_register_restricted_cmd_result)
|
||||
message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --restricted-path ${restricted_path} --override-home-folder ${home_directory}: ${o3de_register_restricted_cmd_result}")
|
||||
else()
|
||||
message(STATUS "Restricted ${restricted_path} registration successfull.")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(O3DE_REGISTER_PROJECT_PATHS)
|
||||
message(STATUS "O3DE_REGISTER_PROJECT_PATHS=${O3DE_REGISTER_PROJECT_PATHS}")
|
||||
foreach(project_path ${O3DE_REGISTER_PROJECT_PATHS})
|
||||
if(CMAKE_HOST_WIN32)
|
||||
execute_process(
|
||||
COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --project-path ${project_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_project_cmd_result
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --project-path ${project_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_project_cmd_result
|
||||
)
|
||||
endif()
|
||||
if(o3de_register_project_cmd_result)
|
||||
message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --project-path ${project_path} --override-home-folder ${home_directory}")
|
||||
else()
|
||||
message(STATUS "Project ${project_path} registration successfull.")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(O3DE_REGISTER_GEM_PATHS)
|
||||
message(STATUS "O3DE_REGISTER_GEM_PATHS=${O3DE_REGISTER_GEM_PATHS}")
|
||||
foreach(gem_path ${O3DE_REGISTER_GEM_PATHS})
|
||||
if(CMAKE_HOST_WIN32)
|
||||
execute_process(
|
||||
COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --gem-path ${gem_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_gem_cmd_result
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --gem-path ${gem_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_gem_cmd_result
|
||||
)
|
||||
endif()
|
||||
if(o3de_register_gem_cmd_result)
|
||||
message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --gem-path ${gem_path} --override-home-folder ${home_directory}")
|
||||
else()
|
||||
message(STATUS "Gem ${gem_path} registration successfull.")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(O3DE_REGISTER_TEMPLATE_PATHS)
|
||||
message(STATUS "O3DE_REGISTER_TEMPLATE_PATHS=${O3DE_REGISTER_TEMPLATE_PATHS}")
|
||||
foreach(template_path ${O3DE_REGISTER_TEMPLATE_PATHS})
|
||||
if(CMAKE_HOST_WIN32)
|
||||
execute_process(
|
||||
COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --template-path ${template_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_template_cmd_result
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --template-path ${template_path} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_template_cmd_result
|
||||
)
|
||||
endif()
|
||||
if(o3de_register_template_cmd_result)
|
||||
message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --template-path ${template_path} --override-home-folder ${home_directory}")
|
||||
else()
|
||||
message(STATUS "Template ${template_path} registration successfull.")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(O3DE_REGISTER_REPO_URIS)
|
||||
message(STATUS "O3DE_REGISTER_REPO_URIS=${O3DE_REGISTER_REPO_URIS}")
|
||||
foreach(repo_uri ${O3DE_REGISTER_REPO_URIS})
|
||||
if(CMAKE_HOST_WIN32)
|
||||
execute_process(
|
||||
COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --repo-uri ${repo_uri} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_repo_cmd_result
|
||||
)
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --repo-uri ${repo_uri} --override-home-folder ${home_directory}
|
||||
RESULT_VARIABLE o3de_register_repo_cmd_result
|
||||
)
|
||||
endif()
|
||||
if(o3de_register_repo_cmd_result)
|
||||
message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --repo-uri ${repo_uri} --override-home-folder ${home_directory}")
|
||||
else()
|
||||
message(STATUS "Repo ${repo_uri} registration successfull.")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de manifest
|
||||
################################################################################
|
||||
# Set manifest json path to the <home_directory>/.o3de/o3de_manifest.json
|
||||
set(o3de_manifest_json_path ${home_directory}/.o3de/o3de_manifest.json)
|
||||
if(NOT EXISTS ${o3de_manifest_json_path})
|
||||
message(FATAL_ERROR "${o3de_manifest_json_path} not found. You must o3de register --this-engine.")
|
||||
endif()
|
||||
file(READ ${o3de_manifest_json_path} manifest_json_data)
|
||||
|
||||
################################################################################
|
||||
# o3de manifest name
|
||||
################################################################################
|
||||
string(JSON o3de_manifest_name ERROR_VARIABLE json_error GET ${manifest_json_data} o3de_manifest_name)
|
||||
message(STATUS "o3de_manifest_name: ${o3de_manifest_name}")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read repo_name from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de origin
|
||||
################################################################################
|
||||
string(JSON o3de_origin ERROR_VARIABLE json_error GET ${manifest_json_data} origin)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read origin from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de default engines folder
|
||||
################################################################################
|
||||
string(JSON o3de_default_engines_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_engines_folder)
|
||||
message(STATUS "default_engines_folder: ${o3de_default_engines_folder}")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read default_engines_folder from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de default projects folder
|
||||
################################################################################
|
||||
string(JSON o3de_default_projects_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_projects_folder)
|
||||
message(STATUS "default_projects_folder: ${o3de_default_projects_folder}")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read default_projects_folder from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de default gems folder
|
||||
################################################################################
|
||||
string(JSON o3de_default_gems_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_gems_folder)
|
||||
message(STATUS "default_gems_folder: ${o3de_default_gems_folder}")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read default_gems_folder from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de default templates folder
|
||||
################################################################################
|
||||
string(JSON o3de_default_templates_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_templates_folder)
|
||||
message(STATUS "default_templates_folder: ${o3de_default_templates_folder}")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read default_templates_folder from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de default restricted folder
|
||||
################################################################################
|
||||
string(JSON o3de_default_restricted_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_restricted_folder)
|
||||
message(STATUS "default_restricted_folder: ${o3de_default_restricted_folder}")
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read default_restricted_folder from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de projects
|
||||
################################################################################
|
||||
string(JSON o3de_projects_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} projects)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'projects' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_projects_count} GREATER 0)
|
||||
math(EXPR o3de_projects_count "${o3de_projects_count}-1")
|
||||
foreach(projects_index RANGE ${o3de_projects_count})
|
||||
string(JSON projects_path ERROR_VARIABLE json_error GET ${manifest_json_data} projects ${projects_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read projects[${projects_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_projects ${projects_path})
|
||||
list(APPEND o3de_global_projects ${projects_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de gems
|
||||
################################################################################
|
||||
string(JSON o3de_gems_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} gems)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'gems' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_gems_count} GREATER 0)
|
||||
math(EXPR o3de_gems_count "${o3de_gems_count}-1")
|
||||
foreach(gems_index RANGE ${o3de_gems_count})
|
||||
string(JSON gems_path ERROR_VARIABLE json_error GET ${manifest_json_data} gems ${gems_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read gems[${gems_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_gems ${gems_path})
|
||||
list(APPEND o3de_global_gems ${gems_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de templates
|
||||
################################################################################
|
||||
string(JSON o3de_templates_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} templates)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'templates' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_templates_count} GREATER 0)
|
||||
math(EXPR o3de_templates_count "${o3de_templates_count}-1")
|
||||
foreach(templates_index RANGE ${o3de_templates_count})
|
||||
string(JSON templates_path ERROR_VARIABLE json_error GET ${manifest_json_data} templates ${templates_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read templates[${templates_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_templates ${templates_path})
|
||||
list(APPEND o3de_global_templates ${templates_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de repos
|
||||
################################################################################
|
||||
string(JSON o3de_repos_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} repos)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'repos' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_repos_count} GREATER 0)
|
||||
math(EXPR o3de_repos_count "${o3de_repos_count}-1")
|
||||
foreach(repos_index RANGE ${o3de_repos_count})
|
||||
string(JSON repo_uri ERROR_VARIABLE json_error GET ${manifest_json_data} repos ${repos_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read repos[${repos_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_repos ${repo_uri})
|
||||
list(APPEND o3de_global_repos ${repo_uri})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de restricted
|
||||
################################################################################
|
||||
string(JSON o3de_restricted_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} restricted)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'restricted' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_restricted_count} GREATER 0)
|
||||
math(EXPR o3de_restricted_count "${o3de_restricted_count}-1")
|
||||
foreach(restricted_index RANGE ${o3de_restricted_count})
|
||||
string(JSON restricted_path ERROR_VARIABLE json_error GET ${manifest_json_data} restricted ${restricted_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read restricted[${restricted_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_restricted ${restricted_path})
|
||||
list(APPEND o3de_global_restricted ${restricted_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de engines
|
||||
################################################################################
|
||||
string(JSON o3de_engines_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} engines)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engines' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
if(${o3de_engines_count} GREATER 0)
|
||||
math(EXPR o3de_engines_count "${o3de_engines_count}-1")
|
||||
# Either the engine_path and engine_json are set in which case the user is configuring from the engine
|
||||
# or project_path and project_json are set in which case the user is configuring from the project.
|
||||
# We need to know which engine_path the user is using so if the project_json is set then we need
|
||||
# to read the project_json and disambiguate the engine_path.
|
||||
if(NOT o3de_engine_path)
|
||||
if(NOT o3de_project_json)
|
||||
message(FATAL_ERROR "Neither o3de_engine_path nor o3de_project_json defined. Cannot determine engine!")
|
||||
endif()
|
||||
|
||||
# get the name of the engine this project uses
|
||||
file(READ ${o3de_project_json} project_json_data)
|
||||
string(JSON project_engine_name ERROR_VARIABLE json_error GET ${project_json_data} engine)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read 'engine' from '${o3de_project_json}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
# search each engine in order from the manifest to find the matching engine name
|
||||
foreach(engines_index RANGE ${o3de_engines_count})
|
||||
string(JSON engine_data ERROR_VARIABLE json_error GET ${manifest_json_data} engines ${engines_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engines[${engines_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
# get this engines path
|
||||
string(JSON this_engine_path ERROR_VARIABLE json_error GET ${engine_data} path)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine path from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
# add this engine to the engines list
|
||||
list(APPEND o3de_engines ${this_engine_path})
|
||||
|
||||
# use path to get the engine.json
|
||||
set(this_engine_json ${this_engine_path}/engine.json)
|
||||
|
||||
# read the name of this engine
|
||||
file(READ ${this_engine_json} this_engine_json_data)
|
||||
string(JSON this_engine_name ERROR_VARIABLE json_error GET ${this_engine_json_data} engine_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine_name from '${this_engine_json}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
# see if this engines name is the same as the one this projects should use
|
||||
if(${this_engine_name} STREQUAL ${project_engine_name})
|
||||
message(STATUS "Found engine: '${project_engine_name}' at ${this_engine_path}")
|
||||
set(o3de_engine_path ${this_engine_path})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#we should have an engine_path at this point
|
||||
if(NOT o3de_engine_path)
|
||||
message(FATAL_ERROR "o3de_engine_path not defined. Cannot determine engine!")
|
||||
endif()
|
||||
|
||||
# now that we have an engine_path read in that engines o3de resources
|
||||
if(${o3de_engines_count} GREATER -1)
|
||||
foreach(engines_index RANGE ${o3de_engines_count})
|
||||
string(JSON engine_data ERROR_VARIABLE json_error GET ${manifest_json_data} engines ${engines_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engines[${engines_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
# get this engines path
|
||||
string(JSON this_engine_path ERROR_VARIABLE json_error GET ${engine_data} path)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine path from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
if(${o3de_engine_path} STREQUAL ${this_engine_path})
|
||||
################################################################################
|
||||
# o3de engine projects
|
||||
################################################################################
|
||||
string(JSON o3de_engine_projects_count ERROR_VARIABLE json_error LENGTH ${engine_data} projects)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'projects' from '${engine_data}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_engine_projects_count} GREATER 0)
|
||||
math(EXPR o3de_engine_projects_count "${o3de_engine_projects_count}-1")
|
||||
foreach(engine_projects_index RANGE ${o3de_engine_projects_count})
|
||||
string(JSON engine_projects_path ERROR_VARIABLE json_error GET ${engine_data} projects ${engine_projects_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine projects[${projects_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_projects ${engine_projects_path})
|
||||
list(APPEND o3de_engine_projects ${engine_projects_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de engine gems
|
||||
################################################################################
|
||||
string(JSON o3de_engine_gems_count ERROR_VARIABLE json_error LENGTH ${engine_data} gems)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'gems' from '${engine_data}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_engine_gems_count} GREATER 0)
|
||||
math(EXPR o3de_engine_gems_count "${o3de_engine_gems_count}-1")
|
||||
foreach(engine_gems_index RANGE ${o3de_engine_gems_count})
|
||||
string(JSON engine_gems_path ERROR_VARIABLE json_error GET ${engine_data} gems ${engine_gems_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine gems[${gems_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_gems ${engine_gems_path})
|
||||
list(APPEND o3de_engine_gems ${engine_gems_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de engine templates
|
||||
################################################################################
|
||||
string(JSON o3de_engine_templates_count ERROR_VARIABLE json_error LENGTH ${engine_data} templates)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'templates' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_engine_gems_count} GREATER 0)
|
||||
math(EXPR o3de_engine_templates_count "${o3de_engine_templates_count}-1")
|
||||
foreach(engine_templates_index RANGE ${o3de_engine_templates_count})
|
||||
string(JSON engine_templates_path ERROR_VARIABLE json_error GET ${engine_data} templates ${engine_templates_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine templates[${templates_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_templates ${engine_templates_path})
|
||||
list(APPEND o3de_engine_templates ${engine_templates_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de engine restricted
|
||||
################################################################################
|
||||
string(JSON o3de_engine_restricted_count ERROR_VARIABLE json_error LENGTH ${engine_data} restricted)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'restricted' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_engine_restricted_count} GREATER 0)
|
||||
math(EXPR o3de_engine_restricted_count "${o3de_engine_restricted_count}-1")
|
||||
foreach(engine_restricted_index RANGE ${o3de_engine_restricted_count})
|
||||
string(JSON engine_restricted_path ERROR_VARIABLE json_error GET ${engine_data} restricted ${engine_restricted_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine restricted[${engine_restricted_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_restricted ${engine_restricted_path})
|
||||
list(APPEND o3de_engine_restricted ${engine_restricted_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# o3de engine external_subdirectories
|
||||
################################################################################
|
||||
string(JSON o3de_external_subdirectories_count ERROR_VARIABLE json_error LENGTH ${engine_data} external_subdirectories)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'external_subdirectories' from '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
if(${o3de_external_subdirectories_count} GREATER 0)
|
||||
math(EXPR o3de_external_subdirectories_count "${o3de_external_subdirectories_count}-1")
|
||||
foreach(external_subdirectories_index RANGE ${o3de_external_subdirectories_count})
|
||||
string(JSON external_subdirectories_path ERROR_VARIABLE json_error GET ${engine_data} external_subdirectories ${external_subdirectories_index})
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine external_subdirectories[${gems_index}] '${o3de_manifest_json_path}', error: ${json_error}")
|
||||
endif()
|
||||
list(APPEND o3de_engine_external_subdirectories ${external_subdirectories_path})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
break()
|
||||
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_engine_id:
|
||||
#
|
||||
# \arg:engine returns the engine association element from an o3de json
|
||||
# \arg:o3de_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_engine_id o3de_json_file engine)
|
||||
file(READ ${o3de_json_file} json_data)
|
||||
string(JSON engine_entry ERROR_VARIABLE json_error GET ${json_data} engine)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read engine from '${o3de_json_file}', error: ${json_error}")
|
||||
message(WARNING "Setting engine to engine default 'o3de'")
|
||||
set(engine_entry "o3de")
|
||||
endif()
|
||||
if(engine_entry)
|
||||
set(${engine} ${engine_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_project_id:
|
||||
#
|
||||
# \arg:project returns the project association element from an o3de json
|
||||
# \arg:o3de_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_project_id o3de_json_file project)
|
||||
file(READ ${o3de_json_file} json_data)
|
||||
string(JSON project_entry ERROR_VARIABLE json_error GET ${json_data} project)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read project from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(project_entry)
|
||||
set(${project} ${project_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_gem_id:
|
||||
#
|
||||
# \arg:gem returns the gem association element from an o3de json
|
||||
# \arg:o3de_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_gem_id o3de_json_file gem)
|
||||
file(READ ${o3de_json_file} json_data)
|
||||
string(JSON gem_entry ERROR_VARIABLE json_error GET ${json_data} gem)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read gem from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(gem_entry)
|
||||
set(${gem} ${gem_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_template_id:
|
||||
#
|
||||
# \arg:template returns the template association element from an o3de json
|
||||
# \arg:o3de_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_template_id o3de_json_file template)
|
||||
file(READ ${o3de_json_file} json_data)
|
||||
string(JSON template_entry ERROR_VARIABLE json_error GET ${json_data} template)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read template from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(template_entry)
|
||||
set(${template} ${template_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_repo_id:
|
||||
#
|
||||
# \arg:repo returns the repo association element from an o3de json
|
||||
# \arg:o3de_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_repo_id o3de_json_file repo)
|
||||
file(READ ${o3de_json_file} json_data)
|
||||
string(JSON repo_entry ERROR_VARIABLE json_error GET ${json_data} repo)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read repo from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(repo_entry)
|
||||
set(${repo} ${repo_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_restricted_id:
|
||||
#
|
||||
# \arg:restricted returns the restricted association element from an o3de json, otherwise engine 'o3de' is assumed
|
||||
# \arg:o3de_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_restricted_id o3de_json_file restricted)
|
||||
file(READ ${o3de_json_file} json_data)
|
||||
string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} restricted)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read restricted from '${o3de_json_file}', error: ${json_error}")
|
||||
message(WARNING "Setting restricted to engine default 'o3de'")
|
||||
set(restricted_entry "o3de")
|
||||
endif()
|
||||
if(restricted_entry)
|
||||
set(${restricted} ${restricted_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_find_engine_folder:
|
||||
#
|
||||
# \arg:engine_path returns the path of the o3de engine folder with name engine_name
|
||||
# \arg:engine_name name of the engine
|
||||
################################################################################
|
||||
function(o3de_find_engine_folder engine_name engine_path)
|
||||
foreach(engine_entry ${o3de_engines})
|
||||
set(engine_json_file ${engine_entry}/engine.json)
|
||||
file(READ ${engine_json_file} engine_json)
|
||||
string(JSON this_engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read engine_name from '${engine_json_file}', error: ${json_error}")
|
||||
else()
|
||||
if(this_engine_name STREQUAL engine_name)
|
||||
set(${engine_path} ${engine_entry} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
message(FATAL_ERROR "Unable to find repo_name: '${engine_name}'")
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_find_project_folder:
|
||||
#
|
||||
# \arg:project_path returns the path of the o3de project folder with name project_name
|
||||
# \arg:project_name name of the project
|
||||
################################################################################
|
||||
function(o3de_find_project_folder project_name project_path)
|
||||
foreach(project_entry ${o3de_projects})
|
||||
set(project_json_file ${project_entry}/project.json)
|
||||
file(READ ${project_json_file} project_json)
|
||||
string(JSON this_project_name ERROR_VARIABLE json_error GET ${project_json} project_name)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read project_name from '${project_json_file}', error: ${json_error}")
|
||||
else()
|
||||
if(this_project_name STREQUAL project_name)
|
||||
set(${project_path} ${project_entry} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
message(FATAL_ERROR "Unable to find project_name: '${project_name}'")
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_find_gem_folder:
|
||||
#
|
||||
# \arg:gem_path returns the path of the o3de gem folder with name gem_name
|
||||
# \arg:gem_name name of the gem
|
||||
################################################################################
|
||||
function(o3de_find_gem_folder gem_name gem_path)
|
||||
foreach(gem_entry ${o3de_gems})
|
||||
set(gem_json_file ${gem_entry}/gem.json)
|
||||
file(READ ${gem_json_file} gem_json)
|
||||
string(JSON this_gem_name ERROR_VARIABLE json_error GET ${gem_json} gem_name)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read gem_name from '${gem_json_file}', error: ${json_error}")
|
||||
else()
|
||||
if(this_gem_name STREQUAL gem_name)
|
||||
set(${gem_path} ${gem_entry} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
message(FATAL_ERROR "Unable to find gem_name: '${gem_name}'")
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_find_template_folder:
|
||||
#
|
||||
# \arg:template_path returns the path of the o3de template folder with name template_name
|
||||
# \arg:template_name name of the template
|
||||
################################################################################
|
||||
function(o3de_find_template_folder template_name template_path)
|
||||
foreach(template_entry ${o3de_templates})
|
||||
set(template_json_file ${template_entry}/template.json)
|
||||
file(READ ${template_json_file} template_json)
|
||||
string(JSON this_template_name ERROR_VARIABLE json_error GET ${template_json} template_name)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read template_name from '${template_json_file}', error: ${json_error}")
|
||||
else()
|
||||
if(this_template_name STREQUAL template_name)
|
||||
set(${template_path} ${template_entry} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
message(FATAL_ERROR "Unable to find template_name: '${template_name}'")
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_find_repo_folder:
|
||||
#
|
||||
# \arg:repo_path returns the path of the o3de repo folder with name repo_name
|
||||
# \arg:repo_name name of the repo
|
||||
################################################################################
|
||||
function(o3de_find_repo_folder repo_name repo_path)
|
||||
foreach(repo_entry ${o3de_repos})
|
||||
set(repo_json_file ${repo_entry}/repo.json)
|
||||
file(READ ${repo_json_file} repo_json)
|
||||
string(JSON this_repo_name ERROR_VARIABLE json_error GET ${repo_json} repo_name)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read repo_name from '${repo_json_file}', error: ${json_error}")
|
||||
else()
|
||||
if(this_repo_name STREQUAL repo_name)
|
||||
set(${repo_path} ${repo_entry} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
message(FATAL_ERROR "Unable to find repo_name: '${repo_name}'")
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_find_restricted_folder:
|
||||
#
|
||||
# \arg:restricted_path returns the path of the o3de restricted folder with name restricted_name
|
||||
# \arg:restricted_name name of the restricted
|
||||
################################################################################
|
||||
function(o3de_find_restricted_folder restricted_name restricted_path)
|
||||
foreach(restricted_entry ${o3de_restricted})
|
||||
set(restricted_json_file ${restricted_entry}/restricted.json)
|
||||
file(READ ${restricted_json_file} restricted_json)
|
||||
string(JSON this_restricted_name ERROR_VARIABLE json_error GET ${restricted_json} restricted_name)
|
||||
if(json_error)
|
||||
message(WARNING "Unable to read restricted_name from '${restricted_json_file}', error: ${json_error}")
|
||||
else()
|
||||
if(this_restricted_name STREQUAL restricted_name)
|
||||
set(${restricted_path} ${restricted_entry} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
message(FATAL_ERROR "Unable to find restricted_name: '${restricted_name}'")
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_engine_name:
|
||||
#
|
||||
# \arg:engine returns the engine_name element from an engine.json
|
||||
# \arg:o3de_engine_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_engine_name o3de_engine_json_file engine)
|
||||
file(READ ${o3de_engine_json_file} json_data)
|
||||
string(JSON engine_entry ERROR_VARIABLE json_error GET ${json_data} engine_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read engine_name from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(engine_entry)
|
||||
set(${engine} ${engine_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_project_name:
|
||||
#
|
||||
# \arg:project returns the project_name element from an project.json
|
||||
# \arg:o3de_project_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_project_name o3de_project_json_file project)
|
||||
file(READ ${o3de_project_json_file} json_data)
|
||||
string(JSON project_entry ERROR_VARIABLE json_error GET ${json_data} project_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read project_name from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(project_entry)
|
||||
set(${project} ${project_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_gem_name:
|
||||
#
|
||||
# \arg:gem returns the gem_name element from an gem.json
|
||||
# \arg:o3de_gem_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_gem_name o3de_gem_json_file gem)
|
||||
file(READ ${o3de_gem_json_file} json_data)
|
||||
string(JSON gem_entry ERROR_VARIABLE json_error GET ${json_data} gem_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read gem_name from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(gem_entry)
|
||||
set(${gem} ${gem_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_template_name:
|
||||
#
|
||||
# \arg:template returns the template_name element from an template json
|
||||
# \arg:o3de_template_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_template_name o3de_template_json_file template)
|
||||
file(READ ${o3de_template_json_file} json_data)
|
||||
string(JSON template_entry ERROR_VARIABLE json_error GET ${json_data} template_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read template_name from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(template_entry)
|
||||
set(${template} ${template_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_repo_name:
|
||||
#
|
||||
# \arg:repo returns the repo_name element from an repo.json or o3de_manifest.json
|
||||
# \arg:o3de_repo_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_repo_name o3de_repo_json_file repo)
|
||||
file(READ ${o3de_repo_json_file} json_data)
|
||||
string(JSON repo_entry ERROR_VARIABLE json_error GET ${json_data} repo_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read repo_name from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(repo_entry)
|
||||
set(${repo} ${repo_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_restricted_name:
|
||||
#
|
||||
# \arg:restricted returns the restricted association element from an o3de json
|
||||
# \arg:o3de_json_file name of the o3de json file
|
||||
################################################################################
|
||||
function(o3de_restricted_name o3de_json_file restricted)
|
||||
file(READ ${o3de_json_file} json_data)
|
||||
string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} restricted_name)
|
||||
if(json_error)
|
||||
message(WARNING "FATAL_ERROR to read restricted_name from '${o3de_json_file}', error: ${json_error}")
|
||||
endif()
|
||||
if(restricted_entry)
|
||||
set(${restricted} ${restricted_entry} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_engine_path:
|
||||
#
|
||||
# \arg:engine_path returns the path of the o3de engine folder with name engine_name
|
||||
# \arg:engine_name name of the engine
|
||||
################################################################################
|
||||
function(o3de_engine_path o3de_json_file engine_path)
|
||||
o3de_engine_id(${o3de_json_file} engine_name)
|
||||
if(engine_name)
|
||||
o3de_find_engine_folder(${engine_name} engine_folder)
|
||||
if(engine_folder)
|
||||
set(${engine_path} ${engine_folder} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_project_path:
|
||||
#
|
||||
# \arg:project_path returns the path of the o3de project folder with name project_name
|
||||
# \arg:project_name name of the project
|
||||
################################################################################
|
||||
function(o3de_project_path o3de_json_file project_path)
|
||||
o3de_project_id(${o3de_json_file} project_name)
|
||||
if(project_name)
|
||||
o3de_find_project_folder(${project_name} project_folder)
|
||||
if(project_folder)
|
||||
set(${project_path} ${project_folder} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_template_path:
|
||||
#
|
||||
# \arg:template_path returns the path of the o3de template folder with name template_name
|
||||
# \arg:template_name name of the template
|
||||
################################################################################
|
||||
function(o3de_template_path o3de_json_file template_path)
|
||||
o3de_template_id(${o3de_json_file} template_name)
|
||||
if(template_name)
|
||||
o3de_find_template_folder(${template_name} template_folder)
|
||||
if(template_folder)
|
||||
set(${template_path} ${template_folder} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_repo_path:
|
||||
#
|
||||
# \arg:repo_path returns the path of the o3de repo folder with name repo_name
|
||||
# \arg:repo_name name of the repo
|
||||
################################################################################
|
||||
function(o3de_repo_path o3de_json_file repo_path)
|
||||
o3de_repo_id(${o3de_json_file} repo_name)
|
||||
if(repo_name)
|
||||
o3de_find_repo_folder(${repo_name} repo_folder)
|
||||
if(repo_folder)
|
||||
set(${repo_path} ${repo_folder} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
################################################################################
|
||||
#! o3de_restricted_path:
|
||||
#
|
||||
# \arg:restricted_path returns the path of the o3de restricted folder with name restricted_name
|
||||
# \arg:restricted_name name of the restricted
|
||||
################################################################################
|
||||
function(o3de_restricted_path o3de_json_file restricted_path)
|
||||
o3de_restricted_id(${o3de_json_file} restricted_name)
|
||||
if(restricted_name)
|
||||
o3de_find_restricted_folder(${restricted_name} restricted_folder)
|
||||
if(restricted_folder)
|
||||
set(${restricted_path} ${restricted_folder} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>createFromTemplateDialog</class>
|
||||
<widget class="QDialog" name="createFromTemplateDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>467</width>
|
||||
<height>288</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create From Template</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="okCancel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>250</y>
|
||||
<width>400</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListView" name="genericTemplates">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>449</width>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Available Templates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>createFromTemplateDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>createFromTemplateDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>createGemDialog</class>
|
||||
<widget class="QDialog" name="createGemDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>467</width>
|
||||
<height>288</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create Gem</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="okCancel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>250</y>
|
||||
<width>400</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListView" name="gemTemplates">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>449</width>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Available Templates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>createGemDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>createGemDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -0,0 +1,407 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>712</width>
|
||||
<height>395</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>O3DE</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Select and manage your projects for O3DE</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="okCancel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>540</x>
|
||||
<y>360</y>
|
||||
<width>161</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="projectListBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>691</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Current project to launch or manage gems for.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>47</width>
|
||||
<height>13</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Project</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="logDisplay">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>220</y>
|
||||
<width>431</width>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="createGroupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>70</y>
|
||||
<width>241</width>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Create</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="createFromTemplateButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>221</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Create a new O3DE object from a pre configured template.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create From Template</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="createProjectButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>221</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Create a new O3DE object from a pre configured template.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create Project</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="createGemButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>11</x>
|
||||
<y>50</y>
|
||||
<width>221</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Create a new O3DE object from a pre configured template.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create Gem</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="createTemplateButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>11</x>
|
||||
<y>80</y>
|
||||
<width>221</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Create a new O3DE object from a pre configured template.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create Template</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="addRemoveGroupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<y>70</y>
|
||||
<width>451</width>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Registration</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="addTemplateButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Template</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="addProjectButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Project</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="addGemButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Gem</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="addRestrictedButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Restricted</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="removeRestrictedButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>110</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove Restricted</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="removeProjectButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>20</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove Project</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="removeGemButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>50</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove Gem</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="removeTemplateButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>80</y>
|
||||
<width>211</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove Template</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="manageProjectGroupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>230</y>
|
||||
<width>241</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Manage Project</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="manageServerGemTargetsButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>221</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Add or remove gems from your selected project. Gems add and remove additional assets and features to projects.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manage Server Gem Targets</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="manageToolGemTargetsButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>221</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Add or remove gems from your selected project. Gems add and remove additional assets and features to projects.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manage Tool Gem Targets</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="manageRuntimeGemTargetsButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>221</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Add or remove gems from your selected project. Gems add and remove additional assets and features to projects.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manage Runtime Gem Targets</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@ -1,167 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>464</width>
|
||||
<height>136</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>O3DE</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Select and manage your projects for O3DE</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="okCancel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>100</y>
|
||||
<width>171</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="projectListBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>451</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Current project to launch or manage gems for.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="createProjectButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>70</y>
|
||||
<width>91</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Create a new O3DE project from a pre configured template.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create New</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>47</width>
|
||||
<height>13</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Project</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="browseProjectsButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>70</y>
|
||||
<width>91</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Browse for an existing O3DE project.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="manageGemsButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>350</x>
|
||||
<y>70</y>
|
||||
<width>91</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Add or remove gems from your selected project. Gems add and remove additional assets and features to projects.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manage Gems</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="logDisplay">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>5</x>
|
||||
<y>110</y>
|
||||
<width>275</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>okCancel</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Loading…
Reference in New Issue