MineLittlePony/build.gradle
Matthew Messinger 60f2f9590f Now it compiles
2019-05-17 00:24:40 -04:00

152 lines
3.8 KiB
Groovy

buildscript {
repositories {
jcenter()
maven {
name 'forge'
url 'http://files.minecraftforge.net/maven'
}
// maven {
// name = 'sponge'
// url = 'https://repo.spongepowered.org/maven'
// }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath 'org.ajoberstar.grgit:grgit-gradle:3.1.1'
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.ajoberstar.grgit'
// From the forge MDK: Need this here so eclipse task generates correctly.
targetCompatibility = compileJava.targetCompatibility = 1.8
sourceCompatibility = compileJava.sourceCompatibility = 1.8
ext {
revision = grgit.log().size()
hash = grgit.head().abbreviatedId
if (file('.git/shallow').exists()) {
// don't clone with --depth
revision = -1
hash += " shallow"
}
}
version = "${project.minecraft_version}.${project.version}"
if (project.release != 'RELEASE') {
version += "-${project.release}"
}
if (project.release == 'SNAPSHOT') {
version += "-${project.revision}-${project.hash}"
}
group = project.group
description = project.displayname
archivesBaseName = project.name
sourceSets {
client {
// Client-only code
compileClasspath += main.compileClasspath
compileClasspath += main.output
}
fml {
compileClasspath += main.compileClasspath
compileClasspath += main.output
compileClasspath += client.output
}
}
minecraft {
mappings channel: project.mappings_channel, version: project.mappings_version + "-" + project.minecraft_version
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN'
property 'forge.logging.console.level', 'debug'
mods {
minelittlepony {
source sourceSets.fml
}
}
ideaModule = "${project.name}.fml"
}
}
}
repositories {
maven {
url = 'https://repo.spongepowered.org/maven'
}
maven {
url = 'https://jitpack.io'
}
}
dependencies {
minecraft "net.minecraftforge:forge:" + project.minecraft_version + "-" + project.forge_version
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
transitive = false
}
compile fg.deobf("com.github.MineLittlePony:Kirin:master-SNAPSHOT")
compile fg.deobf(project.dependencies.create("com.github.MineLittlePony:HDSkins:1.13-SNAPSHOT") {
transitive = false
})
}
tasks.withType(JavaCompile) {
it.options.compilerArgs += '-proc:none'
}
manifest {
attributes(
"Implementation-Version": "${version} (git-${project.hash})",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
)
}
jar {
from sourceSets.main.output
from sourceSets.client.output
from sourceSets.fml.output
}
//
// Imports the Background Ponies from the MLP Community Skin Pack
//
task copyBGPones(type: Copy) {
def illegals = /[^a-z0-9_\/.-]/
from "skins/Background Ponies"
into temporaryDir
eachFile {
if (it.name =~ illegals){
logger.warn("Sanitizing file with illegal characters: ${it.path}")
it.name = it.name.replaceAll(/\s/, '_').replaceAll(illegals, '')
}
}
}
//
// Creates HorseLib
// A common library for mods to load MineLP features on the server without
// any client components
task horseLib(type: Jar) {
// TODO: Add KirinUI as a dependency.
from sourceSets.main.output
baseName = "HorseLib"
}