diff options
| author | Bernard Xiong <[email protected]> | 2019-06-18 18:04:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-06-18 18:04:25 +0800 |
| commit | 0c45bb6f96ea36844dffc4e4f04541a77b376503 (patch) | |
| tree | 88c163800200b57bedb1752fcf2b1f23ebc7720c /tools/building.py | |
| parent | 34059c40c42c53a541822834d8d9092c640f45b3 (diff) | |
| parent | 1a32d47a79b5fbfb71a1762cade64ec03fd72283 (diff) | |
Merge pull request #2785 from SummerGGift/add_ide_dist
[tools] add scons --dist-ide function
Diffstat (limited to 'tools/building.py')
| -rw-r--r-- | tools/building.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/building.py b/tools/building.py index c037c2d068..edb95fdda5 100644 --- a/tools/building.py +++ b/tools/building.py @@ -161,6 +161,21 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ action = 'store_true', default = False, help = 'make distribution and strip useless files') + AddOption('--dist-ide', + dest = 'make-dist-ide', + action = 'store_true', + default = False, + help = 'make distribution for RT-Thread Studio IDE') + AddOption('--project-path', + dest = 'make-project-path', + type = 'string', + default = False, + help = 'set dist-ide project output path') + AddOption('--project-name', + dest = 'make-project-name', + type = 'string', + default = False, + help = 'set project name') AddOption('--cscope', dest = 'cscope', action = 'store_true', @@ -865,6 +880,24 @@ def EndBuilding(target, program = None): from mkdist import MkDist_Strip MkDist_Strip(program, BSP_ROOT, Rtt_Root, Env) need_exit = True + if GetOption('make-dist-ide') and program != None: + from mkdist import MkDist + project_path = GetOption('make-project-path') + project_name = GetOption('make-project-name') + + if not isinstance(project_path, str) or len(project_path) == 0 : + print("\nwarning : --project-path=your_project_path parameter is required.") + print("\nstop!") + exit(0) + + if not isinstance(project_name, str) or len(project_name) == 0: + print("\nwarning : --project-name=your_project_name parameter is required.") + print("\nstop!") + exit(0) + + rtt_ide = {'project_path' : project_path, 'project_name' : project_name} + MkDist(program, BSP_ROOT, Rtt_Root, Env, rtt_ide) + need_exit = True if GetOption('cscope'): from cscope import CscopeDatabase CscopeDatabase(Projects) |
