mirror of
https://github.com/Lucaslah/WeatherChanger.git
synced 2026-01-06 13:37:50 +00:00
First progress on forge support
- add forge module - github actions build and release - aim for all-in-one jar supporting both fabric and forge **NOTICE** Forge support is not currently working. Signed-off-by: Lucas Petrino <nsx1lucas@gmail.com>
This commit is contained in:
89
forge/build.gradle.kts
Normal file
89
forge/build.gradle.kts
Normal file
@@ -0,0 +1,89 @@
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
forge()
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath.set(project(":common").loom.accessWidenerPath)
|
||||
|
||||
forge.apply {
|
||||
convertAccessWideners.set(true)
|
||||
extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name)
|
||||
|
||||
mixinConfig("weatherchanger.mixins.json")
|
||||
}
|
||||
}
|
||||
|
||||
val common: Configuration by configurations.creating
|
||||
val shadowCommon: Configuration by configurations.creating
|
||||
|
||||
configurations {
|
||||
compileOnly.configure { extendsFrom(common) }
|
||||
runtimeOnly.configure { extendsFrom(common) }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
forge("net.minecraftforge:forge:${rootProject.property("forge.version")}")
|
||||
|
||||
common(project(":common", "namedElements")) {
|
||||
isTransitive = false
|
||||
}
|
||||
|
||||
shadowCommon(project(":common", "transformProductionForge")) {
|
||||
isTransitive = false
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
processResources {
|
||||
inputs.property("group", rootProject.property("maven_group"))
|
||||
inputs.property("version", project.version)
|
||||
|
||||
filesMatching("META-INF/mods.toml") {
|
||||
expand(mapOf(
|
||||
"group" to rootProject.property("maven_group"),
|
||||
"version" to project.version,
|
||||
|
||||
"mod_id" to rootProject.property("mod_id"),
|
||||
"minecraft_version" to rootProject.property("minecraft_version")
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
remapJar {
|
||||
injectAccessWidener.set(true)
|
||||
}
|
||||
|
||||
jar {
|
||||
from("../LICENSE.md")
|
||||
from("../assets/logo.png") {
|
||||
rename { "icon.png" }
|
||||
}
|
||||
|
||||
dependsOn(":common:transformProductionForge")
|
||||
|
||||
from({
|
||||
shadowCommon.filter { it.name.endsWith("jar") }.map { zipTree(it) }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
// Notice: This block does NOT have the same function as the block in the top level.
|
||||
// The repositories here will be used for publishing your artifact, not for
|
||||
// retrieving dependencies.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user