-
Notifications
You must be signed in to change notification settings - Fork 170
/
build.gradle
142 lines (112 loc) · 3.62 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
ext {
versions = [
profile : System.getProperty("env") ?: "dev",
nettyVersion : "4.1.33.Final",
minaVersion : "2.0.7",
springBootVersion : '3.0.4',
gsonVersion : "2.8.0",
mysqlVersion : "8.0.28",
jacksonVersion : "2.12.1",
protostuffVersion : "1.5.9",
protobufVersion : "1.11.7",
jforgameVersion : "1.2.0",
]
dependencyPool = [
nettyVersion : "4.1.33.Final",
// springboot : "org.springframework.boot:spring-boot-dependencies:${versions.springBootVersion}",
commonslang3: "org.apache.commons:commons-lang3:3.4",
lombok: 'org.projectlombok:lombok:1.18.30',
// annotationProcessor 'org.projectlombok:lombok:1.18.30'
gson: "com.google.code.gson:gson:${versions.gsonVersion}",
netty: "io.netty:netty-all:${versions.nettyVersion}",
minacore: "org.apache.mina:mina-core:${versions.minaVersion}",
jackson: "com.fasterxml.jackson.core:jackson-databind:${versions.jacksonVersion}",
jprotobuf: "com.baidu:jprotobuf:${versions.protobufVersion}",
protostuffcore: "io.protostuff:protostuff-core:${versions.protostuffVersion}",
protostuffruntime: "io.protostuff:protostuff-runtime:${versions.protostuffVersion}",
mysql: "mysql:mysql-connector-java:${versions.mysqlVersion}",
groovy: 'org.codehaus.groovy:groovy-all:2.4.11',
guava: 'com.google.guava:guava:30.1-jre',
junit: 'junit:junit:4.12'
]
}
allprojects {
group = "org.forfun.mmorpg"
version = 1.0
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "java"
task clearTemp(type: Delete) {
delete "${projectDir}/build"
delete "${projectDir}/out"
}
}
subprojects {
ext.configDir = new File(rootDir, "check")
//apply from: "$rootDir/check/checkstyle/checkstyle.gradle"
//apply from: "$rootDir/check/pmd/pmd.gradle"
apply plugin: "java-library"
dependencies {
// compileOnly dependencies.lombok
// annotationProcessor ext.dependencies.lombok
testImplementation dependencyPool.junit
}
}
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://repo.spring.io/libs-milestone' }
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:3.0.4")
}
}
configure(allprojects) { project ->
apply plugin: "java"
apply plugin: "java-library"
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"]
//"-Xlint:deprecation", "-Werror"
compileJava.options*.compilerArgs = commonCompilerArgs +
["-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes",
"-Xlint:unchecked"]
compileTestJava.options*.compilerArgs = commonCompilerArgs +
["-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
"-Xlint:-deprecation", "-Xlint:-unchecked"]
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
options.encoding = "UTF-8"
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
options.encoding = "UTF-8"
options.compilerArgs += "-parameters"
}
repositories {
mavenLocal()
mavenCentral()
}
eclipse {
classpath {
downloadJavadoc = false
downloadSources = true
}
}
// apply plugin: 'findbugs'
// findbugs {
// toolVersion == '2.0.1'
// ignoreFailures = true
// effort = 'max'
// }
// tasks.withType(FindBugs) {
// reports {
// xml.enabled = false
// html.enabled = true
// }
// }
}