-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle.kts
65 lines (57 loc) · 1.79 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
plugins {
`java-library`
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1"
}
group = "dev.jaqobb"
version = "3.0.1"
description = "Lightweight, straightforward, easy-to-use and fast NameMC Java wrapper"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.googlecode.json-simple:json-simple:1.1.1") {
exclude(group = "junit", module = "junit")
}
testImplementation(platform("org.junit:junit-bom:5.11.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.awaitility:awaitility:4.2.2")
}
tasks.shadowJar {
relocate("org.json.simple", "dev.jaqobb.namemc.library.org.json.simple")
}
tasks.register<Jar>("sourcesJar") {
from(sourceSets["main"].allSource)
archiveClassifier.set("sources")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
publishing {
repositories {
maven {
name = if (!project.version.toString().endsWith("SNAPSHOT")) "jaqobbRepositoryReleases" else "jaqobbRepositorySnapshots"
url = if (!project.version.toString().endsWith("SNAPSHOT")) uri("https://repository.jaqobb.dev/releases") else uri("https://repository.jaqobb.dev/snapshots")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
artifact(tasks["sourcesJar"])
}
}
}