(target, program = None)
| 892 | ZigBuildProject(Env, Projects) |
| 893 | |
| 894 | def EndBuilding(target, program = None): |
| 895 | from mkdist import MkDist, MkDist_Strip |
| 896 | |
| 897 | need_exit = False |
| 898 | |
| 899 | Env['target'] = program |
| 900 | Env['project'] = Projects |
| 901 | |
| 902 | if hasattr(rtconfig, 'BSP_LIBRARY_TYPE'): |
| 903 | Env['bsp_lib_type'] = rtconfig.BSP_LIBRARY_TYPE |
| 904 | |
| 905 | if hasattr(rtconfig, 'dist_handle'): |
| 906 | Env['dist_handle'] = rtconfig.dist_handle |
| 907 | |
| 908 | Env.AddPostAction(target, rtconfig.POST_ACTION) |
| 909 | # Add addition clean files |
| 910 | Clean(target, 'cconfig.h') |
| 911 | Clean(target, 'rtua.py') |
| 912 | Clean(target, 'rtua.pyc') |
| 913 | Clean(target, '.sconsign.dblite') |
| 914 | |
| 915 | if GetOption('target'): |
| 916 | GenTargetProject(program) |
| 917 | need_exit = True |
| 918 | |
| 919 | BSP_ROOT = Dir('#').abspath |
| 920 | |
| 921 | project_name = GetOption('project-name') |
| 922 | project_path = GetOption('project-path') |
| 923 | |
| 924 | # 合并处理打包相关选项 |
| 925 | if program != None: |
| 926 | if GetOption('make-dist'): |
| 927 | MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path) |
| 928 | need_exit = True |
| 929 | elif GetOption('dist_strip'): |
| 930 | MkDist_Strip(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path) |
| 931 | need_exit = True |
| 932 | elif GetOption('make-dist-ide'): |
| 933 | import subprocess |
| 934 | if not isinstance(project_path, str) or len(project_path) == 0: |
| 935 | project_path = os.path.join(BSP_ROOT, 'rt-studio-project') |
| 936 | MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path) |
| 937 | child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name), |
| 938 | cwd=project_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) |
| 939 | stdout, stderr = child.communicate() |
| 940 | need_exit = True |
| 941 | |
| 942 | if GetOption('cscope'): |
| 943 | from cscope import CscopeDatabase |
| 944 | CscopeDatabase(Projects) |
| 945 | |
| 946 | if not GetOption('help') and not GetOption('target'): |
| 947 | if not os.path.exists(rtconfig.EXEC_PATH): |
| 948 | print ("Error: the toolchain path (" + rtconfig.EXEC_PATH + ") is not exist, please check 'EXEC_PATH' in path or rtconfig.py.") |
| 949 | need_exit = True |
| 950 | |
| 951 | if need_exit: |
no test coverage detected