MineLittlePony/build.gradle
2019-05-01 09:52:59 +02:00

164 lines
4.1 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
}
main {
}
fml {
compileClasspath += main.compileClasspath
compileClasspath += main.output
compileClasspath += client.output
}
// TODO: Disable the hidden "test" sourceset
// TODO: Disable the resources folders for sourcesets that don't need them
}
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 {
// TODO: Remember to add /bin/default to the Environment configs
// minelittlepony%%C:/.../bin/default
source sourceSets.fml
}
}
}
}
}
repositories {
maven {
url = 'https://repo.spongepowered.org/maven'
}
maven {
url = 'https://jitpack.io'
}
}
dependencies {
// TODO: Add HDSkins as a dependency. It won't compile without it.
// TODO: Add KirinUI as a dependency.
minecraft "net.minecraftforge:forge:" + project.minecraft_version + "-" + project.forge_version
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
transitive = false
}
compile "com.github.MineLittlePony:Kirin:master-SNAPSHOT:base"
compile "com.github.MineLittlePony:HDSkins:1.13-SNAPSHOT:base"
//
// compile(project(':HDSkins')) {
// transitive = false
// }
}
compileJava.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
classifier 'base'
extension 'jar'
}
//
// 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"
}