Updating the manifest get_registered command to read the engine projects, gems, external_subdirectories, restricted and templates paths from the engine.json
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
Contains command to add a gem to a project's cmake scripts
|
||||
Contains command to add an external_subdirectory to a project's cmake scripts
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@@ -50,6 +50,7 @@ def add_external_subdirectory(external_subdir: str or pathlib.Path,
|
||||
logger.error(f'Add External Subdirectory Failed: {engine_path} not registered.')
|
||||
return 1
|
||||
|
||||
engine_object.setdefault('external_subdirectories', [])
|
||||
while external_subdir.as_posix() in engine_object['external_subdirectories']:
|
||||
engine_object['external_subdirectories'].remove(external_subdir.as_posix())
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
This file contains methods for introspecting data from cmake scripts
|
||||
Contains methods for query CMake gem target information
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
This file contains functions for querying paths from ~/.o3de directory
|
||||
Implements functionality for downloading o3de objecs either locally or from a URI
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
This file contains functions for querying paths from ~/.o3de directory
|
||||
Contains functions for data from json files such as the o3de_manifests.json, engine.json, project.json, etc...
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -496,7 +496,7 @@ def get_registered(engine_name: str = None,
|
||||
return engine_path
|
||||
|
||||
elif isinstance(project_name, str):
|
||||
engine_object = find_engine_data(json_data)
|
||||
enging_projects = get_engine_projects()
|
||||
projects = json_data['projects'].copy()
|
||||
projects.extend(engine_object['projects'])
|
||||
for project_path in projects:
|
||||
@@ -513,9 +513,9 @@ def get_registered(engine_name: str = None,
|
||||
return project_path
|
||||
|
||||
elif isinstance(gem_name, str):
|
||||
engine_object = find_engine_data(json_data)
|
||||
engine_gems = get_engine_gems()
|
||||
gems = json_data['gems'].copy()
|
||||
gems.extend(engine_object['gems'])
|
||||
gems.extend(engine_gems)
|
||||
for gem_path in gems:
|
||||
gem_path = pathlib.Path(gem_path).resolve()
|
||||
gem_json = gem_path / 'gem.json'
|
||||
@@ -530,9 +530,9 @@ def get_registered(engine_name: str = None,
|
||||
return gem_path
|
||||
|
||||
elif isinstance(template_name, str):
|
||||
engine_object = find_engine_data(json_data)
|
||||
engine_templates = get_engine_templates()
|
||||
templates = json_data['templates'].copy()
|
||||
templates.extend(engine_object['templates'])
|
||||
templates.extend(engine_templates)
|
||||
for template_path in templates:
|
||||
template_path = pathlib.Path(template_path).resolve()
|
||||
template_json = template_path / 'template.json'
|
||||
@@ -547,9 +547,9 @@ def get_registered(engine_name: str = None,
|
||||
return template_path
|
||||
|
||||
elif isinstance(restricted_name, str):
|
||||
engine_object = find_engine_data(json_data)
|
||||
engine_restricted = get_engine_restricted()
|
||||
restricted = json_data['restricted'].copy()
|
||||
restricted.extend(engine_object['restricted'])
|
||||
restricted.extend(engine_restricted)
|
||||
for restricted_path in restricted:
|
||||
restricted_path = pathlib.Path(restricted_path).resolve()
|
||||
restricted_json = restricted_path / 'restricted.json'
|
||||
|
||||
@@ -374,7 +374,6 @@ def register_engine_path(json_data: dict,
|
||||
|
||||
engine_object = {}
|
||||
engine_object.update({'path': engine_path.as_posix()})
|
||||
engine_object.update({'restricted': []})
|
||||
|
||||
json_data.setdefault('engines', []).insert(0, engine_object)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
Contains command to add a gem to a project's cmake scripts
|
||||
Implemens functinality to remove external_subdirectories from the o3de_manifests.json
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@@ -31,7 +31,7 @@ def remove_external_subdirectory(external_subdir: str or pathlib.Path,
|
||||
"""
|
||||
json_data = manifest.load_o3de_manifest()
|
||||
engine_object = manifest.find_engine_data(json_data, engine_path)
|
||||
if not engine_object:
|
||||
if not engine_object or not 'external_subdirectories' in engine_object:
|
||||
logger.error(f'Remove External Subdirectory Failed: {engine_path} not registered.')
|
||||
return 1
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
This file contains methods for removing a gem from a project's cmake scripts
|
||||
Contains methods for removing a gem from a project's cmake scripts
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
This file contains methods for removing a gem from a project
|
||||
Contains methods for removing a gem target from a project
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
"""
|
||||
This file contains functions for querying paths from ~/.o3de directory
|
||||
This file validating o3de object json files
|
||||
"""
|
||||
import json
|
||||
import pathlib
|
||||
|
||||
Reference in New Issue
Block a user