mirror of
https://github.com/Flowsqy/ShopChest.git
synced 2024-11-13 23:05:21 +01:00
Remap nms jar
This commit is contained in:
parent
aa33e72b7f
commit
04347e2f7c
@ -12,4 +12,12 @@ plugins {
|
||||
repositories {
|
||||
// Use the plugin portal to apply community plugins in convention plugins.
|
||||
gradlePluginPortal()
|
||||
|
||||
maven {
|
||||
url "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.github.Flowsqy:SpecialSourceGradlePlugin:a0434bf32a"
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ plugins {
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven {
|
||||
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'
|
||||
version = '1.15.0-SNAPSHOT'
|
||||
java.sourceCompatibility = JavaVersion.VERSION_16
|
||||
java.sourceCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
|
83
buildSrc/src/main/groovy/de.epiceric.nms-conventions.gradle
Normal file
83
buildSrc/src/main/groovy/de.epiceric.nms-conventions.gradle
Normal 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)}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +1,12 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*
|
||||
* This project uses @Incubating APIs which are subject to change.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'de.epiceric.java-conventions'
|
||||
id "de.epiceric.nms-conventions" apply false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT'
|
||||
implementation project(":nms:interface")
|
||||
ext {
|
||||
nmsVersion = "1.17-R0.1-SNAPSHOT"
|
||||
}
|
||||
|
||||
plugins.apply("de.epiceric.nms-conventions")
|
||||
|
||||
description = 'shopchest-nms-v1_17_R1'
|
||||
|
||||
|
@ -3,20 +3,25 @@ plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
//api 'com.zaxxer:HikariCP:5.0.0'
|
||||
//api 'org.slf4j:slf4j-jdk14:2.0.0-alpha2'
|
||||
//api 'org.inventivetalent:reflectionhelper:1.18.7-SNAPSHOT'
|
||||
api project(":common")
|
||||
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(':shopchest-nms-all')
|
||||
//api project(':shopchest-external')
|
||||
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
|
||||
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.22'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user