Add a Jenkinsfile and a few other things

This commit is contained in:
Username404-59 2021-04-08 14:13:37 +02:00
parent 184d1f7f8f
commit 2b785ee9a2
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
6 changed files with 50 additions and 4 deletions

23
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,23 @@
pipeline {
agent any
triggers {
pollSCM('*/10 * * * *')
}
stages {
stage('Build') {
steps {
echo 'Building..'
sh './gradlew publishToMavenLocal --stacktrace'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
dir('remappedJars') {
archiveArtifacts artifacts:'*.jar', fingerprint: false
}
}
}
}
}

View File

@ -73,9 +73,9 @@ allprojects {
val shadowTask = getByName("shadowJar") as ShadowJar val shadowTask = getByName("shadowJar") as ShadowJar
dependsOn(shadowTask) dependsOn(shadowTask)
archiveBaseName.set(shadowTask.archiveBaseName) archiveBaseName.set(shadowTask.archiveBaseName)
if (!archiveBaseName.get().contains("common")) destinationDirectory.set(file("$rootDir/remappedJars"))
input.set(shadowTask.archiveFile) input.set(shadowTask.archiveFile)
archiveClassifier.set(this@allprojects.name) archiveClassifier.set(this@allprojects.name)
if (!archiveFileName.get().contains("common")) destinationDirectory.set(file("$rootDir/remappedJars"))
} }
withType(ProcessResources::class) { withType(ProcessResources::class) {
val modVersionPair: Pair<String, String> = "mod_version" to (rootProject.version as String) val modVersionPair: Pair<String, String> = "mod_version" to (rootProject.version as String)

View File

@ -0,0 +1,8 @@
package fr.username404.snowygui
import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.TranslatableComponent
abstract class SnowyConfigScreen: Screen(TranslatableComponent("snowygui.config")) {
}

View File

@ -13,7 +13,7 @@ object Groups {
architectury { platformSetupLoomIde(); fabric() } architectury { platformSetupLoomIde(); fabric() }
dependencies { dependencies {
modApi("${Groups.Fabric}:fabric-loader:${rootProject.property("fabric_loader_version")}") modImplementation("${Groups.Fabric}:fabric-loader:${rootProject.property("fabric_loader_version")}")
modApi("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}") modApi("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}")
include("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}") { isTransitive = false } include("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}") { isTransitive = false }
modRuntime(modCompileOnly("com.terraformersmc:modmenu:${rootProject.property("modmenu_version")}") { modRuntime(modCompileOnly("com.terraformersmc:modmenu:${rootProject.property("modmenu_version")}") {

View File

@ -2,13 +2,13 @@ package fr.username404.snowygui.fabric
import com.terraformersmc.modmenu.api.ConfigScreenFactory import com.terraformersmc.modmenu.api.ConfigScreenFactory
import com.terraformersmc.modmenu.api.ModMenuApi import com.terraformersmc.modmenu.api.ModMenuApi
import fr.username404.snowygui.config.SnowyConfigScreen
import net.minecraft.client.gui.screens.Screen import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.TranslatableComponent
class ModMenuConf: ModMenuApi { class ModMenuConf: ModMenuApi {
override fun getModConfigScreenFactory(): ConfigScreenFactory<Screen> { override fun getModConfigScreenFactory(): ConfigScreenFactory<Screen> {
return ConfigScreenFactory<Screen> { screen: Screen? -> return ConfigScreenFactory<Screen> { screen: Screen? ->
object : Screen(TranslatableComponent("snowygui.config")) { // TODO Actual config screen object : SnowyConfigScreen() { // TODO Actual config screen
override fun onClose() { override fun onClose() {
minecraft!!.setScreen(screen) minecraft!!.setScreen(screen)
} }

View File

@ -1,11 +1,26 @@
package fr.username404.snowygui.forge package fr.username404.snowygui.forge
import fr.username404.snowygui.CommonSnow import fr.username404.snowygui.CommonSnow
import fr.username404.snowygui.config.SnowyConfigScreen
import net.minecraftforge.fml.ExtensionPoint
import net.minecraftforge.fml.ModLoadingContext
import net.minecraftforge.fml.common.Mod import net.minecraftforge.fml.common.Mod
import java.util.function.BiFunction
import java.util.function.Supplier
@Mod("snowygui") @Mod("snowygui")
class ForgeInit: CommonSnow() { class ForgeInit: CommonSnow() {
init { init {
atInit() atInit()
ModLoadingContext.get().registerExtensionPoint(
ExtensionPoint.CONFIGGUIFACTORY,
Supplier {
return@Supplier BiFunction { mc, screen ->
return@BiFunction object : SnowyConfigScreen() {
override fun onClose() { mc.setScreen(screen) }
}
}
}
)
} }
} }