ModernFix-fix/build.gradle
2023-04-15 14:22:36 -04:00

170 lines
5.5 KiB
Groovy

plugins {
id "dev.architectury.loom" version "1.1-SNAPSHOT"
id "maven-publish"
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.palantir.git-version' version '1.0.0'
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
group = 'org.embeddedt'
version = gitVersion()
java {
archivesBaseName = 'modernfix-mc' + minecraft_version
}
loom {
// use this if you are using the official mojang mappings
// and want loom to stop warning you about their license
silentMojangMappingsLicense()
// since loom 0.10, you are **required** to use the
// "forge" block to configure forge-specific features,
// such as the mixinConfigs array or datagen
forge {
// specify the mixin configs used in this mod
// this will be added to the jar manifest as well!
mixinConfigs = [
"modernfix.mixins.json"
]
}
mixin.defaultRefmapName = "modernfix.refmap.json"
}
repositories {
maven { url 'https://modmaven.dev/' }
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
maven {
// Shedaniel's maven (Architectury API)
url = "https://maven.architectury.dev"
content {
includeGroup "me.shedaniel"
}
}
maven {
// saps.dev Maven (KubeJS and Rhino)
url = "https://maven.saps.dev/minecraft"
content {
includeGroup "dev.latvian.mods"
}
}
maven { // CTM
url "https://maven.tterrag.com/"
}
maven { url "https://maven.shedaniel.me" }
}
dependencies {
// to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
// choose what mappings you want to use here
// leave this uncommented if you want to use
// mojang's official mappings, or feel free
// to add your own mappings here (how about
// mojmap layered with parchment, for example?)
mappings loom.officialMojangMappings()
/*
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
}
*/
// uncomment this if you want to use yarn mappings
// mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
// your forge dependency, this is **required** when using Forge Loom in forge mode!
forge "net.minecraftforge:forge:${project.forge_version}"
modCompileOnly("curse.maven:refinedstorage-243076:${refined_storage_version}")
// compile against the JEI API but do not include it at runtime
modCompileOnly("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
modCompileOnly "me.shedaniel:RoughlyEnoughItems-forge:${rei_version}"
modCompileOnly("dev.latvian.mods:kubejs-forge:${kubejs_version}")
modRuntimeOnly("curse.maven:ferritecore-429235:4441949")
modCompileOnly("team.chisel.ctm:CTM:${ctm_version}")
modCompileOnly("curse.maven:supermartijncore-454372:4484241")
}
tasks.withType(JavaCompile) {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
options.encoding = "UTF-8"
def targetVersion = 17
if (JavaVersion.current().isJava9Compatible()) {
options.release = targetVersion
}
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
// withSourcesJar()
}
// Example for how to get properties into the manifest for reading at runtime.
jar {
manifest {
attributes([
"Specification-Title" : "modernfix",
"Operative-Class" : "org.embeddedt.modernfix.agent.Agent",
//"Specification-Vendor": "modernfix authors",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
//"Implementation-Vendor": "modernfix authors",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
curseforge {
if (System.getenv("CURSEFORGE_TOKEN") != null) {
apiKey = System.getenv("CURSEFORGE_TOKEN")
project {
id = "790626"
changelog = '[Changelog is not currently available]'
changelogType = "markdown"
releaseType = "beta"
addGameVersion "Forge"
addGameVersion minecraft_version
mainArtifact remapJar
}
}
}