Android Studio的project中兩個build.gradle配置的區別


一般創建一個android項目后回出現兩個gradle:

  • build.gradle(Project):用來配置整個工程的
  • build.gradle(app):一個是用來配置app的

    對compile和classpath區別的解釋:

    I’m going to guess that you’re referencing compile and classpath 
    within the dependencies {} block. If that is so, those are dependency 
    Configurations.

    A configuration is simply a named set of dependencies. The compile 
    configuration is created by the Java plugin. The classpath 
    configuration is commonly seen in the buildSrc {} block where one 
    needs to declare dependencies for the build.gradle, itself (for 
    plugins, perhaps).

    classpath的作用:

    buildscript itself needs something to run, use classpath

    complie的作用:

    your project needs something to run, use compile

    https://blog.csdn.net/zsj470785068/article/details/77646249


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM