mirror of https://github.com/ARMmbed/mbed-os.git
Add extra_targets.json support to build tools
If the file extra_targets.json exists in the working directory load it over the top of the built in targets.json for defining new and overriding built in mbed target definitions.pull/4103/head
parent
d121a43e37
commit
e6e3d08ea6
|
@ -129,8 +129,15 @@ class Target(namedtuple("Target", "name json_data resolution_order resolution_or
|
||||||
@cached
|
@cached
|
||||||
def get_json_target_data():
|
def get_json_target_data():
|
||||||
"""Load the description of JSON target data"""
|
"""Load the description of JSON target data"""
|
||||||
return json_file_to_dict(Target.__targets_json_location or
|
targets = json_file_to_dict(Target.__targets_json_location or
|
||||||
Target.__targets_json_location_default)
|
Target.__targets_json_location_default)
|
||||||
|
|
||||||
|
# If extra_targets.json exists in working directory load it over the top
|
||||||
|
extra = os.path.join('.', 'extra_targets.json')
|
||||||
|
if os.path.exists(extra):
|
||||||
|
targets.update(json_file_to_dict(extra))
|
||||||
|
|
||||||
|
return targets
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def set_targets_json_location(location=None):
|
def set_targets_json_location(location=None):
|
||||||
|
|
Loading…
Reference in New Issue