CarryOn/Fabric/build.gradle
2023-07-25 14:07:05 +02:00

96 lines
2.6 KiB
Groovy

plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'maven-publish'
id 'idea'
}
archivesBaseName = "${mod_id}-fabric-${minecraft_version}"
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/22e7d543a18cd30675277fbfa3669e3d9e206010/generic/secrets.gradle'
if (project.hasProperty('secretFile')) {
loadSecrets(new File((String) findProperty('secretFile')))
}
if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}
repositories {
maven { url 'https://jitpack.io' }
maven {
url "https://maven.siphalor.de/"
name "Siphalor's Maven"
}
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchment_mappings_fabric}@zip")
}
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
implementation project(":Common")
include implementation("com.github.llamalad7.mixinextras:mixinextras-fabric:${mixinextras_version}")
annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${mixinextras_version}")
modRuntimeOnly "de.siphalor:amecsapi-1.19:1.3.9+mc1.19.4"
}
loom {
runs {
client {
client()
setConfigName("Fabric Client")
ideConfigGenerated(true)
runDir("run")
}
server {
server()
setConfigName("Fabric Server")
ideConfigGenerated(true)
runDir("run")
}
}
}
var refmap_target = archivesBaseName + "-"
processResources {
from project(":Common").sourceSets.main.resources
inputs.property "version", project.version
inputs.property "refmap_target", refmap_target
filesMatching("fabric.mod.json") {
expand "version": project.version
}
filesMatching("carryon.mixins.json") {
expand "refmap_target": refmap_target
}
}
tasks.withType(JavaCompile) {
source(project(":Common").sourceSets.main.allSource)
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}