forked from WolfyScript/CustomCrafting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
163 lines (147 loc) · 5.33 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*
* ____ _ _ ____ ___ ____ _ _ ____ ____ ____ ____ ___ _ _ _ ____
* | | | [__ | | | |\/| | |__/ |__| |___ | | |\ | | __
* |___ |__| ___] | |__| | | |___ | \ | | | | | | \| |__]
*
* CustomCrafting Recipe creation and management tool for Minecraft
* Copyright (C) 2021 WolfyScript
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
`java-library`
`maven-publish`
id("io.github.goooler.shadow") version "8.1.7"
//id("com.wolfyscript.devtools.docker.minecraft_servers") version "2.0-SNAPSHOT"
id("com.jfrog.artifactory") version "5.2.0"
}
repositories {
mavenLocal()
maven (url = "https://repo.codemc.io/repository/maven-public/")
maven(url = "https://repo.papermc.io/repository/maven-public/")
maven(url = "https://artifacts.wolfyscript.com/artifactory/gradle-dev")
maven(url = "https://repo.dmulloy2.net/repository/public/")
maven(url = "https://repo.maven.apache.org/maven2/")
maven(url = "https://mvn.lumine.io/repository/maven-public/")
maven(url = "https://repo.oraxen.com/releases")
}
dependencies {
compileOnly(project(":spigot"))
}
java.sourceCompatibility = JavaVersion.VERSION_17
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("")
from(project(":spigot1_21").tasks.jar.get().archiveFile)
from(project(":spigot").tasks.shadowJar.get().archiveFile)
}
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
artifact(file("$rootDir/gradle.properties"))
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Javadoc> {
options.encoding = "UTF-8"
}
val debugPort: String = "5006"
/*
minecraftDockerRun {
val customEnv = env.get().toMutableMap()
customEnv["MEMORY"] = "2G"
customEnv["JVM_OPTS"] = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:${debugPort}"
env.set(customEnv)
arguments("--cpus", "2", "-it") // Constrain to only use 2 cpus, and allow for console interactivity with 'docker attach'
}
*/
/*
minecraftServers {
serversDir.set(file("${System.getProperty("user.home")}${File.separator}minecraft${File.separator}test_servers_v4"))
libName.set("${project.name}-${version}.jar")
val debugPortMapping = "${debugPort}:${debugPort}"
servers {
register("spigot_1_17") {
version.set("1.17.1")
type.set("SPIGOT")
ports.set(setOf(debugPortMapping, "25565:25565"))
}
register("spigot_1_18") {
version.set("1.18.2")
type.set("SPIGOT")
ports.set(setOf(debugPortMapping, "25566:25565"))
}
register("spigot_1_19") {
version.set("1.19.4")
type.set("SPIGOT")
ports.set(setOf(debugPortMapping, "25567:25565"))
}
register("spigot_1_20_6") {
version.set("1.20.6")
type.set("SPIGOT")
imageVersion.set("java21")
ports.set(setOf(debugPortMapping, "25568:25565"))
}
register("spigot_1_21") {
version.set("1.21.1")
type.set("SPIGOT")
extraEnv.put("BUILD_FROM_SOURCE", "true")
imageVersion.set("java21-graalvm") // graalvm contains the jdk required to build from source
ports.set(setOf(debugPortMapping, "25569:25565"))
}
// Paper test servers
register("paper_1_21") {
version.set("1.21")
type.set("PAPER")
imageVersion.set("java21")
ports.set(setOf("5007:5007", "25570:25565"))
}
register("paper_1_20") {
version.set("1.20.6")
type.set("PAPER")
imageVersion.set("java21")
ports.set(setOf("5007:5007", "25570:25565"))
}
register("paper_1_19") {
version.set("1.19.4")
type.set("PAPER")
ports.set(setOf(debugPortMapping, "25571:25565"))
}
// Purpur
register("purpur_1_20") {
version.set("1.20.4")
type.set("PURPUR")
ports.set(setOf(debugPortMapping, "25572:25565"))
}
}
}
*/
artifactory {
publish {
contextUrl = "https://artifacts.wolfyscript.com/artifactory"
repository {
repoKey = "gradle-dev-local"
username = project.properties["wolfyRepoPublishUsername"].toString()
password = project.properties["wolfyRepoPublishToken"].toString()
}
defaults {
publications("maven")
setPublishArtifacts(true)
setPublishPom(true)
isPublishBuildInfo = false
}
}
}