-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
77 lines (64 loc) · 1.75 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("java")
id("maven-publish")
id("io.freefair.lombok") version "8.10"
id("com.gradleup.shadow") version "8.3.0"
}
object Project {
const val NAME = "MenuAPI"
const val GROUP = "net.j4c0b3y"
const val AUTHOR = "J4C0B3Y"
const val VERSION = "1.4.3"
}
repositories {
mavenCentral()
maven("https://repo.codemc.io/repository/nms/")
}
dependencies {
compileOnly("org.spigotmc:spigot:1.8.8-R0.1-SNAPSHOT")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
tasks {
register<Copy>("copy") {
from(named("shadowJar"))
rename("(.*)-all.jar", "${Project.NAME}-${Project.VERSION}.jar")
into(file("jars"))
}
register("delete") {
file("jars").deleteRecursively()
}
register("install") {
dependsOn(named("publishReleasePublicationToMavenLocal"))
}
named<JavaCompile>("compileJava") {
options.encoding = "UTF-8"
}
}
publishing {
repositories {
maven {
name = "j4c0b3yPublic"
url = uri("https://repo.j4c0b3y.net/public")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("release") {
artifactId = Project.NAME
groupId = Project.GROUP
version = Project.VERSION
artifact(tasks.named<ShadowJar>("shadowJar").get().archiveFile)
artifact(tasks.named<Jar>("sourcesJar").get().archiveFile) {
classifier = "sources"
}
}
}
}