Skip to content

Commit b1758bd

Browse files
Merge pull request #820 from bridadan/export_profile
Add --profile help text to export
2 parents 75fcf6e + 49b1e86 commit b1758bd

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

mbed/mbed.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ def cache_lock(self, url):
13601360
lock_file = os.path.join(lock_dir, 'pid')
13611361
timeout = 300
13621362

1363-
for i in range(timeout):
1363+
for i in range(timeout):
13641364
if i:
13651365
time.sleep(1)
13661366

@@ -1395,10 +1395,10 @@ def cache_lock(self, url):
13951395
os.fsync(f)
13961396
break
13971397
except (OSError) as e:
1398-
## Windows:
1398+
## Windows:
13991399
## <type 'exceptions.WindowsError'> 17 [Error 183] Cannot create a file when that file already exists: 'testing'
14001400
## 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'
14021402
## or when concurrent & virtualbox 71, OSError(71, 'Protocol error')
14031403
## or when full: 28, OSError(28, 'No space left on device')
14041404
if e.errno in (17,13,71,28):
@@ -2604,7 +2604,7 @@ def _safe_append_profile_to_build_path(build_path, profile):
26042604
@subcommand('compile',
26052605
dict(name=['-t', '--toolchain'], help='Compile toolchain. Example: ARM, GCC_ARM, IAR'),
26062606
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'),
26082608
dict(name='--library', dest='compile_library', action='store_true', help='Compile the current program or library as a static library.'),
26092609
dict(name='--config', dest='compile_config', action='store_true', help='Show run-time compile configuration'),
26102610
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,
27512751
dict(name='--source', action='append', help='Source directory. Default: . (current dir)'),
27522752
dict(name='--build', help='Build directory. Default: build/'),
27532753
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'),
27552755
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
27562756
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)"),
27572757
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,
27722772
compile_only=False, run_only=False, tests_by_name=None, source=False,
27732773
profile=False, build=False, clean=False, test_spec=None,
27742774
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,
27762776
build_data=None, greentea=None, icetea=None):
27772777

27782778
# 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
30113011
dict(name=['-i', '--ide'], help='IDE to create project files for. Example: UVISION4, UVISION5, GCC_ARM, IAR, COIDE'),
30123012
dict(name=['-m', '--target'], help='Export for target MCU. Example: K64F, NUCLEO_F401RE, NRF51822...'),
30133013
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'),
30143015
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
30153016
dict(name=['-S', '--supported'], dest='supported', const=True, choices=['matrix', 'ides'], nargs='?', help='Shows supported matrix of targets and toolchains'),
30163017
dict(name='--app-config', dest="app_config", help="Path of an application configuration file. Default is to look for \"mbed_app.json\""),
30173018
dict(name='--no-requirements', action='store_true', help='Disables checking for and installing any requirements.'),
30183019
help='Generate an IDE project',
30193020
description=(
30203021
"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):
30223023
# Gather remaining arguments
30233024
args = remainder
30243025
# Find the root of the program
@@ -3056,6 +3057,7 @@ def export(ide=None, target=None, source=False, clean=False, supported=False, ap
30563057
+ list(chain.from_iterable(zip(repeat('-D'), macros)))
30573058
+ ['-i', ide.lower()]
30583059
+ ['-m', target]
3060+
+ list(chain.from_iterable(zip(repeat('--profile'), profile or [])))
30593061
+ (['-c'] if clean else [])
30603062
+ list(chain.from_iterable(zip(repeat('--source'), source)))
30613063
+ (['--app-config', app_config] if app_config else [])

0 commit comments

Comments
 (0)