AE2LegacyQuartz/build.gradle
2024-09-07 09:20:40 +03:00

118 lines
2.9 KiB
Groovy

plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.145'
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22'
}
tasks.named('wrapper', Wrapper).configure {
distributionType = Wrapper.DistributionType.BIN
}
version = "${minecraft_version}-${mod_version}"
group = 'ru.yurannnzzz'
base {
archivesName = mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
runs {
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
}
client {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
configurations {
runtimeClasspath.extendsFrom localRuntime
}
repositories {
mavenLocal()
maven {
name = 'Kotlin for Forge'
url = 'https://thedarkcolour.github.io/KotlinForForge/'
}
maven {
name = 'Modmaven'
url = 'https://modmaven.dev/'
content {
includeGroup 'appeng'
includeGroup 'mezz.jei'
}
}
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
implementation "thedarkcolour:kotlinforforge-neoforge:${kff_version}"
implementation "appeng:appliedenergistics2-neoforge:${ae2_version}"
runtimeOnly "mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}"
}
tasks.withType(ProcessResources).configureEach {
var replaceProperties = [
loader_name: loader_name, loader_version_range: loader_version_range,
mod_id: mod_id, mod_version: mod_version,
neo_version: neo_version, neo_version_range: neo_version_range,
minecraft_version_range: minecraft_version_range,
ae2_version_range: ae2_version_range,
]
inputs.properties replaceProperties
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties
}
}
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/repo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}