Intellij Idea&Android Studio中iml文件、modules.xml文件作用

iml文件是所有IntelliJ IDEA都会自动生成的一个文件,(Android Studio是基于IntelliJ IDEA开发的),iml是 intellij idea的工程配置文件,里面是当前projec的一些配置信息

原文地址:http://blog.csdn.NET/zhangbuzhangbu/article/details/52237286
最早使用Android Studio的时候,对这两个文件的使用并不熟悉,因为Studio会帮你管理一切。但对于Intellij Idea来说,一切变得不同,很多对项目的管理都回到了基本层级。下面介绍一下iml文件、modules.xml文件
我们在Intellij Idea中打开modules文件,是这样的

  
<project version="4">  
  <component name="ProjectModuleManager">  
    <modules>  
        
      <module fileurl="file://$PROJECT_DIR$/ExportJar.iml" filepath="$PROJECT_DIR$/ExportJar.iml" />  
      <module fileurl="file://$PROJECT_DIR$/child/child.iml" filepath="$PROJECT_DIR$/child/child.iml" />  
    modules>  
  component>  
project>  

这个文件告诉编译器你要有哪几个子项目,不分主次

而iml文件是这样的

  
<module type="PLUGIN_MODULE" version="4">  
    
  <component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/resources/META-INF/plugin.xml" />
    
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />  
    <content url="file://$MODULE_DIR$">  
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />  
      <sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />  
    content>  
    <orderEntry type="inheritedJdk" />  
    <orderEntry type="sourceFolder" forTests="false" />  
    <orderEntry type="module" module-name="child" />  
  component>  
module>  

一般来说,这两个文件都比较重要,每当项目无法正确加载时,可能就是这两个配置文件出了问题

你可能感兴趣的:(AS,IDE相关配置及利用,idea,android,studio,intellij,idea,android)