-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.gradle
64 lines (54 loc) · 1.9 KB
/
common.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
noArg {
annotation("com.ymy.firefly.common.KotlinNoArg")
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
def commonCompilerArgs = [
"-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann",
"-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options"
]
compileJava.options*.compilerArgs = commonCompilerArgs +
["-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes",
"-Xlint:deprecation", "-Xlint:unchecked", "-Xlint:all"]//, "-Werror"]
compileTestJava.options*.compilerArgs = commonCompilerArgs +
["-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
"-Xlint:-deprecation", "-Xlint:-unchecked"]
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = 'UTF-8'
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = 'UTF-8'
options.compilerArgs += "-parameters"
}
jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = rootProject.name
manifest.attributes["Implementation-Version"] = rootProject.version
manifest.attributes["Built-By"] = System.getProperty('user.name')
manifest.attributes["Built-JDK"] = System.getProperty('java.version')
manifest.attributes["Build-Time"] = new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
}
def profile = System.getProperty("profile") ?: "dev"
sourceSets {
main {
resources {
srcDirs = ["src/main/resources", "src/main/profiles/$profile"]
}
}
}