mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-20 13:29:37 +00:00
Update build.gradle.kts
This commit is contained in:
1 parent
cd6105fab7
commit
5ac08b3523
1 file changed
+43
-41
@@ -20,12 +20,14 @@ dependencies {
|
||||
mappings(loom.officialMojangMappings())
|
||||
forge("net.minecraftforge:forge:1.20.1-47.4.20")
|
||||
|
||||
shadowImplementation("net.kyori:adventure-text-minimessage:4.26.1")
|
||||
shadowImplementation("net.kyori:adventure-api:4.26.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-gson:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-legacy:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-text-serializer-plain:4.8.1")
|
||||
shadowImplementation("net.kyori:adventure-key:4.8.1")
|
||||
modImplementation(include("net.kyori:adventure-text-minimessage:4.26.1")!!)
|
||||
modImplementation(include("net.kyori:adventure-api:4.26.1")!!)
|
||||
modImplementation(include("net.kyori:adventure-text-serializer-gson:4.14.0")!!)
|
||||
modImplementation(include("net.kyori:adventure-text-serializer-legacy:4.14.0")!!)
|
||||
modImplementation(include("net.kyori:adventure-text-serializer-plain:4.14.0")!!)
|
||||
modImplementation(include("net.kyori:adventure-key:4.14.0")!!)
|
||||
modImplementation(include("net.kyori:examination-string:1.3.0")!!)
|
||||
modImplementation(include("net.kyori:examination-api:1.3.0")!!)
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -40,15 +42,15 @@ tasks {
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate("net.kyori", "com.coloryr.allmusic.libs.net.kyori")
|
||||
relocate("com.google.gson", "com.coloryr.allmusic.libs.com.google.gson")
|
||||
// relocate("net.kyori", "com.coloryr.allmusic.libs.net.kyori")
|
||||
// relocate("com.google.gson", "com.coloryr.allmusic.libs.com.google.gson")
|
||||
|
||||
doFirst {
|
||||
val emptyRoot = project.layout.buildDirectory.dir("tmp/emptyDirs").get().asFile
|
||||
emptyRoot.mkdirs()
|
||||
val versionsDir = file("$emptyRoot/META-INF/versions")
|
||||
versionsDir.mkdirs()
|
||||
}
|
||||
// doFirst {
|
||||
// val emptyRoot = project.layout.buildDirectory.dir("tmp/emptyDirs").get().asFile
|
||||
// emptyRoot.mkdirs()
|
||||
// val versionsDir = file("$emptyRoot/META-INF/versions")
|
||||
// versionsDir.mkdirs()
|
||||
// }
|
||||
}
|
||||
|
||||
remapJar {
|
||||
@@ -57,33 +59,33 @@ tasks {
|
||||
destinationDirectory.set(file("${parent!!.projectDir}/../build"))
|
||||
}
|
||||
|
||||
remapJar {
|
||||
inputFile.set(shadowJar.get().archiveFile)
|
||||
archiveFileName.set("[forge-1.20.1]AllMusic_Server-${project.version}.jar")
|
||||
destinationDirectory.set(file("${parent!!.projectDir}/../build"))
|
||||
|
||||
doLast {
|
||||
val jarFile = destinationDirectory.get().file(archiveFileName.get()).asFile
|
||||
val tempDir = layout.buildDirectory.dir("tempInject").get().asFile
|
||||
tempDir.mkdirs()
|
||||
|
||||
project.copy {
|
||||
from(zipTree(jarFile))
|
||||
into(tempDir)
|
||||
}
|
||||
|
||||
val versionsDir = file("$tempDir/META-INF/versions")
|
||||
versionsDir.mkdirs()
|
||||
|
||||
project.ant.withGroovyBuilder {
|
||||
"zip"("destfile" to jarFile.absolutePath) {
|
||||
"fileset"("dir" to tempDir.absolutePath)
|
||||
}
|
||||
}
|
||||
|
||||
tempDir.deleteRecursively()
|
||||
}
|
||||
}
|
||||
// remapJar {
|
||||
// inputFile.set(shadowJar.get().archiveFile)
|
||||
// archiveFileName.set("[forge-1.20.1]AllMusic_Server-${project.version}.jar")
|
||||
// destinationDirectory.set(file("${parent!!.projectDir}/../build"))
|
||||
//
|
||||
// doLast {
|
||||
// val jarFile = destinationDirectory.get().file(archiveFileName.get()).asFile
|
||||
// val tempDir = layout.buildDirectory.dir("tempInject").get().asFile
|
||||
// tempDir.mkdirs()
|
||||
//
|
||||
// project.copy {
|
||||
// from(zipTree(jarFile))
|
||||
// into(tempDir)
|
||||
// }
|
||||
//
|
||||
// val versionsDir = file("$tempDir/META-INF/versions")
|
||||
// versionsDir.mkdirs()
|
||||
//
|
||||
// project.ant.withGroovyBuilder {
|
||||
// "zip"("destfile" to jarFile.absolutePath) {
|
||||
// "fileset"("dir" to tempDir.absolutePath)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// tempDir.deleteRecursively()
|
||||
// }
|
||||
// }
|
||||
|
||||
build {
|
||||
dependsOn(remapJar)
|
||||
|
||||
Reference in new issue
Block a user