Gradle - zhongjiajie/zhongjiajie.github.com GitHub Wiki
注意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'
}