-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
123 lines (105 loc) · 3.87 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
plugins {
`java-library`
alias(libs.plugins.gradleJavaConventions)
}
repositories { mavenCentral() }
group = "com.opencastsoftware"
description = "A Prettier Printer for Java"
java { toolchain.languageVersion.set(JavaLanguageVersion.of(11)) }
dependencies { compileOnlyApi(libs.apiGuardian) }
testing {
suites {
val test by
getting(JvmTestSuite::class) {
dependencies {
implementation(libs.junitJupiter)
implementation(libs.jqwik)
implementation(libs.hamcrest)
implementation(libs.equalsVerifier)
implementation(libs.toStringVerifier)
implementation(libs.apacheCommonsText)
}
}
}
}
mavenPublishing {
coordinates("com.opencastsoftware", "prettier4j", project.version.toString())
pom {
name.set("prettier4j")
description.set(project.description)
url.set("https://github.com/opencastsoftware/prettier4j")
inceptionYear.set("2022")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
organization {
name.set("Opencast Software Europe Ltd")
url.set("https://opencastsoftware.com")
}
developers {
developer {
id.set("DavidGregory084")
name.set("David Gregory")
organization.set("Opencast Software Europe Ltd")
organizationUrl.set("https://opencastsoftware.com/")
timezone.set("Europe/London")
url.set("https://github.com/DavidGregory084")
}
}
ciManagement {
system.set("Github Actions")
url.set("https://github.com/opencastsoftware/prettier4j/actions")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/opencastsoftware/prettier4j/issues")
}
scm {
connection.set("scm:git:https://github.com/opencastsoftware/prettier4j.git")
developerConnection.set("scm:git:[email protected]:opencastsoftware/prettier4j.git")
url.set("https://github.com/opencastsoftware/prettier4j")
}
}
}
tasks.compileJava {
// Target Java 8
options.release.set(8)
}
tasks.withType<Javadoc> {
options {
this as StandardJavadocDocletOptions
addStringOption("-release", "8")
// Only show overridden methods in summary section
addStringOption("-override-methods", "summary")
// Syntax highlighting of snippets
addBooleanOption("-allow-script-in-comments", true)
header(
"""
|<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism-okaidia.min.css">
"""
.trimMargin()
)
footer(
"""
|<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-core.min.js"></script>
|<script src="https://cdn.jsdelivr.net/npm/prismjs@1/plugins/autoloader/prism-autoloader.min.js"></script>
"""
.trimMargin()
)
// JDK documentation links:
// Unfortunately we can't link to JDK8 because JDK11 javadoc
// cannot handle missing element-list file
links("https://docs.oracle.com/en/java/javase/11/docs/api/")
// Javadoc.io links
val compileClasspath by configurations.getting
val javadocIo = "https://www.javadoc.io/doc"
compileClasspath.allDependencies.forEach {
links("$javadocIo/${it.group}/${it.name}/${it.version}/")
}
}
}
tasks.named<Test>("test") { useJUnitPlatform { includeEngines("junit-jupiter", "jqwik") } }