-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
45 lines (38 loc) · 1.22 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
group 'pro'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply from: rootProject.file("file/task_generate_version_file.gradle")
repositories {
mavenCentral()
}
dependencies {
// 加载 libs 文件夹全部 jar
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Gson 解析
implementation 'com.google.code.gson:gson:2.10.1'
// DevJava
implementation 'io.github.afkt:DevJava:1.5.1'
// // tools.jar 的依赖
// implementation files(org.gradle.internal.jvm.Jvm.current().toolsJar)
def toolsJAR = "/lib/tools.jar"
// 获取配置的 JDK 根目录
def homePath = System.properties['java.home']
// 拼接路径
def toolsJARPath = "${homePath}${toolsJAR}"
// 判断是否为 jre 目录
if (homePath.endsWith("jre")) {
toolsJARPath = "${file(homePath).parent}${toolsJAR}"
}
implementation files(toolsJARPath)
// tools.jar 文件路径
println()
println("====================")
println("tools.jar file path => " + toolsJARPath)
println("tools.jar file exists => " + file(toolsJARPath).exists())
println("====================")
println()
}
// 全局编码设置
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}