命令“修复项目属性”真的吗? [英] What does the command "Fix Project Properties" exactly do?
问题描述
我已经阅读了很多次使用它,主要是在答案中与Eclipse中的Android R代相关的问题,但对我来说,它就像魔术一样,我按它,我想它修复了一些项目属性,但没有发生任何事情...没有视觉反馈,没有关于哪个项目属性被修复的信息。任何人都可以给出一点洞察力,它究竟做了什么?
Thx
通过查看ADT源代码, FixProjectAction ,并阅读源代码和评论,我们可以看到它调用:
ProjectHelper.fixProject(项目);
ProjectHelper.fixProjectNatureOrder(project);
AndroidNature.configureResourceManagerBuilder(project);
AndroidNature.configurePreBuilder(project);
AndroidNature.configureApkBuilder(project);
ProjectHelper.fixProject(project)确实:
- 创建Java项目
- 修复类路径条目以确保:
- 该项目不引用任何旧的android.zip/android.jar存档
- 该项目不使用其输出文件夹作为一个sourc文件夹
- 该项目不引用桌面JRE
- 该项目引用了AndroidClasspathContainer。
AndroidNature.configureResourceManagerBuilder(project)添加ResourceManagerBuilder,如果它不已经在那了。它将自己插入第一个构建器。 AndroidNature.configurePreBuilder(project)添加PreCompilerBuilder如果它还没有。它将检查ResourceManager的存在并立即插入。 AndroidNature.configureApkBuilder(project) / a>如果还没有,则将.apk构建器添加到最后。 最后三个调用确保您的项目具有正确的构建器。当您查看eclipse项目属性中的Builders部分时,您将看到: What does the "Project->Android Tools->Fix Project Properties" Eclipse command exaclty do? I have read many times to use it, mostly in answers related with Android R generation problems in Eclipse, but for me it is like magic, I press on it and I suppose it Fixs some Project Properties, but nothing happens... no visual feedback, no info on which project properties has been fixed... anyone can give a bit of insight on what does it exactly do? Thx By looking into ADT source code, specifically into FixProjectAction and reading source and comments we can see that it calls: ProjectHelper.fixProject(project) does: ProjectHelper.fixProjectNatureOrder(project) reorders project natures, so that Android project nature is first. AndroidNature.configureResourceManagerBuilder(project) adds the ResourceManagerBuilder, if its not already there. It'll insert itself as the first builder. AndroidNature.configurePreBuilder(project) adds the PreCompilerBuilder if its not already there. It'll check for presence of the ResourceManager and insert itself right after. AndroidNature.configureApkBuilder(project) adds the .apk builder at the end if it's not already there. Last three calls ensure that you have correct builder for your project. When you look at your Builders section in eclipse project properties you will see: 这篇关于命令“修复项目属性”真的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
ProjectHelper.fixProject(project);
ProjectHelper.fixProjectNatureOrder(project);
AndroidNature.configureResourceManagerBuilder(project);
AndroidNature.configurePreBuilder(project);
AndroidNature.configureApkBuilder(project);