diff --git a/tools/building.py b/tools/building.py index 2c9719e3985c9fd8e312136016ec6ac122319b23..8d461102bc1d6b6f515feef54af757d9b148f1dd 100644 --- a/tools/building.py +++ b/tools/building.py @@ -181,11 +181,6 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ action = 'store_true', default = False, help = 'reset the project configurations to default') - AddOption('--mcu-type', - dest = 'mcu-type', - type = 'string', - default = False, - help = 'set mcu type name') AddOption('--cscope', dest = 'cscope', action = 'store_true', @@ -857,7 +852,7 @@ def GenTargetProject(program = None): if GetOption('target') == 'eclipse': from eclipse import TargetEclipse - TargetEclipse(Env, GetOption('reset-project-config'), GetOption('project-name'), GetOption('mcu-type')) + TargetEclipse(Env, GetOption('reset-project-config'), GetOption('project-name')) def EndBuilding(target, program = None): diff --git a/tools/eclipse.py b/tools/eclipse.py index c8f749a6ca0149d60050f849b4468d1e69927bfb..840ed9f191c03ee50f3bd807fadb11fe9902f338 100644 --- a/tools/eclipse.py +++ b/tools/eclipse.py @@ -128,7 +128,7 @@ def ConverToEclipsePathFormat(path): return '"${workspace_loc:/${ProjName}/' + path + '}"' -def HandleToolOption(tools, env, project, reset, mcu_type): +def HandleToolOption(tools, env, project, reset): BSP_ROOT = os.path.abspath(env['BSP_ROOT']) CPPDEFINES = project['CPPDEFINES'] @@ -302,7 +302,8 @@ def UpdateProjectStructure(env, prj_name): return -def GenExcluding(env, project, mcu_type): + +def GenExcluding(env, project): rtt_root = os.path.abspath(env['RTT_ROOT']) bsp_root = os.path.abspath(env['BSP_ROOT']) coll_dirs = CollectPaths(project['DIRS']) @@ -313,20 +314,17 @@ def GenExcluding(env, project, mcu_type): exclude_paths = ExcludePaths(rtt_root, all_paths) elif rtt_root.startswith(bsp_root): # RT-Thread root folder is in the bsp folder, such as project folder which generate by 'scons --dist' cmd - if mcu_type is None : # BSP mode, not MCU mode - exclude_paths = ExcludePaths(bsp_root, all_paths) - else : - check_path = [] - exclude_paths = [] - # analyze the primary folder which relative to BSP_ROOT and in all_paths - for path in all_paths : - if path.startswith(bsp_root) : - folders = RelativeProjectPath(env, path).split('\\') - if folders[0] != '.' and '\\' + folders[0] not in check_path: - check_path += ['\\' + folders[0]] - # exclue the folder which has managed by scons - for path in check_path: - exclude_paths += ExcludePaths(bsp_root + path, all_paths) + check_path = [] + exclude_paths = [] + # analyze the primary folder which relative to BSP_ROOT and in all_paths + for path in all_paths : + if path.startswith(bsp_root) : + folders = RelativeProjectPath(env, path).split('\\') + if folders[0] != '.' and '\\' + folders[0] not in check_path: + check_path += ['\\' + folders[0]] + # exclue the folder which has managed by scons + for path in check_path: + exclude_paths += ExcludePaths(bsp_root + path, all_paths) else: exclude_paths = ExcludePaths(rtt_root, all_paths) exclude_paths += ExcludePaths(bsp_root, all_paths) @@ -374,7 +372,7 @@ def RelativeProjectPath(env, path): return path -def UpdateCproject(env, project, excluding, reset, mcu_type): +def UpdateCproject(env, project, excluding, reset): excluding = sorted(excluding) cproject = etree.parse('.cproject') @@ -383,7 +381,7 @@ def UpdateCproject(env, project, excluding, reset, mcu_type): cconfigurations = root.findall('storageModule/cconfiguration') for cconfiguration in cconfigurations: tools = cconfiguration.findall('storageModule/configuration/folderInfo/toolChain/tool') - HandleToolOption(tools, env, project, reset, mcu_type) + HandleToolOption(tools, env, project, reset) sourceEntries = cconfiguration.find('storageModule/configuration/sourceEntries') entry = sourceEntries.find('entry') @@ -408,7 +406,7 @@ def UpdateCproject(env, project, excluding, reset, mcu_type): out.close() -def TargetEclipse(env, reset = False, prj_name = None, mcu_type = None): +def TargetEclipse(env, reset = False, prj_name = None): global source_pattern print('Update eclipse setting...') @@ -423,10 +421,10 @@ def TargetEclipse(env, reset = False, prj_name = None, mcu_type = None): UpdateProjectStructure(env, prj_name) # generate the exclude paths and files - excluding = GenExcluding(env, project, mcu_type) + excluding = GenExcluding(env, project) # update the project configuration on '.cproject' file - UpdateCproject(env, project, excluding, reset, mcu_type) + UpdateCproject(env, project, excluding, reset) print('done!')