-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
77 lines (63 loc) · 1.91 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
plugins {
id("eclipse")
id("java-library")
id("maven-publish")
}
subprojects {
apply(plugin = "checkstyle")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
group = "wtf.choco"
version = "0.1.1"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
api("org.jetbrains:annotations:24.1.0")
implementation("com.google.guava:guava:33.0.0-jre")
}
tasks {
withType<JavaCompile> {
options.release = 17
options.encoding = Charsets.UTF_8.name()
}
withType<Javadoc> {
val options = (options as org.gradle.external.javadoc.StandardJavadocDocletOptions)
options.encoding = Charsets.UTF_8.name()
options.links("https://docs.oracle.com/en/java/javase/17/docs/api/")
}
withType<Checkstyle> {
configFile = file("${rootDir}/checkstyle.xml")
}
withType<Test> {
useJUnitPlatform()
}
}
publishing {
repositories {
maven {
isAllowInsecureProtocol = true
val repository = if (project.version.toString().endsWith("SNAPSHOT")) "snapshots" else "releases"
url = uri("http://repo.choco.wtf/$repository")
credentials {
username = project.properties["mavenUsername"].toString()
password = project.properties["mavenAccessToken"].toString()
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
}