96 lines
2.1 KiB
Groovy
96 lines
2.1 KiB
Groovy
|
plugins {
|
||
|
id 'fabric-loom' version '0.12-SNAPSHOT'
|
||
|
id 'maven-publish'
|
||
|
id 'idea'
|
||
|
}
|
||
|
|
||
|
archivesBaseName = "${mod_name}-fabric-${minecraft_version}"
|
||
|
|
||
|
dependencies {
|
||
|
minecraft "com.mojang:minecraft:${minecraft_version}"
|
||
|
mappings loom.officialMojangMappings()
|
||
|
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
|
||
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
||
|
implementation project(":Common")
|
||
|
|
||
|
modApi("me.hypherionmc.craterlib:CraterLib-fabric-1.19.1:${craterlib_version}") {
|
||
|
exclude(group: "net.fabricmc.fabric-api")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
loom {
|
||
|
accessWidenerPath = project(":Common").file("src/main/resources/hyperlighting.aw")
|
||
|
runs {
|
||
|
client {
|
||
|
client()
|
||
|
setConfigName("Fabric Client")
|
||
|
ideConfigGenerated(true)
|
||
|
runDir("run")
|
||
|
}
|
||
|
server {
|
||
|
server()
|
||
|
setConfigName("Fabric Server")
|
||
|
ideConfigGenerated(true)
|
||
|
runDir("run")
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
processResources {
|
||
|
from project(":Common").sourceSets.main.resources
|
||
|
inputs.property "version", project.version
|
||
|
|
||
|
filesMatching("fabric.mod.json") {
|
||
|
expand "version": project.version
|
||
|
}
|
||
|
|
||
|
filesMatching('*.mixins.json') {
|
||
|
expand "refmap_target": "${archivesBaseName}-"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
tasks.withType(JavaCompile) {
|
||
|
source(project(":Common").sourceSets.main.allSource)
|
||
|
}
|
||
|
|
||
|
jar {
|
||
|
from("LICENSE") {
|
||
|
rename { "${it}_${mod_name}" }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
publishing {
|
||
|
publications {
|
||
|
mavenJava(MavenPublication) {
|
||
|
groupId project.group
|
||
|
artifactId project.archivesBaseName
|
||
|
version project.version
|
||
|
from components.java
|
||
|
}
|
||
|
}
|
||
|
|
||
|
repositories {
|
||
|
maven {
|
||
|
url "file://" + System.getenv("local_maven")
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
task delDevJar {
|
||
|
doLast {
|
||
|
def tree = fileTree('build/libs')
|
||
|
tree.include '**/*-dev.jar'
|
||
|
tree.each { it.delete() }
|
||
|
}
|
||
|
}
|
||
|
build.finalizedBy delDevJar
|
||
|
|
||
|
task copyAllArtifacts(type: Copy) {
|
||
|
from "$buildDir/libs"
|
||
|
into "$rootDir/artifacts"
|
||
|
include("*.jar")
|
||
|
}
|
||
|
|
||
|
build.finalizedBy(copyAllArtifacts);
|