mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-11-21 01:13:09 +08:00
Fix Scuffed POMs (#1779)
* Repair fabric POM * Fix-up a ton of publishing errors * Remove shadow jar from publishing * Remove shadow application from platform/core
This commit is contained in:
parent
47b64257fb
commit
043c3315aa
@ -44,7 +44,7 @@
|
||||
implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0")
|
||||
implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0")
|
||||
implementation("org.spongepowered:SpongeGradle:0.11.5")
|
||||
// implementation("net.minecraftforge.gradle:ForgeGradle:4.1.12")
|
||||
implementation("net.minecraftforge.gradle:ForgeGradle:5.0.9")
|
||||
implementation("net.fabricmc:fabric-loom:$loomVersion")
|
||||
implementation("net.fabricmc:sponge-mixin:$mixinVersion")
|
||||
implementation("org.enginehub.gradle:gradle-codecov-plugin:0.1.0")
|
||||
|
@ -1,5 +1,6 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.component.AdhocComponentWithVariants
|
||||
import org.gradle.api.plugins.JavaPluginExtension
|
||||
import org.gradle.api.plugins.quality.CheckstyleExtension
|
||||
import org.gradle.api.publish.PublishingExtension
|
||||
@ -32,7 +33,6 @@
|
||||
apply(plugin = "idea")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "checkstyle")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
apply(plugin = "com.jfrog.artifactory")
|
||||
|
||||
ext["internalVersion"] = "$version+${rootProject.ext["gitCommitHash"]}"
|
||||
@ -82,7 +82,7 @@
|
||||
|
||||
the<JavaPluginExtension>().withJavadocJar()
|
||||
|
||||
if (name == "worldedit-core" || name == "worldedit-bukkit") {
|
||||
if (name in setOf("worldedit-core", "worldedit-bukkit", "worldedit-fabric")) {
|
||||
the<JavaPluginExtension>().withSourcesJar()
|
||||
}
|
||||
|
||||
@ -93,7 +93,6 @@
|
||||
configure<PublishingExtension> {
|
||||
publications {
|
||||
register<MavenPublication>("maven") {
|
||||
from(components["java"])
|
||||
versionMapping {
|
||||
usage("java-api") {
|
||||
fromResolutionOf("runtimeClasspath")
|
||||
@ -110,6 +109,7 @@
|
||||
}
|
||||
|
||||
fun Project.applyShadowConfiguration() {
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
tasks.named<ShadowJar>("shadowJar") {
|
||||
archiveClassifier.set("dist")
|
||||
dependencies {
|
||||
@ -124,6 +124,11 @@
|
||||
exclude("META-INF/maven/**")
|
||||
minimize()
|
||||
}
|
||||
val javaComponent = components["java"] as AdhocComponentWithVariants
|
||||
// I don't think we want this published (it's the shadow jar)
|
||||
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) {
|
||||
skip()
|
||||
}
|
||||
}
|
||||
|
||||
private val CLASSPATH = listOf("truezip", "truevfs", "js")
|
||||
|
@ -2,8 +2,7 @@
|
||||
|
||||
include("worldedit-libs")
|
||||
|
||||
// Forge has been removed until FG 5 is available.
|
||||
listOf("bukkit", "core", "sponge", "fabric", "cli").forEach {
|
||||
listOf("bukkit", "core", "sponge", "fabric", "forge", "cli").forEach {
|
||||
include("worldedit-libs:$it")
|
||||
include("worldedit-$it")
|
||||
}
|
||||
|
@ -18,17 +18,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
val localImplementation = configurations.create("localImplementation") {
|
||||
description = "Dependencies used locally, but provided by the runtime Bukkit implementation"
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = false
|
||||
}
|
||||
configurations["compileOnly"].extendsFrom(localImplementation)
|
||||
configurations["testImplementation"].extendsFrom(localImplementation)
|
||||
|
||||
dependencies {
|
||||
"api"(project(":worldedit-core"))
|
||||
"api"(project(":worldedit-libs:bukkit"))
|
||||
"api"("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT") {
|
||||
// Technically this is api, but everyone should already have some form of the bukkit API
|
||||
// Avoid pulling in another one, especially one so outdated.
|
||||
"localImplementation"("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT") {
|
||||
exclude("junit", "junit")
|
||||
}
|
||||
|
||||
"implementation"(platform("org.apache.logging.log4j:log4j-bom:2.14.1") {
|
||||
"localImplementation"(platform("org.apache.logging.log4j:log4j-bom:2.14.1") {
|
||||
because("Spigot provides Log4J (sort of, not in API, implicitly part of server)")
|
||||
})
|
||||
"implementation"("org.apache.logging.log4j:log4j-api")
|
||||
"localImplementation"("org.apache.logging.log4j:log4j-api")
|
||||
|
||||
"compileOnly"("org.jetbrains:annotations:20.1.0")
|
||||
"compileOnly"("com.destroystokyo.paper:paper-api:1.16.1-R0.1-SNAPSHOT") {
|
||||
@ -81,3 +91,9 @@
|
||||
tasks.named("assemble").configure {
|
||||
dependsOn("shadowJar")
|
||||
}
|
||||
|
||||
configure<PublishingExtension> {
|
||||
publications.named<MavenPublication>("maven") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
|
@ -120,3 +120,10 @@
|
||||
into("lang")
|
||||
}
|
||||
}
|
||||
|
||||
configure<PublishingExtension> {
|
||||
publications.named<MavenPublication>("maven") {
|
||||
artifactId = the<BasePluginConvention>().archivesBaseName
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
|
@ -116,6 +116,12 @@
|
||||
configure<PublishingExtension> {
|
||||
publications.named<MavenPublication>("maven") {
|
||||
artifactId = the<BasePluginConvention>().archivesBaseName
|
||||
artifact(tasks.named("jar")) {
|
||||
builtBy(tasks.named("remapJar"))
|
||||
}
|
||||
artifact(tasks.named("sourcesJar")) {
|
||||
builtBy(tasks.named("remapSourcesJar"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,31 +144,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Jar>("deobfJar") {
|
||||
from(sourceSets["main"].output)
|
||||
archiveClassifier.set("dev")
|
||||
}
|
||||
|
||||
val deobfElements = configurations.register("deobfElements") {
|
||||
isVisible = false
|
||||
description = "De-obfuscated elements for libs"
|
||||
isCanBeResolved = false
|
||||
isCanBeConsumed = true
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_API))
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.EXTERNAL))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
|
||||
}
|
||||
outgoing.artifact(tasks.named("deobfJar"))
|
||||
}
|
||||
|
||||
val javaComponent = components["java"] as AdhocComponentWithVariants
|
||||
javaComponent.addVariantsFromConfiguration(deobfElements.get()) {
|
||||
mapToMavenScope("runtime")
|
||||
}
|
||||
|
||||
tasks.register<RemapJarTask>("remapShadowJar") {
|
||||
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
|
||||
dependsOn(shadowJar)
|
||||
|
@ -36,8 +36,8 @@
|
||||
|
||||
configure<UserDevExtension> {
|
||||
mappings(mapOf(
|
||||
"channel" to "snapshot",
|
||||
"version" to "20200514-$mappingsMinecraftVersion"
|
||||
"channel" to "snapshot",
|
||||
"version" to "20200514-$mappingsMinecraftVersion"
|
||||
))
|
||||
|
||||
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
|
||||
@ -45,8 +45,8 @@
|
||||
runs {
|
||||
val runConfig = Action<RunConfig> {
|
||||
properties(mapOf(
|
||||
"forge.logging.markers" to "SCAN,REGISTRIES,REGISTRYDUMP",
|
||||
"forge.logging.console.level" to "debug"
|
||||
"forge.logging.markers" to "SCAN,REGISTRIES,REGISTRYDUMP",
|
||||
"forge.logging.console.level" to "debug"
|
||||
))
|
||||
workingDirectory = project.file("run").canonicalPath
|
||||
source(sourceSets["main"])
|
||||
@ -60,19 +60,79 @@
|
||||
configure<BasePluginConvention> {
|
||||
archivesBaseName = "$archivesBaseName-mc$minecraftVersion"
|
||||
}
|
||||
|
||||
val javaComponent = components["java"] as AdhocComponentWithVariants
|
||||
javaComponent.withVariantsFromConfiguration(configurations["apiElements"]) {
|
||||
skip()
|
||||
}
|
||||
|
||||
javaComponent.withVariantsFromConfiguration(configurations["runtimeElements"]) {
|
||||
skip()
|
||||
}
|
||||
tasks.register<Jar>("deobfJar") {
|
||||
from(sourceSets["main"].output)
|
||||
archiveClassifier.set("dev")
|
||||
}
|
||||
|
||||
val reobfApiElements = configurations.register("reobfApiElements") {
|
||||
isVisible = false
|
||||
description = "Re-obfuscated API elements for libs"
|
||||
isCanBeResolved = false
|
||||
isCanBeConsumed = true
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_API))
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.EXTERNAL))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
|
||||
}
|
||||
outgoing.artifact(tasks.named("jar")) {
|
||||
builtBy(project.provider { tasks.named("reobfJar") })
|
||||
}
|
||||
extendsFrom(configurations["api"])
|
||||
}
|
||||
|
||||
javaComponent.addVariantsFromConfiguration(reobfApiElements.get()) {
|
||||
mapToMavenScope("compile")
|
||||
}
|
||||
|
||||
val reobfRuntimeElements = configurations.register("reobfRuntimeElements") {
|
||||
isVisible = false
|
||||
description = "Re-obfuscated runtime elements for libs"
|
||||
isCanBeResolved = false
|
||||
isCanBeConsumed = true
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_RUNTIME))
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.EXTERNAL))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
|
||||
}
|
||||
outgoing.artifact(tasks.named("jar")) {
|
||||
builtBy(project.provider { tasks.named("reobfJar") })
|
||||
}
|
||||
extendsFrom(configurations["reobfApiElements"])
|
||||
extendsFrom(configurations["runtimeClasspath"].copy { d -> d.group != "net.minecraftforge" })
|
||||
}
|
||||
|
||||
javaComponent.addVariantsFromConfiguration(reobfRuntimeElements.get()) {
|
||||
mapToMavenScope("runtime")
|
||||
}
|
||||
|
||||
configure<PublishingExtension> {
|
||||
publications.named<MavenPublication>("maven") {
|
||||
artifactId = the<BasePluginConvention>().archivesBaseName
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named<Copy>("processResources") {
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
val properties = mapOf(
|
||||
"version" to project.ext["internalVersion"],
|
||||
"forgeVersion" to forgeVersion,
|
||||
"minecraftVersion" to minecraftVersion,
|
||||
"nextMajorMinecraftVersion" to nextMajorMinecraftVersion
|
||||
"version" to project.ext["internalVersion"],
|
||||
"forgeVersion" to forgeVersion,
|
||||
"minecraftVersion" to minecraftVersion,
|
||||
"nextMajorMinecraftVersion" to nextMajorMinecraftVersion
|
||||
)
|
||||
properties.forEach { (key, value) ->
|
||||
inputs.property(key, value)
|
||||
@ -106,28 +166,3 @@
|
||||
mappings = tasks.getByName<GenerateSRG>("createMcpToSrg").output
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Jar>("deobfJar") {
|
||||
from(sourceSets["main"].output)
|
||||
archiveClassifier.set("dev")
|
||||
}
|
||||
|
||||
val deobfElements = configurations.register("deobfElements") {
|
||||
isVisible = false
|
||||
description = "De-obfuscated elements for libs"
|
||||
isCanBeResolved = false
|
||||
isCanBeConsumed = true
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage.JAVA_API))
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.EXTERNAL))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
|
||||
}
|
||||
outgoing.artifact(tasks.named("deobfJar"))
|
||||
}
|
||||
|
||||
val javaComponent = components["java"] as AdhocComponentWithVariants
|
||||
javaComponent.addVariantsFromConfiguration(deobfElements.get()) {
|
||||
mapToMavenScope("runtime")
|
||||
}
|
||||
|
@ -9,11 +9,11 @@
|
||||
tasks.register<Jar>("jar") {
|
||||
val remapFabric = project(":worldedit-fabric").tasks.named<RemapJarTask>("remapShadowJar")
|
||||
dependsOn(
|
||||
remapFabric//,
|
||||
//project(":worldedit-forge").tasks.named("reobfShadowJar")
|
||||
remapFabric,
|
||||
project(":worldedit-forge").tasks.named("reobfShadowJar")
|
||||
)
|
||||
from(zipTree({remapFabric.get().archiveFile}))
|
||||
//from(zipTree({project(":worldedit-forge").tasks.getByName("shadowJar").outputs.files.singleFile}))
|
||||
from(zipTree({project(":worldedit-forge").tasks.getByName("shadowJar").outputs.files.singleFile}))
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
archiveClassifier.set("dist")
|
||||
|
Loading…
Reference in New Issue
Block a user