build.gradle 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. apply from: "config.gradle"
  3. buildscript {
  4. apply from : 'maven.gradle'
  5. repositories {
  6. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  7. addCommonMaven(repositories)
  8. }
  9. dependencies {
  10. classpath "com.android.tools.build:gradle:4.2.0"
  11. // NOTE: Do not place your application dependencies here; they belong
  12. // in the individual module build.gradle files
  13. }
  14. }
  15. allprojects {
  16. repositories {
  17. flatDir {
  18. dirs 'libs'
  19. }
  20. addCommonMaven(repositories)
  21. }
  22. tasks.withType(JavaCompile) {
  23. // 设置全局编码
  24. options.encoding = 'UTF-8'
  25. }
  26. tasks.withType(Javadoc) {
  27. // 设置文档编码
  28. options {
  29. encoding 'UTF-8'
  30. charSet 'UTF-8'
  31. links 'http://docs.oracle.com/javase/7/docs/api'
  32. }
  33. }
  34. // 将构建文件统一输出到项目根目录下的 build 文件夹
  35. setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
  36. }
  37. task clean(type: Delete) {
  38. delete rootProject.buildDir
  39. }