Skip to content

Commit ec2e4a1

Browse files
committed
Adding default id for the build report if no id is provided
1 parent 6c3ce1e commit ec2e4a1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tools/build_api.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ def build_project(src_path, build_path, target, toolchain_name,
109109

110110
if report != None:
111111
start = time()
112-
id_name = project_id.upper()
113-
description = project_description
112+
113+
# If project_id is specified, use that over the default name
114+
id_name = project_id.upper() if project_id else name.upper()
115+
description = project_description if project_description else name
114116
vendor_label = target.extra_labels[0]
115117
cur_result = None
116118
prep_report(report, target.name, toolchain_name, id_name)
@@ -190,7 +192,8 @@ def build_project(src_path, build_path, target, toolchain_name,
190192
def build_library(src_paths, build_path, target, toolchain_name,
191193
dependencies_paths=None, options=None, name=None, clean=False, archive=True,
192194
notify=None, verbose=False, macros=None, inc_dirs=None, inc_dirs_ext=None,
193-
jobs=1, silent=False, report=None, properties=None, extra_verbose=False):
195+
jobs=1, silent=False, report=None, properties=None, extra_verbose=False,
196+
project_id=None):
194197
""" src_path: the path of the source directory
195198
build_path: the path of the build directory
196199
target: ['LPC1768', 'LPC11U24', 'LPC2368']
@@ -213,7 +216,9 @@ def build_library(src_paths, build_path, target, toolchain_name,
213216

214217
if report != None:
215218
start = time()
216-
id_name = name.upper()
219+
220+
# If project_id is specified, use that over the default name
221+
id_name = project_id.upper() if project_id else name.upper()
217222
description = name
218223
vendor_label = target.extra_labels[0]
219224
cur_result = None

0 commit comments

Comments
 (0)