命令“修复项目属性”真的吗? [英] What does the command "Fix Project Properties" exactly do?

查看:147
本文介绍了命令“修复项目属性”真的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经阅读了很多次使用它,主要是在答案中与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部分时,您将看到:




  • Android资源管理器首先

  • 资源管理器之后的Android预编译器

  • Android软件包生成器最后


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);
ProjectHelper.fixProjectNatureOrder(project);
AndroidNature.configureResourceManagerBuilder(project);
AndroidNature.configurePreBuilder(project);
AndroidNature.configureApkBuilder(project);

ProjectHelper.fixProject(project) does:

  • creates Java project
  • fixes classpath entries to ensure that:
    • the project does not reference any old android.zip/android.jar archive
    • the project does not use its output folder as a sourc folder
    • the project does not reference a desktop JRE
    • the project references the AndroidClasspathContainer.

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:

  • Android Resource Manager first
  • Android Pre Compiler after Resource Manager
  • Android Package Builder last

这篇关于命令“修复项目属性”真的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆