-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
88 lines (75 loc) · 2.43 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
import java.net.URI
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.1.2"
}
version = if (project.hasProperty("version_snapshot")) project.properties["version"] as String + "-SNAPSHOT" else project.properties["version"] as String
group = project.properties["maven_group"] as String
base {
archivesName.set(project.properties["archives_base_name"] as String)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
// spigot maven
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
val shadowImpl by configurations.creating {
configurations.implementation.get().extendsFrom(this)
}
@Suppress("VulnerableLibrariesLocal")
dependencies {
implementation("org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT")
shadowImpl("org.ow2.asm:asm:9.5")
shadowImpl("org.ow2.asm:asm-tree:9.5")
}
tasks.compileJava {
options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible) {
options.release.set(8)
}
}
tasks.jar {
manifest {
attributes(
"Premain-Class" to "xyz.wagyourtail.unimined.cpl.CPLAgent",
"Main-Class" to "xyz.wagyourtail.unimined.cpl.CPLAgent",
"Implementation-Version" to project.version,
)
}
}
tasks.shadowJar {
configurations = listOf(shadowImpl)
relocate("org.objectweb", "xyz.wagyourtail.unimined.cpl.shadow.org.objectweb")
}
publishing {
repositories {
maven {
name = "WagYourMaven"
url = if (project.hasProperty("version_snapshot")) {
URI.create("https://maven.wagyourtail.xyz/snapshots/")
} else {
URI.create("https://maven.wagyourtail.xyz/releases/")
}
credentials {
username = project.findProperty("mvn.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("mvn.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = project.group as String
artifactId = project.properties["archives_base_name"] as String? ?: project.name
version = project.version as String
artifact(tasks["jar"]) {}
artifact(tasks["shadowJar"]) {
classifier = "all"
}
}
}
}