fix[tools][eclipse]: avoid unnecessary project file rewrites during eclipse target generation#11321
Open
wdfk-prog wants to merge 1 commit intoRT-Thread:masterfrom
Open
fix[tools][eclipse]: avoid unnecessary project file rewrites during eclipse target generation#11321wdfk-prog wants to merge 1 commit intoRT-Thread:masterfrom
wdfk-prog wants to merge 1 commit intoRT-Thread:masterfrom
Conversation
…clipse target generation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
拉取/合并请求描述:(PR description)
为什么提交这份PR (why to submit this PR)
tools/targets/eclipse.py在执行scons --target=eclipse时,会无条件重写.project、.cproject和rtconfig_preinc.h。即使这些文件的内容没有发生变化,文件时间戳也会被刷新。在 Eclipse / RT-Thread Studio 场景下,这可能导致 IDE 误判工程配置或预包含头文件已变更,从而在后续构建时触发不必要的全量编译。
本 PR 的目标是避免这种“内容未变但文件被重复写回”带来的副作用,改善 Eclipse 工程生成后的增量编译体验。
你的解决方案是什么 (what is your solution)
本 PR 在
tools/targets/eclipse.py中引入了“内容变化才写回”的策略:_write_text_if_changed(),用于比较文件新旧内容,只有内容发生变化时才实际写文件_serialize_xml(),统一.project和.cproject的 XML 序列化逻辑rtconfig_preinc.h的生成逻辑改为先在内存中拼接完整内容,再按需写回.project和.cproject的更新逻辑改为序列化后按需写回这样在重复执行
scons --target=eclipse时,若工程配置内容未变化,则不会重复改写这些文件,从而减少因为时间戳变化引发的后续全量重编。请提供验证的bsp和config (provide the config and bsp)
BSP:
tools/targets/eclipse.py,属于主机侧工程文件生成逻辑,不绑定特定 BSP).config:
.config选项,未引入新的 Kconfig 配置项)action:
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up