-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
90 lines (69 loc) · 2.07 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
plugins {
`java-library`
checkstyle
`maven-publish`
}
subprojects {
group = "io.github.mela"
apply(plugin = "maven-publish")
apply(plugin = "java-library")
apply(plugin = "checkstyle")
repositories {
mavenCentral()
jcenter()
}
dependencies {
testImplementation(Dependencies.junitApi)
testImplementation(Dependencies.junitEngine)
}
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")
}
}
publishing {
publications {
create<MavenPublication>(name) {
groupId = "io.github.mela"
artifactId = "mela-command-$name"
println([email protected]())
version = [email protected]()
from(components["java"])
}
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}