// Top-level build file where you can add configuration options common to all sub-projects/modules. apply from: "config.gradle" buildscript { apply from : 'maven.gradle' repositories { maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } addCommonMaven(repositories) } dependencies { classpath "com.android.tools.build:gradle:4.2.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { flatDir { dirs 'libs' } addCommonMaven(repositories) } tasks.withType(JavaCompile) { // 设置全局编码 options.encoding = 'UTF-8' } tasks.withType(Javadoc) { // 设置文档编码 options { encoding 'UTF-8' charSet 'UTF-8' links 'http://docs.oracle.com/javase/7/docs/api' } } // 将构建文件统一输出到项目根目录下的 build 文件夹 setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}")) } task clean(type: Delete) { delete rootProject.buildDir }