@@ -1360,7 +1360,7 @@ def cache_lock(self, url):
1360
1360
lock_file = os .path .join (lock_dir , 'pid' )
1361
1361
timeout = 300
1362
1362
1363
- for i in range (timeout ):
1363
+ for i in range (timeout ):
1364
1364
if i :
1365
1365
time .sleep (1 )
1366
1366
@@ -1395,10 +1395,10 @@ def cache_lock(self, url):
1395
1395
os .fsync (f )
1396
1396
break
1397
1397
except (OSError ) as e :
1398
- ## Windows:
1398
+ ## Windows:
1399
1399
## <type 'exceptions.WindowsError'> 17 [Error 183] Cannot create a file when that file already exists: 'testing'
1400
1400
## or when concurrent: 13 WindowsError(5, 'Access is denied')
1401
- ## Linux: <type 'exceptions.OSError'> 17 [Errno 17] File exists: 'testing'
1401
+ ## Linux: <type 'exceptions.OSError'> 17 [Errno 17] File exists: 'testing'
1402
1402
## or when concurrent & virtualbox 71, OSError(71, 'Protocol error')
1403
1403
## or when full: 28, OSError(28, 'No space left on device')
1404
1404
if e .errno in (17 ,13 ,71 ,28 ):
@@ -2604,7 +2604,7 @@ def _safe_append_profile_to_build_path(build_path, profile):
2604
2604
@subcommand ('compile' ,
2605
2605
dict (name = ['-t' , '--toolchain' ], help = 'Compile toolchain. Example: ARM, GCC_ARM, IAR' ),
2606
2606
dict (name = ['-m' , '--target' ], help = 'Compile target MCU. Example: K64F, NUCLEO_F401RE, NRF51822...' ),
2607
- dict (name = ['--profile' ], action = 'append' , help = 'Path of a build profile configuration file. Example: mbed-os/tools/profiles/debug.json ' ),
2607
+ dict (name = ['--profile' ], action = 'append' , help = 'Path of a build profile configuration file (or name of Mbed OS profile). Default: develop ' ),
2608
2608
dict (name = '--library' , dest = 'compile_library' , action = 'store_true' , help = 'Compile the current program or library as a static library.' ),
2609
2609
dict (name = '--config' , dest = 'compile_config' , action = 'store_true' , help = 'Show run-time compile configuration' ),
2610
2610
dict (name = '--prefix' , dest = 'config_prefix' , action = 'append' , help = 'Restrict listing to parameters that have this prefix' ),
@@ -2751,7 +2751,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
2751
2751
dict (name = '--source' , action = 'append' , help = 'Source directory. Default: . (current dir)' ),
2752
2752
dict (name = '--build' , help = 'Build directory. Default: build/' ),
2753
2753
dict (name = ['--profile' ], action = 'append' ,
2754
- help = 'Path of a build profile configuration file. Example: mbed-os/tools/profiles/debug.json ' ),
2754
+ help = 'Path of a build profile configuration file (or name of Mbed OS profile). Default: develop ' ),
2755
2755
dict (name = ['-c' , '--clean' ], action = 'store_true' , help = 'Clean the build directory before compiling' ),
2756
2756
dict (name = '--test-spec' , dest = "test_spec" , help = "Path used for the test spec file used when building and running tests (the default path is the build directory)" ),
2757
2757
dict (name = '--app-config' , dest = "app_config" , help = "Path of an application configuration file. Default is to look for \" mbed_app.json\" " ),
@@ -2772,7 +2772,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False,
2772
2772
compile_only = False , run_only = False , tests_by_name = None , source = False ,
2773
2773
profile = False , build = False , clean = False , test_spec = None ,
2774
2774
app_config = None , test_config = None , coverage = None , make_program = None ,
2775
- new = None , generator = None , regex = None , unittests = None ,
2775
+ new = None , generator = None , regex = None , unittests = None ,
2776
2776
build_data = None , greentea = None , icetea = None ):
2777
2777
2778
2778
# Default behaviour is to run only greentea tests
@@ -3011,14 +3011,15 @@ def dev_mgmt(toolchain=None, target=None, source=False, profile=False, build=Fal
3011
3011
dict (name = ['-i' , '--ide' ], help = 'IDE to create project files for. Example: UVISION4, UVISION5, GCC_ARM, IAR, COIDE' ),
3012
3012
dict (name = ['-m' , '--target' ], help = 'Export for target MCU. Example: K64F, NUCLEO_F401RE, NRF51822...' ),
3013
3013
dict (name = '--source' , action = 'append' , help = 'Source directory. Default: . (current dir)' ),
3014
+ dict (name = ['--profile' ], action = 'append' , help = 'Path of a build profile configuration file (or name of Mbed OS profile). Default: debug' ),
3014
3015
dict (name = ['-c' , '--clean' ], action = 'store_true' , help = 'Clean the build directory before compiling' ),
3015
3016
dict (name = ['-S' , '--supported' ], dest = 'supported' , const = True , choices = ['matrix' , 'ides' ], nargs = '?' , help = 'Shows supported matrix of targets and toolchains' ),
3016
3017
dict (name = '--app-config' , dest = "app_config" , help = "Path of an application configuration file. Default is to look for \" mbed_app.json\" " ),
3017
3018
dict (name = '--no-requirements' , action = 'store_true' , help = 'Disables checking for and installing any requirements.' ),
3018
3019
help = 'Generate an IDE project' ,
3019
3020
description = (
3020
3021
"Generate IDE project files for the current program." ))
3021
- def export (ide = None , target = None , source = False , clean = False , supported = False , app_config = None , no_requirements = False ):
3022
+ def export (ide = None , target = None , source = False , profile = [ "debug" ], clean = False , supported = False , app_config = None , no_requirements = False ):
3022
3023
# Gather remaining arguments
3023
3024
args = remainder
3024
3025
# Find the root of the program
@@ -3056,6 +3057,7 @@ def export(ide=None, target=None, source=False, clean=False, supported=False, ap
3056
3057
+ list (chain .from_iterable (zip (repeat ('-D' ), macros )))
3057
3058
+ ['-i' , ide .lower ()]
3058
3059
+ ['-m' , target ]
3060
+ + list (chain .from_iterable (zip (repeat ('--profile' ), profile or [])))
3059
3061
+ (['-c' ] if clean else [])
3060
3062
+ list (chain .from_iterable (zip (repeat ('--source' ), source )))
3061
3063
+ (['--app-config' , app_config ] if app_config else [])
0 commit comments