add a bit of error handling
All checks were successful
Publish to snapshot maven / build (push) Successful in 18s

This commit is contained in:
moehreag 2024-06-09 17:20:47 +02:00
parent 707424242c
commit 08234fc63d

View file

@ -5,7 +5,6 @@ import com.electronwill.nightconfig.core.file.FileNotFoundAction
import com.electronwill.nightconfig.core.io.WritingMode import com.electronwill.nightconfig.core.io.WritingMode
import com.electronwill.nightconfig.toml.TomlParser import com.electronwill.nightconfig.toml.TomlParser
import com.electronwill.nightconfig.toml.TomlWriter import com.electronwill.nightconfig.toml.TomlWriter
import net.fabricmc.fernflower.api.IFabricJavadocProvider
import dev.frogmc.phytotelma.accesswidener.AccessWidener import dev.frogmc.phytotelma.accesswidener.AccessWidener
import dev.frogmc.phytotelma.common.Env import dev.frogmc.phytotelma.common.Env
import dev.frogmc.phytotelma.ext.PhytotelmaGradleExtension import dev.frogmc.phytotelma.ext.PhytotelmaGradleExtension
@ -16,6 +15,7 @@ import dev.frogmc.phytotelma.run.RunConfigGenerator
import dev.frogmc.phytotelma.run.task.RunGameTask import dev.frogmc.phytotelma.run.task.RunGameTask
import dev.frogmc.phytotelma.vineflower.ParchmentJavadocProvider import dev.frogmc.phytotelma.vineflower.ParchmentJavadocProvider
import dev.frogmc.thyroxine.provider.ParchmentProvider import dev.frogmc.thyroxine.provider.ParchmentProvider
import net.fabricmc.fernflower.api.IFabricJavadocProvider
import org.gradle.api.Plugin import org.gradle.api.Plugin
import org.gradle.api.Project import org.gradle.api.Project
import org.jetbrains.java.decompiler.main.Fernflower import org.jetbrains.java.decompiler.main.Fernflower
@ -67,7 +67,11 @@ class PhytotelmaPlugin : Plugin<Project> {
mavenCentral() mavenCentral()
} }
project.extensions.create(PhytotelmaGradleExtension::class.java, "phytotelma", PhytotelmaGradleExtensionImpl::class.java) project.extensions.create(
PhytotelmaGradleExtension::class.java,
"phytotelma",
PhytotelmaGradleExtensionImpl::class.java
)
project.task("genSources").apply { project.task("genSources").apply {
group = taskGroup group = taskGroup
@ -116,6 +120,7 @@ class PhytotelmaPlugin : Plugin<Project> {
} }
} }
if (minecraftVersion.isNotEmpty()) {
project.task("genRunConfigs").apply { project.task("genRunConfigs").apply {
group = taskGroup group = taskGroup
doFirst { doFirst {
@ -125,6 +130,7 @@ class PhytotelmaPlugin : Plugin<Project> {
project.tasks.register("runClient", RunGameTask::class.java, Env.CLIENT) project.tasks.register("runClient", RunGameTask::class.java, Env.CLIENT)
project.tasks.register("runServer", RunGameTask::class.java, Env.SERVER) project.tasks.register("runServer", RunGameTask::class.java, Env.SERVER)
}
project.task("downloadAssets").apply { project.task("downloadAssets").apply {
group = taskGroup group = taskGroup
@ -163,7 +169,8 @@ class PhytotelmaPlugin : Plugin<Project> {
} }
val manifest = fs.getPath("META-INF/MANIFEST.MF") val manifest = fs.getPath("META-INF/MANIFEST.MF")
val lines = manifest.readLines().filter { it.isNotBlank() } val lines = manifest.readLines().filter { it.isNotBlank() }
.plus(""" .plus(
"""
Built-By: Phytotelma ${this.javaClass.`package`.implementationVersion} Built-By: Phytotelma ${this.javaClass.`package`.implementationVersion}
Target-Namespace: Mojmap Target-Namespace: Mojmap
Built-For: Minecraft $minecraftVersion Built-For: Minecraft $minecraftVersion