plugins { id 'fabric-loom' version '0.2.6-SNAPSHOT' id 'maven-publish' id 'net.minecrell.licenser' version '0.4.1' } sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 archivesBaseName = project.archives_base_name version = (project.mod_version as String).contains("unstable") ? (project.mod_version + "." + buildTime()) : project.mod_version group = project.maven_group static def buildTime() { def df = new java.text.SimpleDateFormat("yyyyMMddHHmm") df.setTimeZone(TimeZone.getTimeZone("UTC")) return df.format(new Date()) } license { header rootProject.file('HEADER') include '**/*.java' } minecraft { } 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" modCompile "net.fabricmc:fabric-loader:${project.loader_version}" // Fabric API. This is technically optional, but you probably want it anyway. modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. modCompileOnly ("io.github.prospector:modmenu:${project.modmenu_version}") { transitive = false } modRuntime ("io.github.prospector:modmenu:${project.modmenu_version}") { transitive = false } modCompileOnly ("me.shedaniel:RoughlyEnoughItems:${project.roughlyenoughitems}") modRuntime ("me.shedaniel:RoughlyEnoughItems:${project.roughlyenoughitems}") modRuntime ("me.shedaniel.cloth:config-2:2.9.3") { force(true) } compileOnly "com.google.code.findbugs:jsr305:3.0.2" compileOnly 'org.jetbrains:annotations:15.0' modRuntime("com.lettuce.fudge:notenoughcrashes:${project.notenoughcrashes_version}") { transitive = false } } processResources { inputs.property "version", project.version from(sourceSets.main.resources.srcDirs) { include "fabric.mod.json" expand "version": project.version } from(sourceSets.main.resources.srcDirs) { exclude "fabric.mod.json" } } tasks.withType(JavaCompile) { options.encoding = "UTF-8" } task sourcesJar(type: Jar, dependsOn: classes) { classifier = "sources" from sourceSets.main.allSource } jar { from "LICENSE" } // 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() } }