Files
simple-hammers/build.gradle
T

123 lines
3.8 KiB
Groovy

plugins {
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish'
}
version = "${project.mod_version}-${project.minecraft_version}"
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url 'https://jitpack.io' }
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/" }
maven { url "https://maven.bigduckie.dev/releases" }
}
loom {
splitEnvironmentSourceSets()
mods {
"simple-hammers" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
}
fabricApi {
configureDataGeneration()
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Magna (https://github.com/Draylar/magna) for hammers
include "dev.draylar:magna:${project.magna_version}"
modImplementation("dev.draylar:magna:${project.magna_version}") {
exclude group: "net.fabricmc"
exclude group: "com.jamieswhiteshirt"
exclude group: "me.shedaniel.cloth"
exclude module: "omega-config-base"
}
// Static Content (https://github.com/Draylar/static-content) for hammer loading and compat
include "dev.bigduckie:static-content:${project.static_content_version}"
modImplementation("dev.bigduckie:static-content:${project.static_content_version}") {
exclude group: "net.fabricmc"
exclude module: "omega-config-base"
}
// Config solutions + Cloth Config for Magna
modImplementation "dev.draylar.omega-config:omega-config-base:${project.omega_config_version}"
include "dev.draylar.omega-config:omega-config-base:${project.omega_config_version}"
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
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()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" }
}
}
// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
version = "${project.mod_version}+${project.minecraft_version}"
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
maven {
name = "personal"
url = "https://maven.bigduckie.dev/releases"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}