More-Red-CCT-Compat/build.gradle
2023-07-18 05:04:10 +03:00

128 lines
3.9 KiB
Groovy

plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
}
version = "${minecraft_version}-${mod_version}"
group = mod_group_id
base {
archivesName = archive_base_name
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: mapping_channel, version: mapping_version
copyIdeResources = true
runs {
configureEach {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'debug'
mods {
"${mod_id}" {
source sourceSets.main
}
}
}
client {
property 'forge.enabledGameTestNamespaces', mod_id
}
server {
property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
}
}
}
repositories {
maven {
url 'https://squiddev.cc/maven/'
content {
includeGroup 'cc.tweaked'
includeModule('org.squiddev', 'Cobalt')
}
}
maven {
url 'https://cubicinterpolation.net/maven/'
content {
includeGroup 'commoble.morered'
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly("cc.tweaked:cc-tweaked-${minecraft_version}-core-api:${cctweaked_version}")
compileOnly(fg.deobf("cc.tweaked:cc-tweaked-${minecraft_version}-forge-api:${cctweaked_version}"))
implementation(fg.deobf("cc.tweaked:cc-tweaked-${minecraft_version}-forge:${cctweaked_version}"))
implementation fg.deobf("commoble.morered:morered-${minecraft_version}:${morered_version}")
}
tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
forge_version: forge_version, forge_version_range: forge_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/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}
// Example for how to get properties into the manifest for reading at runtime.
tasks.named('jar', Jar).configure {
manifest {
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : mod_authors,
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
// This is the preferred method to reobfuscate your jar file
finalizedBy 'reobfJar'
}
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing:
// tasks.named('publish').configure {
// dependsOn 'reobfJar'
// }
// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}