-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
60 lines (52 loc) · 1.3 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
import java.util.*
plugins {
id("java")
id("maven-publish")
}
group = "moe.caramel"
version = "1.0-SNAPSHOT"
val javaVersion = 17
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
withSourcesJar()
withJavadocJar()
}
/* Dependencies */
repositories {
mavenCentral()
}
dependencies {
implementation("javax.annotation", "javax.annotation-api", "1.3.2")
implementation("org.jetbrains", "annotations", "24.1.0")
}
/* Tasks */
tasks {
compileJava {
options.encoding = "UTF-8"
options.release.set(javaVersion)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
}
/* Publish */
val isSnapshot = project.version.toString().endsWith("-SNAPSHOT")
configure<PublishingExtension> {
repositories.maven {
name = "maven"
url = uri("https://repo.caramel.moe/repository/maven-" + (if (isSnapshot) "snapshots" else "releases") + "/")
credentials {
username = System.getenv("DEPLOY_ID")
password = System.getenv("DEPLOY_PW")
}
}
publications.create<MavenPublication>("maven") {
artifactId = project.name.lowercase(Locale.ENGLISH)
from(components["java"])
}
}