build.gradle 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // AndroidProject 版本:v13.0
  2. // 导入配置文件
  3. apply from : 'configs.gradle'
  4. buildscript {
  5. // 导入通用的 Maven 库配置
  6. apply from : 'maven.gradle'
  7. repositories {
  8. // 阿里云云效仓库(Gradle 插件):https://maven.aliyun.com/mvn/guide
  9. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  10. addCommonMaven(repositories)
  11. }
  12. // Studio 插件推荐:https://github.com/getActivity/StudioPlugins
  13. dependencies {
  14. // Gradle 插件版本说明:https://developer.android.google.cn/studio/releases/gradle-plugin.html#updating-plugin
  15. // noinspection GradleDependency
  16. classpath 'com.android.tools.build:gradle:4.1.2'
  17. // AOP 配置插件:https://github.com/HujiangTechnology/gradle_plugin_android_aspectjx
  18. classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10'
  19. }
  20. }
  21. allprojects {
  22. repositories {
  23. // 友盟远程仓库:https://info.umeng.com/detail?id=443&cateId=1
  24. maven { url 'https://repo1.maven.org/maven2' }
  25. addCommonMaven(repositories)
  26. }
  27. tasks.withType(JavaCompile) {
  28. // 设置全局编码
  29. options.encoding = 'UTF-8'
  30. }
  31. tasks.withType(Javadoc) {
  32. // 设置文档编码
  33. options {
  34. encoding 'UTF-8'
  35. charSet 'UTF-8'
  36. links 'http://docs.oracle.com/javase/7/docs/api'
  37. }
  38. }
  39. // 将构建文件统一输出到项目根目录下的 build 文件夹
  40. setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
  41. }
  42. task clean(type: Delete) {
  43. delete rootProject.buildDir
  44. }