MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / TargetEclipse

Function TargetEclipse

tools/targets/eclipse.py:529–587  ·  view source on GitHub ↗
(env, reset=False, prj_name=None)

Source from the content-addressed store, hash-verified

527
528
529def TargetEclipse(env, reset=False, prj_name=None):
530 global source_pattern
531
532 print('Update eclipse setting...')
533
534 # generate cproject file
535 if not os.path.exists('.cproject'):
536 if rt_studio.gen_cproject_file(os.path.abspath(".cproject")) is False:
537 print('Fail!')
538 return
539
540 # generate project file
541 if not os.path.exists('.project'):
542 if rt_studio.gen_project_file(os.path.abspath(".project")) is False:
543 print('Fail!')
544 return
545
546 # generate projcfg.ini file
547 if not os.path.exists('.settings/projcfg.ini'):
548 # if search files with uvprojx or uvproj suffix
549 file = ""
550 items = os.listdir(".")
551 if len(items) > 0:
552 for item in items:
553 if item.endswith(".uvprojx") or item.endswith(".uvproj"):
554 file = os.path.abspath(item)
555 break
556 chip_name = rt_studio.get_mcu_info(file)
557 if rt_studio.gen_projcfg_ini_file(chip_name, prj_name, os.path.abspath(".settings/projcfg.ini")) is False:
558 print('Fail!')
559 return
560
561 # enable lowwer .s file compiled in eclipse cdt
562 if not os.path.exists('.settings/org.eclipse.core.runtime.prefs'):
563 if rt_studio.gen_org_eclipse_core_runtime_prefs(
564 os.path.abspath(".settings/org.eclipse.core.runtime.prefs")) is False:
565 print('Fail!')
566 return
567
568 # add clean2 target to fix issues when files too many
569 if not os.path.exists('makefile.targets'):
570 if rt_studio.gen_makefile_targets(os.path.abspath("makefile.targets")) is False:
571 print('Fail!')
572 return
573
574 project = ProjectInfo(env)
575
576 # update the project file structure info on '.project' file
577 UpdateProjectStructure(env, prj_name)
578
579 # generate the exclude paths and files
580 excluding = GenExcluding(env, project)
581
582 # update the project configuration on '.cproject' file
583 UpdateCproject(env, project, excluding, reset, prj_name)
584
585 print('done!')
586

Callers 1

GenTargetProjectFunction · 0.90

Calls 4

UpdateProjectStructureFunction · 0.85
GenExcludingFunction · 0.85
UpdateCprojectFunction · 0.85
ProjectInfoClass · 0.50

Tested by

no test coverage detected