generated from mela-org/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
106 lines (86 loc) · 2.25 KB
/
build.gradle.kts
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
plugins {
`java-library`
pmd
checkstyle
id("com.github.spotbugs") version "1.7.1"
id("io.spring.dependency-management") version "1.0.7.RELEASE"
}
group = "io.github.mela"
version = "1.0.0"
subprojects {
apply(plugin = "java-library")
apply(plugin = "pmd")
apply(plugin = "checkstyle")
apply(plugin = "com.github.spotbugs")
apply(plugin = "io.spring.dependency-management")
group = "com.github.stupremee"
version = "1.0.0"
repositories {
maven("https://repo.spring.io/milestone")
jcenter()
mavenCentral()
}
dependencyManagement {
imports {
mavenBom("io.projectreactor:reactor-bom:${Versions.reactor_bom}")
}
}
dependencies {
spotbugsPlugins("com.h3xstream.findsecbugs:findsecbugs-plugin:1.9.0")
}
tasks {
val sourceSets: SourceSetContainer by project
val sourcesJar by registering(Jar::class) {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
val javadocJar by registering(Jar::class) {
dependsOn(JavaPlugin.JAVADOC_TASK_NAME)
archiveClassifier.set("javadoc")
from(javadoc)
}
artifacts {
add("archives", javadocJar)
add("archives", sourcesJar)
}
build {
dependsOn(jar)
dependsOn(sourcesJar)
dependsOn(javadocJar)
jar.get().mustRunAfter(clean)
sourcesJar.get().mustRunAfter(jar)
}
test {
useJUnitPlatform()
}
checkstyle {
checkstyleTest.get().enabled = false
toolVersion = "8.19"
}
checkstyleMain {
configFile = file("$rootDir/config/checkstyle/google_checks.xml")
configProperties = mapOf("config_loc" to "${rootProject.projectDir}/config/checkstyle")
}
spotbugs {
toolVersion = "4.0.0-beta1"
}
spotbugsMain {
reports {
html.isEnabled = true
xml.isEnabled = false
}
}
pmd {
pmdTest.get().enabled = false
}
pmdMain {
ignoreFailures = true
ruleSetConfig = [email protected](file("${rootProject.projectDir}/config/pmd/ruleset.xml"))
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}