More-Red-CCT-Compat/build.gradle

123 lines
3.2 KiB
Groovy

plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.145'
}
tasks.named('wrapper', Wrapper).configure {
distributionType = Wrapper.DistributionType.BIN
}
version = "${minecraft_version}-${mod_version}"
group = mod_group_id
repositories {
mavenLocal()
}
base {
archivesName = archive_base_name
}
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'
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
configurations {
runtimeClasspath.extendsFrom localRuntime
}
repositories {
maven {
url 'https://squiddev.cc/maven/'
content {
includeGroup 'cc.tweaked'
includeModule('org.squiddev', 'Cobalt')
}
}
maven {
url 'https://commoble.net/maven/'
content {
includeGroup 'net.commoble.morered'
}
}
maven {
url 'https://cursemaven.com'
content {
includeGroup 'curse.maven'
}
}
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
compileOnly "cc.tweaked:cc-tweaked-${minecraft_version_major}-core-api:${cctweaked_version}"
compileOnly "cc.tweaked:cc-tweaked-${minecraft_version_major}-forge-api:${cctweaked_version}"
compileOnly "cc.tweaked:cc-tweaked-${minecraft_version_major}-forge:${cctweaked_version}"
runtimeOnly "curse.maven:cc-tweaked-282001:${cctweaked_file_id}" // 1.113.0 is NOT on maven, why??????????????????????
implementation "net.commoble.morered:morered-${minecraft_version_major}:${morered_version}"
}
tasks.withType(ProcessResources).configureEach {
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
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' // Use the UTF-8 charset for Java compilation
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}