97 lines
2.4 KiB
Groovy
97 lines
2.4 KiB
Groovy
plugins {
|
|
id 'fabric-loom' version '0.8-SNAPSHOT'
|
|
id 'maven-publish'
|
|
id "io.freefair.lombok" version "6.0.0-m2"
|
|
id "com.diffplug.spotless" version "5.17.1"
|
|
}
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_16
|
|
targetCompatibility = JavaVersion.VERSION_16
|
|
|
|
archivesBaseName = project.archives_base_name
|
|
version = project.mod_version
|
|
group = project.maven_group
|
|
|
|
minecraft {
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://masa.dy.fi/maven' }
|
|
maven { url 'https://jitpack.io' }
|
|
}
|
|
|
|
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_api_version}"
|
|
modImplementation "fi.dy.masa.malilib:malilib-fabric-1.17.1:${project.malilib_version}"
|
|
modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}"
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "version", project.version
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand "version": project.version
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
it.options.encoding = "UTF-8"
|
|
it.options.release = 16
|
|
}
|
|
|
|
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
|
// if it is present.
|
|
// If you remove this task, sources will not be generated.
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
classifier = "sources"
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
jar {
|
|
from "LICENSE.txt"
|
|
}
|
|
|
|
spotless {
|
|
ratchetFrom 'origin/main'
|
|
format 'misc', {
|
|
// define the files to apply `misc` to
|
|
target '*.gradle', '*.md', '.gitignore'
|
|
|
|
// define the steps to apply to those files
|
|
trimTrailingWhitespace()
|
|
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
|
|
endWithNewline()
|
|
}
|
|
java {
|
|
target 'src/*/java/**/*.java'
|
|
googleJavaFormat('1.12.0').aosp().reflowLongStrings()
|
|
removeUnusedImports()
|
|
licenseHeaderFile "HEADER.txt"
|
|
}
|
|
}
|
|
|
|
// configure the maven publication
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
// add all the jars that should be included when publishing to maven
|
|
artifact(remapJar) {
|
|
builtBy remapJar
|
|
}
|
|
artifact(sourcesJar) {
|
|
builtBy remapSourcesJar
|
|
}
|
|
}
|
|
}
|
|
|
|
// select the repositories you want to publish to
|
|
repositories {
|
|
// uncomment to publish to the local maven
|
|
// mavenLocal()
|
|
}
|
|
}
|