123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- 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()
- }
- }
|