Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天中雨水
rt-thread
提交
9b7971e8
R
rt-thread
项目概览
天中雨水
/
rt-thread
该项目与 Fork 源项目分叉
Fork自
RT-Thread / rt-thread
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9b7971e8
编写于
1月 18, 2021
作者:
Y
yaxing.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add dist-ide support for all bsp
上级
f2bfd346
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
399 addition
and
23 deletion
+399
-23
tools/eclipse.py
tools/eclipse.py
+60
-23
tools/studio.py
tools/studio.py
+339
-0
未找到文件。
tools/eclipse.py
浏览文件 @
9b7971e8
...
...
@@ -9,23 +9,21 @@
# 2019-04-15 armink fix project update error
#
import
os
import
sys
import
glob
from
utils
import
*
from
utils
import
_make_path_relative
from
utils
import
xml_indent
import
xml.etree.ElementTree
as
etree
from
xml.etree.ElementTree
import
SubElement
import
studio
from
building
import
*
from
utils
import
*
from
utils
import
_make_path_relative
from
utils
import
xml_indent
MODULE_VER_NUM
=
5
MODULE_VER_NUM
=
6
source_pattern
=
[
'*.c'
,
'*.cpp'
,
'*.cxx'
,
'*.s'
,
'*.S'
,
'*.asm'
]
def
OSPath
(
path
):
import
platform
...
...
@@ -60,9 +58,12 @@ def CollectPaths(paths):
all_paths
=
list
(
set
(
all_paths
))
return
sorted
(
all_paths
)
'''
Collect all of files under paths
'''
def
CollectFiles
(
paths
,
pattern
):
files
=
[]
for
path
in
paths
:
...
...
@@ -75,6 +76,7 @@ def CollectFiles(paths, pattern):
return
sorted
(
files
)
def
CollectAllFilesinPath
(
path
,
pattern
):
files
=
[]
...
...
@@ -93,11 +95,14 @@ def CollectAllFilesinPath(path, pattern):
files
=
files
+
CollectAllFilesinPath
(
os
.
path
.
join
(
path
,
item
),
pattern
)
return
files
'''
Exclude files from infiles
'''
def
ExcludeFiles
(
infiles
,
files
):
in_files
=
set
([
OSPath
(
file
)
for
file
in
infiles
])
in_files
=
set
([
OSPath
(
file
)
for
file
in
infiles
])
exl_files
=
set
([
OSPath
(
file
)
for
file
in
files
])
exl_files
=
in_files
-
exl_files
...
...
@@ -136,9 +141,10 @@ def ConverToRttEclipsePathFormat(path):
def
IsRttEclipsePathFormat
(
path
):
if
path
.
startswith
(
rtt_path_prefix
):
return
True
else
:
else
:
return
False
# all libs added by scons should be ends with five whitespace as a flag
rtt_lib_flag
=
5
*
" "
...
...
@@ -152,12 +158,12 @@ def IsRttEclipseLibFormat(path):
return
True
else
:
return
False
def
IsCppProject
():
return
GetDepend
(
'RT_USING_CPLUSPLUS'
)
def
HandleToolOption
(
tools
,
env
,
project
,
reset
):
is_cpp_prj
=
IsCppProject
()
BSP_ROOT
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
...
...
@@ -358,7 +364,7 @@ def UpdateProjectStructure(env, prj_name):
out
=
open
(
'.project'
,
'w'
)
out
.
write
(
'<?xml version="1.0" encoding="UTF-8"?>
\n
'
)
xml_indent
(
root
)
out
.
write
(
etree
.
tostring
(
root
,
encoding
=
'utf-8'
))
out
.
write
(
etree
.
tostring
(
root
,
encoding
=
'utf-8'
))
out
.
close
()
return
...
...
@@ -384,8 +390,8 @@ def GenExcluding(env, project):
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
)
:
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
]]
...
...
@@ -420,16 +426,16 @@ def GenExcluding(env, project):
env
[
'ExPaths'
]
=
exclude_paths
env
[
'ExFiles'
]
=
exclude_files
return
exclude_paths
+
exclude_files
return
exclude_paths
+
exclude_files
def
RelativeProjectPath
(
env
,
path
):
project_root
=
os
.
path
.
abspath
(
env
[
'BSP_ROOT'
])
rtt_root
=
os
.
path
.
abspath
(
env
[
'RTT_ROOT'
])
if
path
.
startswith
(
project_root
):
return
_make_path_relative
(
project_root
,
path
)
if
path
.
startswith
(
rtt_root
):
return
'rt-thread/'
+
_make_path_relative
(
rtt_root
,
path
)
...
...
@@ -447,9 +453,9 @@ def HandleExcludingOption(entry, sourceEntries, excluding):
value
=
''
for
item
in
old_excluding
:
if
item
.
startswith
(
'//'
)
:
if
item
.
startswith
(
'//'
):
old_excluding
.
remove
(
item
)
else
:
else
:
if
value
==
''
:
value
=
item
else
:
...
...
@@ -498,13 +504,44 @@ def UpdateCproject(env, project, excluding, reset, prj_name):
out
.
close
()
def
TargetEclipse
(
env
,
reset
=
False
,
prj_name
=
None
):
def
TargetEclipse
(
env
,
reset
=
False
,
prj_name
=
None
):
global
source_pattern
print
(
'Update eclipse setting...'
)
# generate cproject file
if
not
os
.
path
.
exists
(
'.cproject'
):
print
(
'no eclipse CDT project found!'
)
if
studio
.
gen_cproject_file
(
os
.
path
.
abspath
(
".cproject"
))
is
False
:
print
(
'Fail!'
)
return
# generate project file
if
not
os
.
path
.
exists
(
'.project'
):
if
studio
.
gen_project_file
(
os
.
path
.
abspath
(
".project"
))
is
False
:
print
(
'Fail!'
)
return
# generate projcfg.ini file
if
not
os
.
path
.
exists
(
'.settings/projcfg.ini'
):
if
os
.
path
.
exists
(
"template.uvprojx"
):
file
=
os
.
path
.
abspath
(
"template.uvprojx"
)
else
:
file
=
os
.
path
.
abspath
(
"template.uvproj"
)
chip_name
=
studio
.
get_mcu_info
(
file
)
if
studio
.
gen_projcfg_ini_file
(
chip_name
,
prj_name
,
os
.
path
.
abspath
(
".settings/projcfg.ini"
))
is
False
:
print
(
'Fail!'
)
return
# enable lowwer .s file compiled in eclipse cdt
if
not
os
.
path
.
exists
(
'.settings/org.eclipse.core.runtime.prefs'
):
if
studio
.
gen_org_eclipse_core_runtime_prefs
(
os
.
path
.
abspath
(
".settings/org.eclipse.core.runtime.prefs"
))
is
False
:
print
(
'Fail!'
)
return
# add clean2 target to fix issues when files too many
if
studio
.
gen_makefile_targets
(
os
.
path
.
abspath
(
"makefile.targets"
))
is
False
:
print
(
'Fail!'
)
return
project
=
ProjectInfo
(
env
)
...
...
tools/studio.py
0 → 100644
浏览文件 @
9b7971e8
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录