Files
CraterLib/build.gradle
2024-12-03 15:09:07 +02:00

135 lines
4.1 KiB
Groovy

plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id "xyz.wagyourtail.unimined" version "1.3.9" apply false
id "com.hypherionmc.modutils.modpublisher" version "2.1.6"
id "com.hypherionmc.modutils.orion" version "1.0.24"
id "com.hypherionmc.modutils.orion.origami" version "1.0.24" apply false
id 'maven-publish'
}
var relType = project.properties["releaseType"] ?: "${release_type}"
ext {
isPort = (relType == 'port')
}
orion.setup {
multiProject = true
enableMirrorMaven = true
enableReleasesMaven = true
enableSnapshotsMaven = isPort
dopplerToken = System.getenv("DOPPLER_KEY")
versioning {
identifier("${relType}")
}
}
group = project_group
subprojects {
apply plugin: "xyz.wagyourtail.unimined"
apply plugin: "java"
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.hypherionmc.modutils.modpublisher'
if (project.name === "Paper") {
apply plugin: 'com.hypherionmc.modutils.orion.origami'
}
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
group = rootProject.group
repositories {
mavenCentral()
mavenLocal()
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
configurations {
shade
modCompileOnly
stupidRemapArch
implementation.extendsFrom shade
compileOnly.extendsFrom modCompileOnly
compileOnly.extendsFrom stupidRemapArch
}
dependencies {
// All Projects
shade "me.hypherionmc.moon-config:core:${moon_config}"
shade "me.hypherionmc.moon-config:toml:${moon_config}"
shade "me.hypherionmc.moon-config:json:${moon_config}"
shade "com.hypherionmc:rpcsdk:${rpc_sdk}"
shade "me.hypherionmc.sdlink:mcdiscordformatter-1.20.3:${discord_formatter}"
shade "net.kyori:adventure-api:${adventure}"
shade "net.kyori:adventure-text-serializer-gson:${adventure}"
shade "net.kyori:adventure-text-minimessage:${adventure}"
compileOnly 'net.luckperms:api:5.4'
compileOnly("org.projectlombok:lombok:${lombok}")
annotationProcessor("org.projectlombok:lombok:${lombok}")
}
jar {
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version
])
}
}
/**
* ===============================================================================
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =
* ===============================================================================
*/
if (project.name !== "Paper") {
unimined.minecraft(sourceSets.main, true) {
version minecraft_version
mappings {
mojmap()
devNamespace "mojmap"
}
mods {
remap(configurations.stupidRemapArch) {
catchAWNamespaceAssertion()
}
}
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 21
}
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
}
// TODO MODULE JARS