What does the command quot;Fix Project Propertiesquot; exactly do?(“修复项目属性命令是什么意思?究竟是做什么的?)
问题描述
Project->Android Tools->Fix Project Properties"Eclipse命令exaclty有什么作用?
What does the "Project->Android Tools->Fix Project Properties" Eclipse command exaclty do?
我已经阅读了很多次使用它,主要是在与 Eclipse 中的 Android R 生成问题相关的答案中,但对我来说它就像魔术一样,我按下它,我想它修复了一些项目属性,但没有任何反应... 没有视觉反馈,没有关于修复了哪些项目属性的信息......任何人都可以对它究竟做了什么提供一些见解?
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?
谢谢
推荐答案
通过查看 ADT 源代码,特别是 FixProjectAction 并阅读我们的源代码和评论可以看到它调用了:
By looking into ADT source code, specifically into FixProjectAction and reading source and comments we can see that it calls:
ProjectHelper.fixProject(project);
ProjectHelper.fixProjectNatureOrder(project);
AndroidNature.configureResourceManagerBuilder(project);
AndroidNature.configurePreBuilder(project);
AndroidNature.configureApkBuilder(project);
ProjectHelper.fixProject(project) 做:
- 创建 Java 项目
- 修复类路径条目以确保:
- 该项目未引用任何旧的 android.zip/android.jar 存档
- 项目不使用其输出文件夹作为源文件夹
- 该项目未引用桌面 JRE
- 项目引用了 AndroidClasspathContainer.
ProjectHelper.fixProjectNatureOrder(project) 重新排序项目性质,使Android项目性质优先.
ProjectHelper.fixProjectNatureOrder(project) reorders project natures, so that Android project nature is first.
AndroidNature.configureResourceManagerBuilder(project) 添加 ResourceManagerBuilder,如果它不存在的话.它将自己作为第一个构建器插入.
AndroidNature.configureResourceManagerBuilder(project) adds the ResourceManagerBuilder, if its not already there. It'll insert itself as the first builder.
AndroidNature.configurePreBuilder(project) 如果 PreCompilerBuilder 不存在,则添加它.它会检查 ResourceManager 的存在并在之后立即插入.
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) 如果 .apk 构建器不存在,则在末尾添加.
AndroidNature.configureApkBuilder(project) adds the .apk builder at the end if it's not already there.
最后三个调用可确保您的项目具有正确的构建器.当您查看 Eclipse 项目属性中的 Builders 部分时,您会看到:
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:
- Android 资源管理器优先
- 资源管理器之后的 Android 预编译器
- Android Package Builder 最后
这篇关于“修复项目属性"命令是什么意思?究竟是做什么的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“修复项目属性"命令是什么意思?究竟是做什么的?
基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 降序排序:Java Map 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01