update the template for projcfg.ini in rt-studio (#5630)

* update the template for projcfg.ini in rt-studio

* update the template for projcfg.ini in rt-studio

Co-authored-by: ErikChan <“1043490933@qq.com>
This commit is contained in:
ErikChanGit 2022-03-21 09:35:44 +08:00 committed by GitHub
parent ee10516544
commit f3b72aa179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 23 deletions

View File

@ -4,6 +4,7 @@ from string import Template
import rtconfig import rtconfig
import shutil import shutil
import time
# version # version
MODULE_VER_NUM = 1 MODULE_VER_NUM = 1
@ -200,27 +201,25 @@ project_temp = """<?xml version="1.0" encoding="UTF-8"?>
</projectDescription>""" </projectDescription>"""
projcfg_ini_temp = """#RT-Thread Studio Project Configuration projcfg_ini_temp = """#RT-Thread Studio Project Configuration
#Sat Jan 16 15:18:32 CST 2021 # $time
project_type=rtt
chip_name=${chip_name}
cpu_name=None
target_freq=
clock_source=
dvendor_name=
rx_pin_name=
rtt_path=
source_freq=
csp_path=
sub_series_name=
selected_rtt_version=latest
cfg_version=v3.0 cfg_version=v3.0
tool_chain=gcc
uart_name= board_name=
tx_pin_name= bsp_version=
rtt_nano_path= bsp_path=
output_project_path= chip_name=
hardware_adapter=J-Link project_base_rtt_bsp=true
project_name=${project_name}""" is_use_scons_build=true
hardware_adapter=
selected_rtt_version=latest
board_base_nano_proj=false
is_base_example_project=false
example_name=
project_type=rt-thread
os_branch=master
os_version=latest
project_name=$project_name
output_project_path=$output_project_path"""
eclipse_core_runtime_temp = """content-types/enabled=true eclipse_core_runtime_temp = """content-types/enabled=true
content-types/org.eclipse.cdt.core.asmSource/file-extensions=s content-types/org.eclipse.cdt.core.asmSource/file-extensions=s
@ -338,9 +337,9 @@ def gen_project_file(output_file_path):
def gen_projcfg_ini_file(chip_name, project_name, output_file_path): def gen_projcfg_ini_file(chip_name, project_name, output_file_path):
try: try:
projcfg_file_tmp = Template(projcfg_ini_temp) projcfg_file_tmp = Template(projcfg_ini_temp)
w_str = projcfg_file_tmp.substitute(project_name=project_name, w_str = projcfg_file_tmp.substitute(time=time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()),
chip_name=(chip_name)) project_name=project_name,
output_project_path=os.path.abspath(""))
dir_name = os.path.dirname(output_file_path) dir_name = os.path.dirname(output_file_path)
if not os.path.exists(dir_name): if not os.path.exists(dir_name):
os.makedirs(dir_name) os.makedirs(dir_name)