-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
125 lines (101 loc) · 3.13 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
124
125
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.0.21"
id("org.jetbrains.dokka") version "1.9.20"
id("io.github.goooler.shadow") version "8.1.8"
java
jacoco
`maven-publish`
}
group = "io.codemc.api"
version = "1.0.2"
description = "Official API for CodeMC Jenkins & Nexus Services"
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
implementation("io.github.cdancy:jenkins-rest:1.0.2")
implementation("org.mariadb.jdbc:mariadb-java-client:3.5.0")
implementation("org.jetbrains.exposed:exposed-core:0.56.0")
implementation("org.jetbrains.exposed:exposed-jdbc:0.56.0")
testImplementation(kotlin("test"))
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
}
tasks {
clean {
delete("bin")
}
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
jar.configure {
dependsOn("shadowJar")
archiveClassifier.set("raw")
}
withType<ShadowJar> {
archiveFileName.set("${project.name}-${project.version}.jar")
archiveClassifier.set("")
}
test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
}
finalizedBy(jacocoTestReport)
}
jacocoTestReport {
dependsOn(test)
reports {
csv.required.set(false)
xml.required.set(true)
xml.outputLocation.set(layout.buildDirectory.file("jacoco.xml"))
html.required.set(true)
html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml"))
}
}
}
artifacts {
add("default", tasks.getByName<ShadowJar>("shadowJar"))
}
publishing {
publications {
create<MavenPublication>("maven") {
artifactId = project.name
pom {
description.set(project.description)
licenses {
license {
name.set("MIT")
url.set("https://github.com/CodeMC/API/blob/master/LICENSE")
}
}
}
from(components["java"])
}
}
repositories {
maven {
credentials {
username = System.getenv("JENKINS_USERNAME")
password = System.getenv("JENKINS_PASSWORD")
}
isAllowInsecureProtocol = true
val releases = "https://repo.codemc.io/repository/maven-releases/"
val snapshots = "https://repo.codemc.io/repository/maven-snapshots/"
url = uri(project.findProperty("repositoryURL") ?: if (version.toString().endsWith("SNAPSHOT")) snapshots else releases)
}
}
}