Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
3d0ccf62
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3d0ccf62
编写于
10月 25, 2019
作者:
armink_ztl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[tools] change the eclipse default paths exclude mode.
上级
c8beffee
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
27 deletion
+20
-27
tools/building.py
tools/building.py
+1
-6
tools/eclipse.py
tools/eclipse.py
+19
-21
未找到文件。
tools/building.py
浏览文件 @
3d0ccf62
...
@@ -181,11 +181,6 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
...
@@ -181,11 +181,6 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
action
=
'store_true'
,
action
=
'store_true'
,
default
=
False
,
default
=
False
,
help
=
'reset the project configurations to default'
)
help
=
'reset the project configurations to default'
)
AddOption
(
'--mcu-type'
,
dest
=
'mcu-type'
,
type
=
'string'
,
default
=
False
,
help
=
'set mcu type name'
)
AddOption
(
'--cscope'
,
AddOption
(
'--cscope'
,
dest
=
'cscope'
,
dest
=
'cscope'
,
action
=
'store_true'
,
action
=
'store_true'
,
...
@@ -857,7 +852,7 @@ def GenTargetProject(program = None):
...
@@ -857,7 +852,7 @@ def GenTargetProject(program = None):
if
GetOption
(
'target'
)
==
'eclipse'
:
if
GetOption
(
'target'
)
==
'eclipse'
:
from
eclipse
import
TargetEclipse
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
):
def
EndBuilding
(
target
,
program
=
None
):
...
...
tools/eclipse.py
浏览文件 @
3d0ccf62
...
@@ -128,7 +128,7 @@ def ConverToEclipsePathFormat(path):
...
@@ -128,7 +128,7 @@ def ConverToEclipsePathFormat(path):
return
'"${workspace_loc:/${ProjName}/'
+
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'
])
BSP_ROOT
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
CPPDEFINES
=
project
[
'CPPDEFINES'
]
CPPDEFINES
=
project
[
'CPPDEFINES'
]
...
@@ -302,7 +302,8 @@ def UpdateProjectStructure(env, prj_name):
...
@@ -302,7 +302,8 @@ def UpdateProjectStructure(env, prj_name):
return
return
def
GenExcluding
(
env
,
project
,
mcu_type
):
def
GenExcluding
(
env
,
project
):
rtt_root
=
os
.
path
.
abspath
(
env
[
'RTT_ROOT'
])
rtt_root
=
os
.
path
.
abspath
(
env
[
'RTT_ROOT'
])
bsp_root
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
bsp_root
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
coll_dirs
=
CollectPaths
(
project
[
'DIRS'
])
coll_dirs
=
CollectPaths
(
project
[
'DIRS'
])
...
@@ -313,20 +314,17 @@ def GenExcluding(env, project, mcu_type):
...
@@ -313,20 +314,17 @@ def GenExcluding(env, project, mcu_type):
exclude_paths
=
ExcludePaths
(
rtt_root
,
all_paths
)
exclude_paths
=
ExcludePaths
(
rtt_root
,
all_paths
)
elif
rtt_root
.
startswith
(
bsp_root
):
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
# 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
check_path
=
[]
exclude_paths
=
ExcludePaths
(
bsp_root
,
all_paths
)
exclude_paths
=
[]
else
:
# analyze the primary folder which relative to BSP_ROOT and in all_paths
check_path
=
[]
for
path
in
all_paths
:
exclude_paths
=
[]
if
path
.
startswith
(
bsp_root
)
:
# analyze the primary folder which relative to BSP_ROOT and in all_paths
folders
=
RelativeProjectPath
(
env
,
path
).
split
(
'
\\
'
)
for
path
in
all_paths
:
if
folders
[
0
]
!=
'.'
and
'
\\
'
+
folders
[
0
]
not
in
check_path
:
if
path
.
startswith
(
bsp_root
)
:
check_path
+=
[
'
\\
'
+
folders
[
0
]]
folders
=
RelativeProjectPath
(
env
,
path
).
split
(
'
\\
'
)
# exclue the folder which has managed by scons
if
folders
[
0
]
!=
'.'
and
'
\\
'
+
folders
[
0
]
not
in
check_path
:
for
path
in
check_path
:
check_path
+=
[
'
\\
'
+
folders
[
0
]]
exclude_paths
+=
ExcludePaths
(
bsp_root
+
path
,
all_paths
)
# exclue the folder which has managed by scons
for
path
in
check_path
:
exclude_paths
+=
ExcludePaths
(
bsp_root
+
path
,
all_paths
)
else
:
else
:
exclude_paths
=
ExcludePaths
(
rtt_root
,
all_paths
)
exclude_paths
=
ExcludePaths
(
rtt_root
,
all_paths
)
exclude_paths
+=
ExcludePaths
(
bsp_root
,
all_paths
)
exclude_paths
+=
ExcludePaths
(
bsp_root
,
all_paths
)
...
@@ -374,7 +372,7 @@ def RelativeProjectPath(env, path):
...
@@ -374,7 +372,7 @@ def RelativeProjectPath(env, path):
return
path
return
path
def
UpdateCproject
(
env
,
project
,
excluding
,
reset
,
mcu_type
):
def
UpdateCproject
(
env
,
project
,
excluding
,
reset
):
excluding
=
sorted
(
excluding
)
excluding
=
sorted
(
excluding
)
cproject
=
etree
.
parse
(
'.cproject'
)
cproject
=
etree
.
parse
(
'.cproject'
)
...
@@ -383,7 +381,7 @@ def UpdateCproject(env, project, excluding, reset, mcu_type):
...
@@ -383,7 +381,7 @@ def UpdateCproject(env, project, excluding, reset, mcu_type):
cconfigurations
=
root
.
findall
(
'storageModule/cconfiguration'
)
cconfigurations
=
root
.
findall
(
'storageModule/cconfiguration'
)
for
cconfiguration
in
cconfigurations
:
for
cconfiguration
in
cconfigurations
:
tools
=
cconfiguration
.
findall
(
'storageModule/configuration/folderInfo/toolChain/tool'
)
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'
)
sourceEntries
=
cconfiguration
.
find
(
'storageModule/configuration/sourceEntries'
)
entry
=
sourceEntries
.
find
(
'entry'
)
entry
=
sourceEntries
.
find
(
'entry'
)
...
@@ -408,7 +406,7 @@ def UpdateCproject(env, project, excluding, reset, mcu_type):
...
@@ -408,7 +406,7 @@ def UpdateCproject(env, project, excluding, reset, mcu_type):
out
.
close
()
out
.
close
()
def
TargetEclipse
(
env
,
reset
=
False
,
prj_name
=
None
,
mcu_type
=
None
):
def
TargetEclipse
(
env
,
reset
=
False
,
prj_name
=
None
):
global
source_pattern
global
source_pattern
print
(
'Update eclipse setting...'
)
print
(
'Update eclipse setting...'
)
...
@@ -423,10 +421,10 @@ def TargetEclipse(env, reset = False, prj_name = None, mcu_type = None):
...
@@ -423,10 +421,10 @@ def TargetEclipse(env, reset = False, prj_name = None, mcu_type = None):
UpdateProjectStructure
(
env
,
prj_name
)
UpdateProjectStructure
(
env
,
prj_name
)
# generate the exclude paths and files
# generate the exclude paths and files
excluding
=
GenExcluding
(
env
,
project
,
mcu_type
)
excluding
=
GenExcluding
(
env
,
project
)
# update the project configuration on '.cproject' file
# update the project configuration on '.cproject' file
UpdateCproject
(
env
,
project
,
excluding
,
reset
,
mcu_type
)
UpdateCproject
(
env
,
project
,
excluding
,
reset
)
print
(
'done!'
)
print
(
'done!'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录