Gradle - zhongjiajie/zhongjiajie.github.com GitHub Wiki

Gradle

依赖版本添加变量

注意ext要定义在dependencies里面,compile中使用到变量的地方要加双引号

dependencies {
    ext {
        // have to use double quotes in variable field
        // junit
        junitVersion = '4.12'
        // hive udf
        hiveExecVersion = '2.3.4'
        calciteCoreVersion = '1.10.0'
        pentahoVersion = '5.1.5-jhyde'
    }
    // junit
    testCompile group: 'junit', name: 'junit', version: "$junitVersion"
    // hive udf
    compile group: 'org.apache.hive', name: 'hive-exec', version: "$hiveExecVersion"
    compile group: 'org.pentaho', name: 'pentaho-aggdesigner', version: "$pentahoVersion"
    compile group: 'org.apache.calcite', name: 'calcite-core', version: "$calciteCoreVersion"
}

将依赖下载到本地

通过在build.gradle中增加一个tasks完成这个操作

设置编译的编码

tasks.withType(JavaCompile) {
    options.encoding  = 'UTF-8'
}
⚠️ **GitHub.com Fallback** ⚠️