Lymel/build.gradle

94 lines
3.5 KiB
Groovy
Raw Normal View History

2023-03-25 14:12:37 +00:00
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'maven-publish'
}
2023-03-25 14:20:07 +00:00
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
2023-03-25 14:12:37 +00:00
version = project.mod_version
group = project.maven_group
repositories {
2023-03-25 14:20:07 +00:00
maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
maven { url "https://maven.terraformersmc.com/releases"}
maven {
name = 'Ladysnake Mods'
url = 'https://ladysnake.jfrog.io/artifactory/mods'
}
2023-03-25 14:12:37 +00:00
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
2023-03-25 14:20:07 +00:00
modImplementation 'software.bernie.geckolib:geckolib-fabric-1.19.3:4.0.3'
implementation 'org.mongodb:mongodb-driver-reactivestreams:4.9.0'
modApi "com.terraformersmc:modmenu:${project.modmenu_version}"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cardinal_component_version}"
// Adds a dependency on a specific module
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cardinal_component_version}"
// Includes Cardinal Components API as a Jar-in-Jar dependency (optional)
include "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cardinal_component_version}"
include "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cardinal_component_version}"
}
2023-03-25 14:12:37 +00:00
processResources {
inputs.property "version", project.version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
// 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.
it.options.encoding = "UTF-8"
2023-03-25 14:20:07 +00:00
if (Integer.parseInt(targetCompatibility as String) >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = Integer.parseInt(targetCompatibility as String)
2023-03-25 14:12:37 +00:00
}
}
java {
2023-03-25 14:20:07 +00:00
def javaVersion = JavaVersion.toVersion(targetCompatibility)
2023-03-25 14:12:37 +00:00
if (JavaVersion.current() < javaVersion) {
2023-03-25 14:20:07 +00:00
toolchain.languageVersion = JavaLanguageVersion.of(targetCompatibility as String)
2023-03-25 14:12:37 +00:00
}
2023-03-25 14:20:07 +00:00
2023-03-25 14:12:37 +00:00
// 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()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
// 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.
}
}