-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
83 lines (70 loc) · 1.88 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
plugins {
java
`maven-publish`
checkstyle
}
repositories {
mavenLocal()
maven {
url = uri("http://repo.maven.apache.org/maven2")
}
}
dependencies {
implementation("commons-cli:commons-cli:${Versions.commonsCli}")
implementation("jline:jline:${Versions.jline}")
implementation("org.json:json:${Versions.json}")
implementation("javax.xml.bind:jaxb-api:${Versions.jaxbApi}")
}
java {
withSourcesJar()
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
checkstyle {
// maxWarnings = 0
}
val projectGroup: String by project
val projectVersion: String by project
val projectDescription: String by project
group = projectGroup
version = projectVersion
description = projectDescription
tasks.withType<Checkstyle>().configureEach {
reports {
xml.isEnabled = true
html.isEnabled = true
html.stylesheet = resources.text.fromFile("config/xsl/checkstyle-noframes-severity-sorted.xsl")
}
}
tasks.withType(Javadoc::class) {
setFailOnError(false)
}
tasks.withType<Jar> {
manifest {
attributes(
"Main-Class" to "${projectGroup}.Driver",
"Built-By" to System.getProperty("user.name"),
"Created-By" to "Gradle ${gradle.gradleVersion}",
"Build-Jdk" to JavaVersion.current()
)
}
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar")}.map { zipTree(it)}
})
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
// options.isWarnings = true
}
publishing {
publications.withType<MavenPublication> {
// artifact(sourcesJar.get())
pom {
name.set(project.name)
description.set(project.description)
}
}
}