fabric: Update loom
This commit is contained in:
parent
8df3f28cb7
commit
2bf8d0f709
4 changed files with 22 additions and 50 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -226,3 +226,4 @@ gradle-app.setting
|
||||||
### Fabric Loom run files ###
|
### Fabric Loom run files ###
|
||||||
|
|
||||||
/run/
|
/run/
|
||||||
|
/cloud-minecraft/cloud-fabric/run/
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ object Versions {
|
||||||
const val spongeApi7 = "7.3.0"
|
const val spongeApi7 = "7.3.0"
|
||||||
const val jetbrainsAnnotations = "20.1.0"
|
const val jetbrainsAnnotations = "20.1.0"
|
||||||
const val guava = "21.0-jre"
|
const val guava = "21.0-jre"
|
||||||
const val fabricLoader = "0.11.1"
|
const val fabricLoader = "0.12.5"
|
||||||
const val fabricMc = "1.16.5"
|
const val fabricMc = "1.16.5"
|
||||||
const val fabricApi = "0.31.0+1.16"
|
const val fabricApi = "0.31.0+1.16"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,27 +2,9 @@ import net.fabricmc.loom.task.AbstractRunTask
|
||||||
import net.ltgt.gradle.errorprone.errorprone
|
import net.ltgt.gradle.errorprone.errorprone
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("quiet-fabric-loom") version "0.8-SNAPSHOT"
|
id("quiet-fabric-loom") version "0.10-SNAPSHOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up a testmod source set */
|
|
||||||
val testmod by sourceSets.creating {
|
|
||||||
val main = sourceSets.main.get()
|
|
||||||
compileClasspath += main.compileClasspath
|
|
||||||
runtimeClasspath += main.runtimeClasspath
|
|
||||||
dependencies.add(implementationConfigurationName, main.output)
|
|
||||||
}
|
|
||||||
|
|
||||||
val testmodJar by tasks.creating(Jar::class) {
|
|
||||||
archiveClassifier.set("testmod-dev")
|
|
||||||
group = LifecycleBasePlugin.BUILD_GROUP
|
|
||||||
from(testmod.output)
|
|
||||||
}
|
|
||||||
|
|
||||||
loom.unmappedModCollection.from(testmodJar)
|
|
||||||
|
|
||||||
/* end of testmod setup */
|
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
compileJava {
|
compileJava {
|
||||||
options.errorprone {
|
options.errorprone {
|
||||||
|
|
@ -59,7 +41,7 @@ tasks {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft("com.mojang", "minecraft", Versions.fabricMc)
|
minecraft("com.mojang", "minecraft", Versions.fabricMc)
|
||||||
mappings(minecraft.officialMojangMappings())
|
mappings(loom.officialMojangMappings())
|
||||||
modImplementation("net.fabricmc", "fabric-loader", Versions.fabricLoader)
|
modImplementation("net.fabricmc", "fabric-loader", Versions.fabricLoader)
|
||||||
modImplementation(fabricApi.module("fabric-command-api-v1", Versions.fabricApi))
|
modImplementation(fabricApi.module("fabric-command-api-v1", Versions.fabricApi))
|
||||||
modImplementation(fabricApi.module("fabric-lifecycle-events-v1", Versions.fabricApi))
|
modImplementation(fabricApi.module("fabric-lifecycle-events-v1", Versions.fabricApi))
|
||||||
|
|
@ -73,33 +55,21 @@ dependencies {
|
||||||
api(include("io.leangen.geantyref", "geantyref", Versions.geantyref))
|
api(include("io.leangen.geantyref", "geantyref", Versions.geantyref))
|
||||||
}
|
}
|
||||||
|
|
||||||
indra {
|
/* set up a testmod source set */
|
||||||
includeJavaSoftwareComponentInPublications(false)
|
val testmod: SourceSet by sourceSets.creating {
|
||||||
configurePublications {
|
val main = sourceSets.main.get()
|
||||||
// add all the jars that should be included when publishing to maven
|
compileClasspath += main.compileClasspath
|
||||||
artifact(tasks.remapJar) {
|
runtimeClasspath += main.runtimeClasspath
|
||||||
builtBy(tasks.remapJar)
|
dependencies.add(implementationConfigurationName, main.output)
|
||||||
}
|
|
||||||
artifact(tasks.sourcesJar) {
|
|
||||||
builtBy(tasks.remapSourcesJar)
|
|
||||||
}
|
|
||||||
artifact(tasks.javadocJar) {
|
|
||||||
builtBy(tasks.javadocJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Loom is broken with project dependencies in the same build (because it resolves dependencies during configuration)
|
|
||||||
// Please look away
|
|
||||||
pom {
|
|
||||||
withXml {
|
|
||||||
val dependencies = asNode().appendNode("dependencies")
|
|
||||||
sequenceOf("brigadier", "core", "services").forEach {
|
|
||||||
val depNode = dependencies.appendNode("dependency")
|
|
||||||
depNode.appendNode("groupId", project.group)
|
|
||||||
depNode.appendNode("artifactId", "cloud-$it")
|
|
||||||
depNode.appendNode("version", project.version)
|
|
||||||
depNode.appendNode("scope", "compile")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val testmodJar by tasks.registering(Jar::class) {
|
||||||
|
archiveClassifier.set("testmod-dev")
|
||||||
|
group = LifecycleBasePlugin.BUILD_GROUP
|
||||||
|
from(testmod.output)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<AbstractRunTask> {
|
||||||
|
classpath(testmodJar)
|
||||||
|
}
|
||||||
|
/* end of testmod setup */
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
maven("https://maven.fabricmc.net")
|
maven("https://maven.fabricmc.net")
|
||||||
|
maven("https://maven.quiltmc.org/repository/release/")
|
||||||
maven("https://repo.jpenilla.xyz/snapshots/")
|
maven("https://repo.jpenilla.xyz/snapshots/")
|
||||||
}
|
}
|
||||||
includeBuild("build-logic")
|
includeBuild("build-logic")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue