Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
5a1349ab
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
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,发现更多精彩内容 >>
未验证
提交
5a1349ab
编写于
10月 28, 2019
作者:
B
Bernard Xiong
提交者:
GitHub
10月 28, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3154 from armink/master
完善 scons target=eclipse
上级
a29fd11f
c73d9518
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
818 addition
and
778 deletion
+818
-778
bsp/stm32/stm32f103-dofly-M3S/.cproject
bsp/stm32/stm32f103-dofly-M3S/.cproject
+152
-153
bsp/stm32/stm32f103-yf-ufun/.cproject
bsp/stm32/stm32f103-yf-ufun/.cproject
+151
-153
bsp/stm32/stm32f401-st-nucleo/.cproject
bsp/stm32/stm32f401-st-nucleo/.cproject
+153
-154
bsp/stm32/stm32f407-atk-explorer/.cproject
bsp/stm32/stm32f407-atk-explorer/.cproject
+21
-22
bsp/stm32/stm32f411-st-nucleo/.cproject
bsp/stm32/stm32f411-st-nucleo/.cproject
+153
-155
bsp/stm32/stm32f429-atk-apollo/.cproject
bsp/stm32/stm32f429-atk-apollo/.cproject
+21
-22
bsp/stm32/stm32f429-fire-challenger/.cproject
bsp/stm32/stm32f429-fire-challenger/.cproject
+21
-22
bsp/stm32/stm32f767-atk-apollo/.cproject
bsp/stm32/stm32f767-atk-apollo/.cproject
+21
-22
bsp/stm32/stm32l475-atk-pandora/.cproject
bsp/stm32/stm32l475-atk-pandora/.cproject
+27
-28
tools/eclipse.py
tools/eclipse.py
+98
-47
未找到文件。
bsp/stm32/stm32f103-dofly-M3S/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32f103-yf-ufun/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32f401-st-nucleo/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32f407-atk-explorer/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32f411-st-nucleo/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32f429-atk-apollo/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32f429-fire-challenger/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32f767-atk-apollo/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
bsp/stm32/stm32l475-atk-pandora/.cproject
浏览文件 @
5a1349ab
此差异已折叠。
点击以展开。
tools/eclipse.py
浏览文件 @
5a1349ab
...
...
@@ -122,61 +122,100 @@ def ExcludePaths(rootpath, paths):
return
ret
def
ConverToEclipsePathFormat
(
path
):
if
path
.
startswith
(
'.'
):
path
=
path
[
1
:]
return
'"${workspace_loc:/${ProjName}/'
+
path
+
'}"'
rtt_path_prefix
=
'"${workspace_loc://${ProjName}//'
def
ConverToRttEclipsePathFormat
(
path
):
return
rtt_path_prefix
+
path
+
'}"'
def
IsRttEclipsePathFormat
(
path
):
if
path
.
startswith
(
rtt_path_prefix
):
return
True
else
:
return
False
def
HandleToolOption
(
tools
,
env
,
project
,
reset
):
BSP_ROOT
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
CPPDEFINES
=
project
[
'CPPDEFINES'
]
paths
=
[
ConverToEclipsePathFormat
(
RelativeProjectPath
(
env
,
os
.
path
.
normpath
(
i
)).
replace
(
'
\\
'
,
'/'
))
for
i
in
project
[
'CPPPATH'
]]
paths
=
[
ConverTo
Rtt
EclipsePathFormat
(
RelativeProjectPath
(
env
,
os
.
path
.
normpath
(
i
)).
replace
(
'
\\
'
,
'/'
))
for
i
in
project
[
'CPPPATH'
]]
for
tool
in
tools
:
if
tool
.
get
(
'id'
).
find
(
'c.compile'
)
!=
1
:
options
=
tool
.
findall
(
'option'
)
include_paths_option
=
None
include_files_option
=
None
defs_option
=
None
# find all compile options
for
option
in
options
:
if
option
.
get
(
'id'
).
find
(
'c.compiler.include.paths'
)
!=
-
1
or
option
.
get
(
'id'
).
find
(
'c.compiler.option.includepaths'
)
!=
-
1
:
# find all of paths in this project
include_paths
=
option
.
findall
(
'listOptionValue'
)
project_paths
=
[]
for
item
in
include_paths
:
if
reset
is
True
:
# clean all old configuration
option
.
remove
(
item
)
else
:
project_paths
+=
[
item
.
get
(
'value'
)]
if
len
(
project_paths
)
>
0
:
cproject_paths
=
set
(
paths
)
-
set
(
project_paths
)
else
:
cproject_paths
=
paths
# print('c.compiler.include.paths')
cproject_paths
=
sorted
(
cproject_paths
)
for
item
in
cproject_paths
:
SubElement
(
option
,
'listOptionValue'
,
{
'builtIn'
:
'false'
,
'value'
:
item
})
if
option
.
get
(
'id'
).
find
(
'c.compiler.defs'
)
!=
-
1
or
option
.
get
(
'id'
).
find
(
'c.compiler.option.definedsymbols'
)
!=
-
1
:
defs
=
option
.
findall
(
'listOptionValue'
)
project_defs
=
[]
for
item
in
defs
:
if
reset
is
True
:
# clean all old configuration
option
.
remove
(
item
)
else
:
project_defs
+=
[
item
.
get
(
'value'
)]
if
len
(
project_defs
)
>
0
:
cproject_defs
=
set
(
CPPDEFINES
)
-
set
(
project_defs
)
include_paths_option
=
option
elif
option
.
get
(
'id'
).
find
(
'c.compiler.include.files'
)
!=
-
1
or
option
.
get
(
'id'
).
find
(
'c.compiler.option.includefiles'
)
!=
-
1
:
include_files_option
=
option
elif
option
.
get
(
'id'
).
find
(
'c.compiler.defs'
)
!=
-
1
or
option
.
get
(
'id'
).
find
(
'c.compiler.option.definedsymbols'
)
!=
-
1
:
defs_option
=
option
# change the inclue path
if
include_paths_option
is
not
None
:
option
=
include_paths_option
# find all of paths in this project
include_paths
=
option
.
findall
(
'listOptionValue'
)
for
item
in
include_paths
:
if
reset
is
True
or
IsRttEclipsePathFormat
(
item
.
get
(
'value'
))
:
# clean old configuration
option
.
remove
(
item
)
# print('c.compiler.include.paths')
paths
=
sorted
(
paths
)
for
item
in
paths
:
SubElement
(
option
,
'listOptionValue'
,
{
'builtIn'
:
'false'
,
'value'
:
item
})
# change the inclue files (default) or definitions
if
include_files_option
is
not
None
:
option
=
include_files_option
file_header
=
'''
#ifndef RTCONFIG_PREINC_H__
#define RTCONFIG_PREINC_H__
/* Automatically generated file; DO NOT EDIT. */
/* RT-Thread pre-include file */
'''
file_tail
=
'
\n
#endif /*RTCONFIG_PREINC_H__*/
\n
'
rtt_pre_inc_item
=
'"${workspace_loc:/${ProjName}/rtconfig_preinc.h}"'
# save the CPPDEFINES in to rtconfig_preinc.h
with
open
(
'rtconfig_preinc.h'
,
mode
=
'w+'
)
as
f
:
f
.
write
(
file_header
)
for
cppdef
in
CPPDEFINES
:
f
.
write
(
"#define "
+
cppdef
+
'
\n
'
)
f
.
write
(
file_tail
)
# change the c.compiler.include.files
files
=
option
.
findall
(
'listOptionValue'
)
find_ok
=
False
for
item
in
files
:
if
item
.
get
(
'value'
)
==
rtt_pre_inc_item
:
find_ok
=
True
break
if
find_ok
is
False
:
SubElement
(
option
,
'listOptionValue'
,
{
'builtIn'
:
'false'
,
'value'
:
rtt_pre_inc_item
})
elif
defs_option
is
not
None
:
option
=
defs_option
defs
=
option
.
findall
(
'listOptionValue'
)
project_defs
=
[]
for
item
in
defs
:
if
reset
is
True
:
# clean all old configuration
option
.
remove
(
item
)
else
:
cproject_defs
=
CPPDEFINES
project_defs
+=
[
item
.
get
(
'value'
)]
if
len
(
project_defs
)
>
0
:
cproject_defs
=
set
(
CPPDEFINES
)
-
set
(
project_defs
)
else
:
cproject_defs
=
CPPDEFINES
# print('c.compiler.defs')
cproject_defs
=
sorted
(
cproject_defs
)
for
item
in
cproject_defs
:
SubElement
(
option
,
'listOptionValue'
,
{
'builtIn'
:
'false'
,
'value'
:
item
})
# print('c.compiler.defs')
cproject_defs
=
sorted
(
cproject_defs
)
for
item
in
cproject_defs
:
SubElement
(
option
,
'listOptionValue'
,
{
'builtIn'
:
'false'
,
'value'
:
item
})
if
tool
.
get
(
'id'
).
find
(
'c.linker'
)
!=
-
1
:
options
=
tool
.
findall
(
'option'
)
...
...
@@ -187,7 +226,7 @@ def HandleToolOption(tools, env, project, reset):
items
=
env
[
'LINKFLAGS'
].
split
(
' '
)
if
'-T'
in
items
:
linker_script
=
items
[
items
.
index
(
'-T'
)
+
1
]
linker_script
=
ConverToEclipsePathFormat
(
linker_script
)
linker_script
=
ConverTo
Rtt
EclipsePathFormat
(
linker_script
)
listOptionValue
=
option
.
find
(
'listOptionValue'
)
if
listOptionValue
!=
None
:
...
...
@@ -199,7 +238,7 @@ def HandleToolOption(tools, env, project, reset):
if
option
.
get
(
'id'
).
find
(
'c.linker.option.script'
)
!=
-
1
:
items
=
env
[
'LINKFLAGS'
].
split
(
' '
)
if
'-T'
in
items
:
linker_script
=
ConverToEclipsePathFormat
(
items
[
items
.
index
(
'-T'
)
+
1
]).
strip
(
'"'
)
linker_script
=
ConverTo
Rtt
EclipsePathFormat
(
items
[
items
.
index
(
'-T'
)
+
1
]).
strip
(
'"'
)
option
.
set
(
'value'
,
linker_script
)
# update nostartfiles config
...
...
@@ -262,6 +301,7 @@ def UpdateProjectStructure(env, prj_name):
return
def
GenExcluding
(
env
,
project
):
rtt_root
=
os
.
path
.
abspath
(
env
[
'RTT_ROOT'
])
bsp_root
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
...
...
@@ -273,7 +313,17 @@ def GenExcluding(env, project):
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
exclude_paths
=
ExcludePaths
(
bsp_root
,
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
)
...
...
@@ -292,15 +342,16 @@ def GenExcluding(env, project):
exclude_paths
+=
[
path
]
exclude_paths
=
[
RelativeProjectPath
(
env
,
path
).
replace
(
'
\\
'
,
'/'
)
for
path
in
exclude_paths
]
env
[
'ExPaths'
]
=
exclude_paths
all_files
=
CollectFiles
(
all_paths
,
source_pattern
)
src_files
=
project
[
'FILES'
]
exclude_files
=
ExcludeFiles
(
all_files
,
src_files
)
exclude_files
=
[
RelativeProjectPath
(
env
,
file
).
replace
(
'
\\
'
,
'/'
)
for
file
in
exclude_files
]
env
[
'ExPaths'
]
=
exclude_paths
env
[
'ExFiles'
]
=
exclude_files
return
exclude_paths
+
exclude_files
...
...
@@ -315,7 +366,7 @@ def RelativeProjectPath(env, path):
return
'rt-thread/'
+
_make_path_relative
(
rtt_root
,
path
)
# TODO add others folder
print
(
'ERROR: the '
+
path
+
'not support'
)
print
(
'ERROR: the '
+
path
+
'
not support'
)
return
path
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录