4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-31 07:40:35 +08:00

Merge pull request #4269 from margguo/feature/use_studio_project_file_template

Feature/use studio project file template
This commit is contained in:
Bernard Xiong 2021-01-26 23:23:30 +08:00 committed by GitHub
commit 03ebd19a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ import re
from string import Template from string import Template
import rtconfig import rtconfig
import shutil
cproject_temp = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> cproject_temp = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
@ -272,6 +273,14 @@ def gen_org_eclipse_core_runtime_prefs(output_file_path):
def gen_cproject_file(output_file_path): def gen_cproject_file(output_file_path):
template_file_path = os.path.join(os.path.dirname(output_file_path), "template.cproject")
if os.path.exists(template_file_path):
try:
shutil.copy(template_file_path, output_file_path)
except Exception as e:
print(e)
return True
else:
CFLAGS = rtconfig.CFLAGS CFLAGS = rtconfig.CFLAGS
AFLAGS = rtconfig.AFLAGS AFLAGS = rtconfig.AFLAGS
LFLAGS = rtconfig.LFLAGS LFLAGS = rtconfig.LFLAGS