136 lines
3.8 KiB
Groovy
136 lines
3.8 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'idea'
|
|
id 'net.neoforged.moddev' version '2.0.77'
|
|
}
|
|
|
|
version = "${minecraft_version}-${mod_version}"
|
|
group = mod_group_id
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
}
|
|
|
|
base {
|
|
archivesName = archive_base_name
|
|
}
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
|
|
|
neoForge {
|
|
// Specify the version of NeoForge to use.
|
|
version = project.neo_version
|
|
|
|
parchment {
|
|
mappingsVersion = project.parchment_mappings_version
|
|
minecraftVersion = project.parchment_minecraft_version
|
|
}
|
|
|
|
runs {
|
|
client {
|
|
client()
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
|
}
|
|
|
|
server {
|
|
server()
|
|
programArgument '--nogui'
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
|
}
|
|
|
|
gameTestServer {
|
|
type = "gameTestServer"
|
|
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
|
|
}
|
|
|
|
data {
|
|
data()
|
|
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
|
|
}
|
|
|
|
configureEach {
|
|
systemProperty 'forge.logging.markers', 'REGISTRIES'
|
|
logLevel = org.slf4j.event.Level.DEBUG
|
|
}
|
|
}
|
|
|
|
mods {
|
|
"${mod_id}" {
|
|
sourceSet(sourceSets.main)
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
|
|
|
repositories {
|
|
maven {
|
|
url 'https://maven.squiddev.cc'
|
|
content {
|
|
includeGroup 'cc.tweaked'
|
|
}
|
|
}
|
|
maven {
|
|
url 'https://commoble.net/maven/'
|
|
content {
|
|
includeGroup 'net.commoble.morered'
|
|
}
|
|
}
|
|
mavenLocal()
|
|
}
|
|
|
|
dependencies {
|
|
|
|
compileOnly "cc.tweaked:cc-tweaked-${minecraft_version}-forge-api:${cctweaked_version}"
|
|
implementation "cc.tweaked:cc-tweaked-${minecraft_version}-forge:${cctweaked_version}"
|
|
|
|
implementation "net.commoble.morered:morered-${minecraft_version_major}:${morered_version}"
|
|
}
|
|
|
|
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
|
|
var replaceProperties = [minecraft_version : minecraft_version,
|
|
minecraft_version_range: minecraft_version_range,
|
|
neo_version : neo_version,
|
|
neo_version_range : neo_version_range,
|
|
loader_version_range : loader_version_range,
|
|
mod_id : mod_id,
|
|
mod_name : mod_name,
|
|
mod_license : mod_license,
|
|
mod_version : mod_version,
|
|
mod_authors : mod_authors,
|
|
mod_description : mod_description,
|
|
mod_issue_tracker_url : mod_issue_tracker_url,
|
|
mod_display_url : mod_display_url,
|
|
cctweaked_version_range: cctweaked_version_range,
|
|
morered_version_range : morered_version_range]
|
|
inputs.properties replaceProperties
|
|
expand replaceProperties
|
|
from "src/main/templates"
|
|
into "build/generated/sources/modMetadata"
|
|
}
|
|
|
|
sourceSets.main.resources.srcDir generateModMetadata
|
|
|
|
neoForge.ideSyncTask generateModMetadata
|
|
|
|
publishing {
|
|
publications {
|
|
register('mavenJava', MavenPublication) {
|
|
from components.java
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url "file://${project.projectDir}/repo"
|
|
}
|
|
}
|
|
}
|
|
|
|
idea {
|
|
module {
|
|
downloadSources = true
|
|
downloadJavadoc = true
|
|
}
|
|
}
|