Remap nms jar

This commit is contained in:
Flowsqy 2023-04-23 01:27:07 +02:00
parent aa33e72b7f
commit 04347e2f7c
5 changed files with 109 additions and 14 deletions

View File

@ -12,4 +12,12 @@ plugins {
repositories { repositories {
// Use the plugin portal to apply community plugins in convention plugins. // Use the plugin portal to apply community plugins in convention plugins.
gradlePluginPortal() gradlePluginPortal()
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation "com.github.Flowsqy:SpecialSourceGradlePlugin:a0434bf32a"
} }

View File

@ -10,7 +10,6 @@ plugins {
} }
repositories { repositories {
mavenLocal()
maven { maven {
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/') url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
} }
@ -28,9 +27,13 @@ repositories {
} }
} }
dependencies {
compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT"
}
group = 'de.epiceric' group = 'de.epiceric'
version = '1.15.0-SNAPSHOT' version = '1.15.0-SNAPSHOT'
java.sourceCompatibility = JavaVersion.VERSION_16 java.sourceCompatibility = JavaVersion.VERSION_17
publishing { publishing {
publications { publications {

View File

@ -0,0 +1,83 @@
import fr.flowsqy.specialsourcegp.task.RemapJar
plugins {
id "de.epiceric.java-conventions"
id "com.github.flowsqy.specialsource" apply false
}
repositories {
mavenLocal()
}
configurations {
mappings {
canBeResolved = true
canBeConsumed = false
}
nms {
canBeResolved = true
canBeConsumed = false
transitive = false
}
compileOnly.extendsFrom(nms)
}
dependencies {
def nmsVersion = project.ext.nmsVersion
nms group: "org.spigotmc", name: "spigot", "version": nmsVersion, classifier:"remapped-mojang"
mappings group: "org.spigotmc", name: "spigot", "version": nmsVersion, classifier:"remapped-obf"
mappings group: "org.spigotmc", name: "minecraft-server", version: nmsVersion, classifier: "maps-mojang", ext: "txt"
mappings group: "org.spigotmc", name: "minecraft-server", version: nmsVersion, classifier: "maps-spigot", ext: "csrg"
implementation project(":nms:interface")
}
java {
sourceCompatibility = "17"
targetCompatibility = "17"
}
def remapObf = tasks.register("remap-obf", RemapJar) {
input = tasks.jar.archiveFile
output = tasks.jar.destinationDirectory.file("Obf.jar")
mapping {
def mappingProvider = project.configurations.mappings.incoming.artifacts.resolvedArtifacts.map {artSet ->
artSet.find(art ->
art.id.displayName.contains("maps-mojang")
).getFile()
}
def dependencyProvider = project.configurations.nms.incoming.artifacts.resolvedArtifacts.map {artSet ->
artSet.find(art ->
art.id.displayName.contains("remapped-mojang")
).getFile()
}
mappingFiles.from = mappingProvider.map {it.getAbsolutePath()}
reverse = true
inheritance {
jars = layout.file(dependencyProvider as Provider<File>).map {Collections.singletonList(it)}
}
}
}
def remapSpigot = tasks.register("remap-spigot", RemapJar) {
input = remapObf.flatMap {it.output}
output = tasks.jar.destinationDirectory.file("Prod.jar")
mapping {
def mappingProvider = project.configurations.mappings.incoming.artifacts.resolvedArtifacts.map {artSet ->
artSet.find(art ->
art.id.displayName.contains("maps-spigot")
).getFile()
}
def dependencyProvider = project.configurations.mappings.incoming.artifacts.resolvedArtifacts.map {artSet ->
artSet.find(art ->
art.id.displayName.contains("remapped-obf")
).getFile()
}
mappingFiles.from = mappingProvider.map {it.getAbsolutePath()}
inheritance {
jars = layout.file(dependencyProvider as Provider<File>).map {Collections.singletonList(it)}
}
}
}

View File

@ -1,16 +1,12 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins { plugins {
id 'de.epiceric.java-conventions' id "de.epiceric.nms-conventions" apply false
} }
dependencies { ext {
compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT' nmsVersion = "1.17-R0.1-SNAPSHOT"
implementation project(":nms:interface")
} }
plugins.apply("de.epiceric.nms-conventions")
description = 'shopchest-nms-v1_17_R1' description = 'shopchest-nms-v1_17_R1'

View File

@ -3,20 +3,25 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2' id 'com.github.johnrengelman.shadow' version '7.1.2'
} }
repositories {
mavenLocal()
}
dependencies { dependencies {
//api 'com.zaxxer:HikariCP:5.0.0' //api 'com.zaxxer:HikariCP:5.0.0'
//api 'org.slf4j:slf4j-jdk14:2.0.0-alpha2' //api 'org.slf4j:slf4j-jdk14:2.0.0-alpha2'
//api 'org.inventivetalent:reflectionhelper:1.18.7-SNAPSHOT' //api 'org.inventivetalent:reflectionhelper:1.18.7-SNAPSHOT'
api project(":common") api project(":common")
api project(":external") api project(":external")
api project(":nms:interface")
//api project(":nms:reflection")
project.project(":nms").subprojects.forEach { project.project(":nms").subprojects.findAll {it.name.startsWith("v")}.forEach {
api project(it.path) api project(it.path)
} }
//api project(':shopchest-nms-all') //api project(':shopchest-nms-all')
//api project(':shopchest-external') //api project(':shopchest-external')
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7' compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
compileOnly 'org.projectlombok:lombok:1.18.22' compileOnly 'org.projectlombok:lombok:1.18.22'
} }