mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 09:05:08 +01:00
Compare commits
2 Commits
2e6bcaa3f2
...
d954b32461
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d954b32461 | ||
|
|
a940a96bc7 |
@@ -3,7 +3,7 @@ import groovy.json.JsonOutput
|
||||
|
||||
plugins {
|
||||
id "architectury-plugin" version "3.4-SNAPSHOT"
|
||||
id "dev.architectury.loom" version "1.10-SNAPSHOT" apply false
|
||||
id "dev.architectury.loom" version "1.10.+" apply false
|
||||
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
architectury {
|
||||
common(rootProject.enabled_platforms.split(","))
|
||||
}
|
||||
@@ -21,3 +25,16 @@ publishing {
|
||||
// Add repositories to publish to here.
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
testOutput.extendsFrom(testImplementation)
|
||||
}
|
||||
|
||||
tasks.register('testJar', Jar) {
|
||||
from sourceSets.test.output
|
||||
archiveClassifier = 'tests'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
testOutput testJar
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package eu.midnightdust.fabric.example;
|
||||
package eu.midnightdust.test;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
@@ -1,7 +1,7 @@
|
||||
package eu.midnightdust.fabric.example.config;
|
||||
package eu.midnightdust.test.config;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import eu.midnightdust.fabric.example.MidnightLibExtras;
|
||||
import eu.midnightdust.test.MidnightLibExtras;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
@@ -11,7 +11,27 @@ architectury {
|
||||
fabric()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
test {
|
||||
compileClasspath += main.compileClasspath
|
||||
runtimeClasspath += main.runtimeClasspath
|
||||
java {
|
||||
srcDirs.add('src/test/java' as File)
|
||||
}
|
||||
resources {
|
||||
srcDirs.add('src/test/resources' as File)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
runs {
|
||||
testClient {
|
||||
client()
|
||||
configName = "Test Minecraft Client"
|
||||
source sourceSets.test
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -27,10 +47,12 @@ configurations {
|
||||
dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
||||
modCompileOnly ("com.terraformersmc:modmenu:${rootProject.mod_menu_version}")
|
||||
modCompileOnly("com.terraformersmc:modmenu:${rootProject.mod_menu_version}")
|
||||
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||
|
||||
testImplementation common(project(path: ':common', configuration: 'testOutput'))
|
||||
}
|
||||
|
||||
processResources {
|
||||
@@ -41,6 +63,14 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
processTestResources {
|
||||
inputs.property "version", rootProject.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": rootProject.version
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
exclude "architectury.common.json"
|
||||
|
||||
@@ -71,7 +101,7 @@ unifiedPublishing {
|
||||
releaseType = "$project.release_type"
|
||||
changelog = releaseChangelog()
|
||||
gameVersions = []
|
||||
gameLoaders = ["fabric","quilt"]
|
||||
gameLoaders = ["fabric", "quilt"]
|
||||
mainPublication remapJar
|
||||
relations {
|
||||
depends {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package eu.midnightdust.test.fabric;
|
||||
|
||||
import eu.midnightdust.test.config.MidnightConfigExample;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class MLExampleFabric implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
MidnightConfig.init("modid", MidnightConfigExample.class);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "midnightlib-example",
|
||||
"id": "testmod",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "MidnightLib Example",
|
||||
@@ -13,7 +13,7 @@
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"eu.midnightdust.fabric.example.MLExampleFabric"
|
||||
"eu.midnightdust.test.fabric.MLExampleFabric"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https://mirrors.aliyun.com/gradle/distributions/v8.14.3/gradle-8.14.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -13,11 +13,44 @@ repositories {
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
neoForge()
|
||||
neoForge {
|
||||
platformPackage = "neoforge"
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
test {
|
||||
compileClasspath += main.compileClasspath
|
||||
runtimeClasspath += main.runtimeClasspath
|
||||
java {
|
||||
srcDirs.add('src/test/java' as File)
|
||||
}
|
||||
resources {
|
||||
srcDirs.add('src/test/resources' as File)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = project(":common").loom.accessWidenerPath
|
||||
|
||||
runs {
|
||||
testClient {
|
||||
client()
|
||||
name = "Test Minecraft Client"
|
||||
|
||||
mods {
|
||||
create('midnightlib') {
|
||||
sourceSet sourceSets.main
|
||||
}
|
||||
create('testmod') {
|
||||
sourceSet sourceSets.test
|
||||
}
|
||||
}
|
||||
source sourceSets.test
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -44,6 +77,10 @@ dependencies {
|
||||
|
||||
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
|
||||
shadowBundle project(path: ':common', configuration: 'transformProductionNeoForge')
|
||||
|
||||
// testImplementation common(project(path: ':common', configuration: 'namedElements')) { transitive false }
|
||||
testImplementation common(project(path: ':common', configuration: 'testOutput')) { transitive false }
|
||||
testImplementation sourceSets.main.output
|
||||
}
|
||||
|
||||
processResources {
|
||||
@@ -54,6 +91,14 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
processTestResources {
|
||||
inputs.property 'version', rootProject.version
|
||||
|
||||
filesMatching('META-INF/neoforge.mods.toml') {
|
||||
expand version: rootProject.version
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
configurations = [project.configurations.shadowBundle]
|
||||
archiveClassifier = 'dev-shadow'
|
||||
@@ -105,4 +150,4 @@ unifiedPublishing {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package eu.midnightdust.test.neoforge;
|
||||
|
||||
import eu.midnightdust.test.config.MidnightConfigExample;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
|
||||
@Mod("testmod")
|
||||
public class MLExampleNeoForge {
|
||||
public MLExampleNeoForge() {
|
||||
MidnightConfigExample.init("modid", MidnightConfigExample.class);
|
||||
}
|
||||
}
|
||||
34
neoforge/src/test/resources/META-INF/neoforge.mods.toml
Normal file
34
neoforge/src/test/resources/META-INF/neoforge.mods.toml
Normal file
@@ -0,0 +1,34 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "[2,)"
|
||||
#issueTrackerURL = ""
|
||||
license = "MIT License"
|
||||
|
||||
[[mods]]
|
||||
modId = "testmod"
|
||||
version = "${version}"
|
||||
displayName = "Example Mod"
|
||||
authors = "TeamMidnightDust, Motschen"
|
||||
description = '''
|
||||
Example Mod for Team MidnightDust's mods.
|
||||
'''
|
||||
|
||||
[[dependencies.testmod]]
|
||||
modId = "neoforge"
|
||||
mandatory = true
|
||||
versionRange = "[20.5,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.testmod]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.20.5,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
[[dependencies.testmod]]
|
||||
modId = "midnightlib"
|
||||
mandatory = true
|
||||
versionRange = "[1.0,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
@@ -9,9 +9,7 @@ pluginManagement {
|
||||
|
||||
include("common")
|
||||
include("fabric")
|
||||
include("test-fabric")
|
||||
include("neoforge")
|
||||
include("test-neoforge")
|
||||
//include("quilt")
|
||||
|
||||
rootProject.name = "midnightlib"
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow'
|
||||
id "me.shedaniel.unified-publishing"
|
||||
}
|
||||
repositories {
|
||||
maven { url "https://maven.terraformersmc.com/releases" }
|
||||
}
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
fabric()
|
||||
}
|
||||
|
||||
loom {
|
||||
}
|
||||
|
||||
configurations {
|
||||
common
|
||||
shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
|
||||
compileClasspath.extendsFrom common
|
||||
runtimeClasspath.extendsFrom common
|
||||
developmentFabric.extendsFrom common
|
||||
archivesBaseName = rootProject.archives_base_name + "-fabric"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
||||
|
||||
implementation project(path: ":fabric", configuration: "namedElements")
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package eu.midnightdust.fabric.example;
|
||||
|
||||
import eu.midnightdust.fabric.example.config.MidnightConfigExample;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class MLExampleFabric implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
MidnightConfigExample.init("modid", MidnightConfigExample.class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user