@@ -292,9 +292,8 @@ def get_mbed_official_release(version):
292
292
293
293
def prepare_toolchain (src_paths , build_dir , target , toolchain_name ,
294
294
macros = None , clean = False , jobs = 1 ,
295
- notify = None , silent = False , verbose = False ,
296
- extra_verbose = False , config = None ,
297
- app_config = None , build_profile = None ):
295
+ notify = None , config = None , app_config = None ,
296
+ build_profile = None ):
298
297
""" Prepares resource related objects - toolchain, target, config
299
298
300
299
Positional arguments:
@@ -307,9 +306,6 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
307
306
clean - Rebuild everything if True
308
307
jobs - how many compilers we can run at once
309
308
notify - Notify function for logs
310
- silent - suppress printing of progress indicators
311
- verbose - Write the actual tools command lines used if True
312
- extra_verbose - even more output!
313
309
config - a Config object to use instead of creating one
314
310
app_config - location of a chosen mbed_app.json file
315
311
build_profile - a list of mergeable build profiles
@@ -332,13 +328,12 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
332
328
for key in profile :
333
329
profile [key ].extend (contents [toolchain_name ].get (key , []))
334
330
335
- toolchain = cur_tc (target , notify , macros , silent , build_dir = build_dir ,
336
- extra_verbose = extra_verbose , build_profile = profile )
331
+ toolchain = cur_tc (
332
+ target , notify , macros , build_dir = build_dir , build_profile = profile )
337
333
338
334
toolchain .config = config
339
335
toolchain .jobs = jobs
340
336
toolchain .build_all = clean
341
- toolchain .VERBOSE = verbose
342
337
343
338
return toolchain
344
339
@@ -489,11 +484,10 @@ def scan_resources(src_paths, toolchain, dependencies_paths=None,
489
484
return resources
490
485
491
486
def build_project (src_paths , build_path , target , toolchain_name ,
492
- libraries_paths = None , linker_script = None ,
493
- clean = False , notify = None , verbose = False , name = None ,
494
- macros = None , inc_dirs = None , jobs = 1 , silent = False ,
487
+ libraries_paths = None , linker_script = None , clean = False , silent = False ,
488
+ notify = None , name = None , macros = None , inc_dirs = None , jobs = 1 ,
495
489
report = None , properties = None , project_id = None ,
496
- project_description = None , extra_verbose = False , config = None ,
490
+ project_description = None , config = None ,
497
491
app_config = None , build_profile = None , stats_depth = None ):
498
492
""" Build a project. A project may be a test or a user program.
499
493
@@ -509,17 +503,14 @@ def build_project(src_paths, build_path, target, toolchain_name,
509
503
linker_script - the file that drives the linker to do it's job
510
504
clean - Rebuild everything if True
511
505
notify - Notify function for logs
512
- verbose - Write the actual tools command lines used if True
513
506
name - the name of the project
514
507
macros - additional macros
515
508
inc_dirs - additional directories where include files may be found
516
509
jobs - how many compilers we can run at once
517
- silent - suppress printing of progress indicators
518
510
report - a dict where a result may be appended
519
511
properties - UUUUHHHHH beats me
520
512
project_id - the name put in the report
521
513
project_description - the human-readable version of what this thing does
522
- extra_verbose - even more output!
523
514
config - a Config object to use instead of creating one
524
515
app_config - location of a chosen mbed_app.json file
525
516
build_profile - a dict of flags that will be passed to the compiler
@@ -540,15 +531,14 @@ def build_project(src_paths, build_path, target, toolchain_name,
540
531
541
532
toolchain = prepare_toolchain (
542
533
src_paths , build_path , target , toolchain_name , macros = macros ,
543
- clean = clean , jobs = jobs , notify = notify , silent = silent , verbose = verbose ,
544
- extra_verbose = extra_verbose , config = config , app_config = app_config ,
545
- build_profile = build_profile )
534
+ clean = clean , jobs = jobs , notify = notify , config = config ,
535
+ app_config = app_config , build_profile = build_profile )
546
536
547
537
# The first path will give the name to the library
548
538
name = (name or toolchain .config .name or
549
539
basename (normpath (abspath (src_paths [0 ]))))
550
- toolchain .info ("Building project %s (%s, %s)" %
551
- (name , toolchain .target .name , toolchain_name ))
540
+ notify .info ("Building project %s (%s, %s)" %
541
+ (name , toolchain .target .name , toolchain_name ))
552
542
553
543
# Initialize reporting
554
544
if report != None :
@@ -610,7 +600,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
610
600
if report != None :
611
601
end = time ()
612
602
cur_result ["elapsed_time" ] = end - start
613
- cur_result ["output" ] = toolchain .get_output () + memap_table
603
+ cur_result ["output" ] = notify .get_output () + memap_table
614
604
cur_result ["result" ] = "OK"
615
605
cur_result ["memory_usage" ] = (memap_instance .mem_report
616
606
if memap_instance is not None else None )
@@ -633,7 +623,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
633
623
634
624
cur_result ["elapsed_time" ] = end - start
635
625
636
- toolchain_output = toolchain .get_output ()
626
+ toolchain_output = notify .get_output ()
637
627
if toolchain_output :
638
628
cur_result ["output" ] += toolchain_output
639
629
@@ -644,9 +634,8 @@ def build_project(src_paths, build_path, target, toolchain_name,
644
634
645
635
def build_library (src_paths , build_path , target , toolchain_name ,
646
636
dependencies_paths = None , name = None , clean = False ,
647
- archive = True , notify = None , verbose = False , macros = None ,
648
- inc_dirs = None , jobs = 1 , silent = False , report = None ,
649
- properties = None , extra_verbose = False , project_id = None ,
637
+ archive = True , notify = None , macros = None , inc_dirs = None , jobs = 1 ,
638
+ report = None , properties = None , project_id = None ,
650
639
remove_config_header_file = False , app_config = None ,
651
640
build_profile = None ):
652
641
""" Build a library
@@ -664,14 +653,11 @@ def build_library(src_paths, build_path, target, toolchain_name,
664
653
clean - Rebuild everything if True
665
654
archive - whether the library will create an archive file
666
655
notify - Notify function for logs
667
- verbose - Write the actual tools command lines used if True
668
656
macros - additional macros
669
657
inc_dirs - additional directories where include files may be found
670
658
jobs - how many compilers we can run at once
671
- silent - suppress printing of progress indicators
672
659
report - a dict where a result may be appended
673
660
properties - UUUUHHHHH beats me
674
- extra_verbose - even more output!
675
661
project_id - the name that goes in the report
676
662
remove_config_header_file - delete config header file when done building
677
663
app_config - location of a chosen mbed_app.json file
@@ -698,14 +684,13 @@ def build_library(src_paths, build_path, target, toolchain_name,
698
684
# Pass all params to the unified prepare_toolchain()
699
685
toolchain = prepare_toolchain (
700
686
src_paths , build_path , target , toolchain_name , macros = macros ,
701
- clean = clean , jobs = jobs , notify = notify , silent = silent ,
702
- verbose = verbose , extra_verbose = extra_verbose , app_config = app_config ,
687
+ clean = clean , jobs = jobs , notify = notify , app_config = app_config ,
703
688
build_profile = build_profile )
704
689
705
690
# The first path will give the name to the library
706
691
if name is None :
707
692
name = basename (normpath (abspath (src_paths [0 ])))
708
- toolchain .info ("Building library %s (%s, %s)" %
693
+ notify .info ("Building library %s (%s, %s)" %
709
694
(name , toolchain .target .name , toolchain_name ))
710
695
711
696
# Initialize reporting
@@ -770,7 +755,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
770
755
if report != None :
771
756
end = time ()
772
757
cur_result ["elapsed_time" ] = end - start
773
- cur_result ["output" ] = toolchain .get_output ()
758
+ cur_result ["output" ] = notify .get_output ()
774
759
cur_result ["result" ] = "OK"
775
760
776
761
@@ -788,7 +773,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
788
773
789
774
cur_result ["elapsed_time" ] = end - start
790
775
791
- toolchain_output = toolchain .get_output ()
776
+ toolchain_output = notify .get_output ()
792
777
if toolchain_output :
793
778
cur_result ["output" ] += toolchain_output
794
779
@@ -805,9 +790,8 @@ def mbed2_obj_path(target_name, toolchain_name):
805
790
real_tc_name = TOOLCHAIN_CLASSES [toolchain_name ].__name__
806
791
return join ("TARGET_" + target_name , "TOOLCHAIN_" + real_tc_name )
807
792
808
- def build_lib (lib_id , target , toolchain_name , verbose = False ,
809
- clean = False , macros = None , notify = None , jobs = 1 , silent = False ,
810
- report = None , properties = None , extra_verbose = False ,
793
+ def build_lib (lib_id , target , toolchain_name , clean = False , macros = None ,
794
+ notify = None , jobs = 1 , report = None , properties = None ,
811
795
build_profile = None ):
812
796
""" Legacy method for building mbed libraries
813
797
@@ -818,14 +802,11 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
818
802
819
803
Keyword arguments:
820
804
clean - Rebuild everything if True
821
- verbose - Write the actual tools command lines used if True
822
805
macros - additional macros
823
806
notify - Notify function for logs
824
807
jobs - how many compilers we can run at once
825
- silent - suppress printing of progress indicators
826
808
report - a dict where a result may be appended
827
809
properties - UUUUHHHHH beats me
828
- extra_verbose - even more output!
829
810
build_profile - a dict of flags that will be passed to the compiler
830
811
"""
831
812
lib = Library (lib_id )
@@ -890,10 +871,9 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
890
871
891
872
toolchain = prepare_toolchain (
892
873
src_paths , tmp_path , target , toolchain_name , macros = macros ,
893
- notify = notify , silent = silent , extra_verbose = extra_verbose ,
894
- build_profile = build_profile , jobs = jobs , clean = clean )
874
+ notify = notify , build_profile = build_profile , jobs = jobs , clean = clean )
895
875
896
- toolchain .info ("Building library %s (%s, %s)" %
876
+ notify .info ("Building library %s (%s, %s)" %
897
877
(name .upper (), target .name , toolchain_name ))
898
878
899
879
# Take into account the library configuration (MBED_CONFIG_FILE)
@@ -947,7 +927,7 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
947
927
if report != None and needed_update :
948
928
end = time ()
949
929
cur_result ["elapsed_time" ] = end - start
950
- cur_result ["output" ] = toolchain .get_output ()
930
+ cur_result ["output" ] = notify .get_output ()
951
931
cur_result ["result" ] = "OK"
952
932
953
933
add_result_to_report (report , cur_result )
@@ -959,7 +939,7 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
959
939
cur_result ["result" ] = "FAIL"
960
940
cur_result ["elapsed_time" ] = end - start
961
941
962
- toolchain_output = toolchain .get_output ()
942
+ toolchain_output = notify .get_output ()
963
943
if toolchain_output :
964
944
cur_result ["output" ] += toolchain_output
965
945
@@ -970,9 +950,8 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
970
950
971
951
# We do have unique legacy conventions about how we build and package the mbed
972
952
# library
973
- def build_mbed_libs (target , toolchain_name , verbose = False ,
974
- clean = False , macros = None , notify = None , jobs = 1 , silent = False ,
975
- report = None , properties = None , extra_verbose = False ,
953
+ def build_mbed_libs (target , toolchain_name , clean = False , macros = None ,
954
+ notify = None , jobs = 1 , report = None , properties = None ,
976
955
build_profile = None ):
977
956
""" Function returns True is library was built and false if building was
978
957
skipped
@@ -982,15 +961,12 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
982
961
toolchain_name - the name of the build tools
983
962
984
963
Keyword arguments:
985
- verbose - Write the actual tools command lines used if True
986
964
clean - Rebuild everything if True
987
965
macros - additional macros
988
966
notify - Notify function for logs
989
967
jobs - how many compilers we can run at once
990
- silent - suppress printing of progress indicators
991
968
report - a dict where a result may be appended
992
969
properties - UUUUHHHHH beats me
993
- extra_verbose - even more output!
994
970
build_profile - a dict of flags that will be passed to the compiler
995
971
"""
996
972
@@ -1034,8 +1010,7 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
1034
1010
mkdir (tmp_path )
1035
1011
1036
1012
toolchain = prepare_toolchain (
1037
- ["" ], tmp_path , target , toolchain_name , macros = macros ,verbose = verbose ,
1038
- notify = notify , silent = silent , extra_verbose = extra_verbose ,
1013
+ ["" ], tmp_path , target , toolchain_name , macros = macros , notify = notify ,
1039
1014
build_profile = build_profile , jobs = jobs , clean = clean )
1040
1015
1041
1016
# Take into account the library configuration (MBED_CONFIG_FILE)
@@ -1044,7 +1019,7 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
1044
1019
toolchain .set_config_data (toolchain .config .get_config_data ())
1045
1020
1046
1021
# mbed
1047
- toolchain .info ("Building library %s (%s, %s)" %
1022
+ notify .info ("Building library %s (%s, %s)" %
1048
1023
('MBED' , target .name , toolchain_name ))
1049
1024
1050
1025
# Common Headers
@@ -1111,7 +1086,7 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
1111
1086
if report != None :
1112
1087
end = time ()
1113
1088
cur_result ["elapsed_time" ] = end - start
1114
- cur_result ["output" ] = toolchain .get_output ()
1089
+ cur_result ["output" ] = notify .get_output ()
1115
1090
cur_result ["result" ] = "OK"
1116
1091
1117
1092
add_result_to_report (report , cur_result )
@@ -1124,7 +1099,7 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
1124
1099
cur_result ["result" ] = "FAIL"
1125
1100
cur_result ["elapsed_time" ] = end - start
1126
1101
1127
- toolchain_output = toolchain .get_output ()
1102
+ toolchain_output = notify .get_output ()
1128
1103
if toolchain_output :
1129
1104
cur_result ["output" ] += toolchain_output
1130
1105
0 commit comments