forked from mirrors/cobblemon
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4550ea590a |
+25
-17
@@ -15,6 +15,8 @@ import utilities.version
|
||||
*/
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.moddev)
|
||||
|
||||
id("cobblemon.base-conventions")
|
||||
id("cobblemon.publish-conventions")
|
||||
|
||||
@@ -23,38 +25,38 @@ plugins {
|
||||
id("net.nemerosa.versioning") version "3.1.0"
|
||||
}
|
||||
|
||||
architectury {
|
||||
common("neoforge", "fabric")
|
||||
neoForge {
|
||||
neoFormVersion = "1.21.1-20240808.144430"
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven(url = "${rootProject.projectDir}/deps")
|
||||
maven(url = "https://api.modrinth.com/maven")
|
||||
maven(url = "https://maven.fabricmc.net/")
|
||||
maven(url = "https://maven.neoforged.net/releases")
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.bundles.kotlin)
|
||||
modImplementation(libs.fabric.loader)
|
||||
modApi(libs.molang)
|
||||
implementation(libs.bundles.mixins)
|
||||
|
||||
api(libs.molang)
|
||||
compileOnly(libs.graal)
|
||||
compileOnly(libs.bundles.mongo)
|
||||
|
||||
// Integrations
|
||||
compileOnlyApi(libs.jei.api)
|
||||
modCompileOnly(libs.bundles.fabric.integrations.compileOnly) {
|
||||
isTransitive = false
|
||||
}
|
||||
// Flywheel has no common dep so just pick one and don't use any platform specific code in common
|
||||
// modCompileOnly(libs.flywheelFabric)
|
||||
// compileOnly(libs.bundles.fabric.integrations.compileOnly) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
|
||||
// Showdown
|
||||
modCompileOnly(libs.graal)
|
||||
|
||||
// Data Storage
|
||||
modCompileOnly(libs.bundles.mongo)
|
||||
|
||||
// Unit Testing
|
||||
testImplementation(libs.bundles.unitTesting)
|
||||
testRuntimeOnly(libs.junit.fabric)
|
||||
|
||||
// // Integrations
|
||||
// modCompileOnly(libs.bundles.fabric.integrations.compileOnly) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
@@ -94,4 +96,10 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
|
||||
idea {
|
||||
module.isDownloadJavadoc = true
|
||||
module.isDownloadSources = true
|
||||
}
|
||||
+33
-38
@@ -19,11 +19,6 @@ plugins {
|
||||
id("cobblemon.publish-conventions")
|
||||
}
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
fabric()
|
||||
}
|
||||
|
||||
val generatedResources = file("src/generated/resources")
|
||||
|
||||
sourceSets {
|
||||
@@ -42,45 +37,45 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":common", configuration = "namedElements")) {
|
||||
isTransitive = false
|
||||
}
|
||||
"developmentFabric"(project(":common", configuration = "namedElements")) {
|
||||
isTransitive = false
|
||||
}
|
||||
bundle(project(path = ":common", configuration = "transformProductionFabric")) {
|
||||
isTransitive = false
|
||||
}
|
||||
modLocalRuntime(libs.fabric.debugutils)
|
||||
modImplementation(libs.fabric.loader)
|
||||
modApi(libs.fabric.api)
|
||||
modApi(libs.bundles.fabric)
|
||||
|
||||
modCompileOnly(libs.bundles.fabric.integrations.compileOnly) {
|
||||
isTransitive = false
|
||||
}
|
||||
modRuntimeOnly(libs.bundles.fabric.integrations.runtimeOnly)
|
||||
// modImplementation(libs.flywheelFabric)
|
||||
// include(libs.flywheelFabric)
|
||||
|
||||
include(libs.fabric.kotlin)
|
||||
|
||||
listOf(
|
||||
libs.graal,
|
||||
libs.molang
|
||||
).forEach {
|
||||
bundle(it)
|
||||
runtimeOnly(it)
|
||||
}
|
||||
|
||||
minecraftServerLibraries(libs.icu4j)
|
||||
// implementation(project(":common", configuration = "namedElements")) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
// "developmentFabric"(project(":common", configuration = "namedElements")) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
// bundle(project(path = ":common", configuration = "transformProductionFabric")) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
// modLocalRuntime(libs.fabric.debugutils)
|
||||
// modImplementation(libs.fabric.loader)
|
||||
// modApi(libs.fabric.api)
|
||||
// modApi(libs.bundles.fabric)
|
||||
//
|
||||
// modCompileOnly(libs.bundles.fabric.integrations.compileOnly) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
// modRuntimeOnly(libs.bundles.fabric.integrations.runtimeOnly)
|
||||
//// modImplementation(libs.flywheelFabric)
|
||||
//// include(libs.flywheelFabric)
|
||||
//
|
||||
// include(libs.fabric.kotlin)
|
||||
//
|
||||
// listOf(
|
||||
// libs.graal,
|
||||
// libs.molang
|
||||
// ).forEach {
|
||||
// bundle(it)
|
||||
// runtimeOnly(it)
|
||||
// }
|
||||
//
|
||||
// minecraftServerLibraries(libs.icu4j)
|
||||
|
||||
}
|
||||
|
||||
tasks {
|
||||
// The AW file is needed in :fabric project resources when the game is run.
|
||||
val copyAccessWidener by registering(Copy::class) {
|
||||
from(loom.accessWidenerPath)
|
||||
// from(loom.accessWidenerPath)
|
||||
into(generatedResources)
|
||||
dependsOn(checkLicenseMain)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
org.gradle.jvmargs=-Xmx8G
|
||||
org.gradle.daemon=false
|
||||
org.gradle.parallel=true
|
||||
#org.gradle.caching=true
|
||||
#org.gradle.configuration-cache=true
|
||||
|
||||
group=com.cobblemon.mod
|
||||
|
||||
|
||||
@@ -11,12 +11,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation(libs.kotlin)
|
||||
|
||||
implementation(libs.licenser)
|
||||
implementation(libs.shadow)
|
||||
implementation(libs.loom)
|
||||
implementation(libs.architectury)
|
||||
|
||||
implementation(libs.blossom)
|
||||
implementation(libs.ideaExt)
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import utilities.ACCESS_WIDENER
|
||||
|
||||
@@ -16,8 +17,6 @@ plugins {
|
||||
id("java-library")
|
||||
|
||||
id("org.cadixdev.licenser")
|
||||
id("dev.architectury.loom")
|
||||
id("architectury-plugin")
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
@@ -42,23 +41,6 @@ license {
|
||||
header(rootProject.file("HEADER"))
|
||||
}
|
||||
|
||||
architectury {
|
||||
minecraft = project.property("mc_version").toString()
|
||||
}
|
||||
|
||||
loom {
|
||||
silentMojangMappingsLicense()
|
||||
accessWidenerPath.set(project(":common").file(ACCESS_WIDENER))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft("net.minecraft:minecraft:${rootProject.property("mc_version")}")
|
||||
mappings(loom.layered {
|
||||
officialMojangMappings()
|
||||
parchment("org.parchmentmc.data:parchment-1.21:${rootProject.property("parchment_version")}")
|
||||
})
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
options.encoding = "UTF-8"
|
||||
@@ -67,7 +49,7 @@ tasks {
|
||||
}
|
||||
|
||||
withType<KotlinCompile> {
|
||||
kotlinOptions.jvmTarget = "21"
|
||||
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
|
||||
}
|
||||
|
||||
withType<Jar> {
|
||||
|
||||
@@ -13,15 +13,15 @@ val bundle: Configuration by configurations.creating {
|
||||
isCanBeResolved = true
|
||||
}
|
||||
|
||||
loom {
|
||||
val clientConfig = runConfigs.getByName("client")
|
||||
clientConfig.runDir = "runClient"
|
||||
clientConfig.programArg("--username=AshKetchum")
|
||||
//This is AshKetchum's UUID so you get an Ash Ketchum skin
|
||||
clientConfig.programArg("--uuid=93e4e551-589a-41cb-ab2d-435266c8e035")
|
||||
val serverConfig = runConfigs.getByName("server")
|
||||
serverConfig.runDir = "runServer"
|
||||
}
|
||||
//loom {
|
||||
// val clientConfig = runConfigs.getByName("client")
|
||||
// clientConfig.runDir = "runClient"
|
||||
// clientConfig.programArg("--username=AshKetchum")
|
||||
// //This is AshKetchum's UUID so you get an Ash Ketchum skin
|
||||
// clientConfig.programArg("--uuid=93e4e551-589a-41cb-ab2d-435266c8e035")
|
||||
// val serverConfig = runConfigs.getByName("server")
|
||||
// serverConfig.runDir = "runServer"
|
||||
//}
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -40,23 +40,23 @@ tasks {
|
||||
relocate ("com.oracle", "com.cobblemon.mod.relocations.oracle")
|
||||
}
|
||||
|
||||
remapJar {
|
||||
dependsOn(shadowJar)
|
||||
inputFile.set(shadowJar.flatMap { it.archiveFile })
|
||||
archiveBaseName.set("Cobblemon-${project.name}")
|
||||
archiveVersion.set("${rootProject.version}")
|
||||
}
|
||||
// remapJar {
|
||||
// dependsOn(shadowJar)
|
||||
// inputFile.set(shadowJar.flatMap { it.archiveFile })
|
||||
// archiveBaseName.set("Cobblemon-${project.name}")
|
||||
// archiveVersion.set("${rootProject.version}")
|
||||
// }
|
||||
//
|
||||
// val copyJar by registering(CopyFile::class) {
|
||||
// val productionJar = tasks.remapJar.flatMap { it.archiveFile }
|
||||
// fileToCopy = productionJar
|
||||
// destination = productionJar.flatMap {
|
||||
// rootProject.layout.buildDirectory.file("libs/${it.asFile.name}")
|
||||
// }
|
||||
// }
|
||||
|
||||
val copyJar by registering(CopyFile::class) {
|
||||
val productionJar = tasks.remapJar.flatMap { it.archiveFile }
|
||||
fileToCopy = productionJar
|
||||
destination = productionJar.flatMap {
|
||||
rootProject.layout.buildDirectory.file("libs/${it.asFile.name}")
|
||||
}
|
||||
}
|
||||
|
||||
assemble {
|
||||
dependsOn(copyJar)
|
||||
}
|
||||
// assemble {
|
||||
// dependsOn(copyJar)
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ plugins {
|
||||
id("java")
|
||||
id("java-library")
|
||||
id("maven-publish")
|
||||
id("dev.architectury.loom")
|
||||
}
|
||||
|
||||
java {
|
||||
@@ -25,16 +24,16 @@ publishing {
|
||||
}
|
||||
|
||||
publications {
|
||||
create<MavenPublication>(project.name) {
|
||||
artifact(tasks.remapJar)
|
||||
artifact(tasks.remapSourcesJar)
|
||||
|
||||
@Suppress("UnstableApiUsage")
|
||||
loom.disableDeprecatedPomGeneration(this)
|
||||
|
||||
groupId = "com.cobblemon"
|
||||
artifactId = project.findProperty("maven.artifactId")?.toString() ?: project.name
|
||||
version = project.writeVersion(VersionType.PUBLISHING)
|
||||
}
|
||||
// create<MavenPublication>(project.name) {
|
||||
// artifact(tasks.remapJar)
|
||||
// artifact(tasks.remapSourcesJar)
|
||||
//
|
||||
// @Suppress("UnstableApiUsage")
|
||||
// loom.disableDeprecatedPomGeneration(this)
|
||||
//
|
||||
// groupId = "com.cobblemon"
|
||||
// artifactId = project.findProperty("maven.artifactId")?.toString() ?: project.name
|
||||
// version = project.writeVersion(VersionType.PUBLISHING)
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,14 @@ shadow = "8.1.1"
|
||||
blossom = "2.1.0"
|
||||
idea-ext = "1.1.7"
|
||||
|
||||
# Loom
|
||||
loom = "1.7-SNAPSHOT"
|
||||
architectury-plugin = "3.4-SNAPSHOT"
|
||||
# Minecraft Development
|
||||
loom = "1.9.2"
|
||||
moddev = "2.0.74"
|
||||
neoform = "1.21.1-20240808.144430"
|
||||
|
||||
# Mixins
|
||||
mixin = "0.13.4+mixin.0.8.5"
|
||||
mixinExtras = "0.4.1"
|
||||
|
||||
# Common
|
||||
molang = "1.1.18"
|
||||
@@ -40,16 +45,22 @@ mockito = "5.2.0"
|
||||
mockk = "1.12.1"
|
||||
classgraph = "4.8.153"
|
||||
|
||||
[plugins]
|
||||
loom = { id = "fabric-loom", version.ref="loom" }
|
||||
moddev = { id = "net.neoforged.moddev", version.ref="moddev" }
|
||||
|
||||
[libraries]
|
||||
# General Buildscript Plugins
|
||||
kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||
loom = { group = "dev.architectury", name = "architectury-loom", version.ref = "loom" }
|
||||
architectury = { group = "architectury-plugin", name = "architectury-plugin.gradle.plugin", version.ref = "architectury-plugin" }
|
||||
shadow = { group = "com.github.johnrengelman", name = "shadow", version.ref = "shadow" }
|
||||
blossom = { group = "net.kyori", name = "blossom", version.ref = "blossom" }
|
||||
ideaExt = { group = "org.jetbrains.gradle.plugin.idea-ext", name = "org.jetbrains.gradle.plugin.idea-ext.gradle.plugin", version.ref = "idea-ext"}
|
||||
licenser = { group = "gradle.plugin.org.cadixdev.gradle", name = "licenser", version.ref = "licenser" }
|
||||
|
||||
# Mixins
|
||||
mixins-base = { group = "net.fabricmc", name = "sponge-mixin", version.ref = "mixin" }
|
||||
mixins-extras = { group = "io.github.llamalad7", name = "mixinextras-common", version.ref = "mixinExtras" }
|
||||
|
||||
# Kotlin
|
||||
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" }
|
||||
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
|
||||
@@ -82,7 +93,11 @@ mongo-driver-sync = { group = "org.mongodb", name = "mongodb-driver-sync", versi
|
||||
|
||||
# Testing
|
||||
junit-fabric = { group = "net.fabricmc", name = "fabric-loader-junit", version.ref = "fabric-loader" }
|
||||
|
||||
junit-core = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" }
|
||||
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" }
|
||||
junit-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" }
|
||||
|
||||
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
|
||||
mock-kotlin = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
|
||||
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" }
|
||||
@@ -93,4 +108,5 @@ fabric = [ "fabric-kotlin", "fabric-permissions" ]
|
||||
fabric-integrations-compileOnly = [ "adorn-fabric", "lambDynamicLights", "jei-api-fabric" ]
|
||||
fabric-integrations-runtimeOnly = [ "jei-fabric" ]
|
||||
mongo = [ "mongo-driver-core", "mongo-driver-sync" ]
|
||||
unitTesting = [ "junit-fabric", "junit-params", "mockito-core", "mock-kotlin", "classgraph" ]
|
||||
unitTesting = [ "junit-core", "junit-launcher", "junit-params", "mockito-core", "mock-kotlin", "classgraph" ]
|
||||
mixins = [ "mixins-base", "mixins-extras" ]
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+42
-42
@@ -13,16 +13,16 @@ plugins {
|
||||
id("cobblemon.publish-conventions")
|
||||
}
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
neoForge()
|
||||
}
|
||||
|
||||
loom {
|
||||
neoForge {
|
||||
|
||||
}
|
||||
}
|
||||
//architectury {
|
||||
// platformSetupLoomIde()
|
||||
// neoForge()
|
||||
//}
|
||||
//
|
||||
//loom {
|
||||
// neoForge {
|
||||
//
|
||||
// }
|
||||
//}
|
||||
|
||||
repositories {
|
||||
maven(url = "${rootProject.projectDir}/deps")
|
||||
@@ -33,35 +33,35 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
neoForge(libs.neoforge)
|
||||
//Because of the JEI mapping issues if we want
|
||||
//a forge launch we gotta do some wacky stuff
|
||||
//modImplementation(libs.jeiForge)
|
||||
//shadowCommon group: 'commons-io', name: 'commons-io', version: '2.6'
|
||||
//modImplementation(libs.flywheelForge)
|
||||
//include(libs.flywheelForge)
|
||||
modLocalRuntime(libs.neoforge.debugutils)
|
||||
implementation(project(":common", configuration = "namedElements")) {
|
||||
isTransitive = false
|
||||
}
|
||||
implementation(libs.neo.kotlin.forge) {
|
||||
exclude(group = "net.neoforged.fancymodloader", module = "loader")
|
||||
}
|
||||
"developmentNeoForge"(project(":common", configuration = "namedElements")) {
|
||||
isTransitive = false
|
||||
}
|
||||
bundle(project(path = ":common", configuration = "transformProductionNeoForge")) {
|
||||
isTransitive = false
|
||||
}
|
||||
testImplementation(project(":common", configuration = "namedElements"))
|
||||
|
||||
listOf(
|
||||
libs.graal,
|
||||
libs.molang
|
||||
).forEach {
|
||||
forgeRuntimeLibrary(it)
|
||||
bundle(it)
|
||||
}
|
||||
// neoForge(libs.neoforge)
|
||||
// //Because of the JEI mapping issues if we want
|
||||
// //a forge launch we gotta do some wacky stuff
|
||||
// //modImplementation(libs.jeiForge)
|
||||
// //shadowCommon group: 'commons-io', name: 'commons-io', version: '2.6'
|
||||
// //modImplementation(libs.flywheelForge)
|
||||
// //include(libs.flywheelForge)
|
||||
// modLocalRuntime(libs.neoforge.debugutils)
|
||||
// implementation(project(":common", configuration = "namedElements")) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
// implementation(libs.neo.kotlin.forge) {
|
||||
// exclude(group = "net.neoforged.fancymodloader", module = "loader")
|
||||
// }
|
||||
// "developmentNeoForge"(project(":common", configuration = "namedElements")) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
// bundle(project(path = ":common", configuration = "transformProductionNeoForge")) {
|
||||
// isTransitive = false
|
||||
// }
|
||||
// testImplementation(project(":common", configuration = "namedElements"))
|
||||
//
|
||||
// listOf(
|
||||
// libs.graal,
|
||||
// libs.molang
|
||||
// ).forEach {
|
||||
// forgeRuntimeLibrary(it)
|
||||
// bundle(it)
|
||||
// }
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -97,9 +97,9 @@ tasks {
|
||||
}
|
||||
|
||||
//Stole from architect discord, replaces loom.forge.convertAccessWideners
|
||||
tasks.remapJar {
|
||||
atAccessWideners.add("cobblemon-common.accesswidener")
|
||||
}
|
||||
//tasks.remapJar {
|
||||
// atAccessWideners.add("cobblemon-common.accesswidener")
|
||||
//}
|
||||
|
||||
|
||||
//jar {
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@ rootProject.name = "cobblemon"
|
||||
|
||||
listOf(
|
||||
"common",
|
||||
"fabric",
|
||||
"neoforge"
|
||||
// "fabric",
|
||||
// "neoforge"
|
||||
).forEach { setupProject(it, file(it)) }
|
||||
|
||||
fun setupProject(name: String, projectDirectory: File) = setupProject(name) {
|
||||
|
||||
Reference in New Issue
Block a user