MineLittlePony/build.gradle

164 lines
4 KiB
Groovy
Raw Normal View History

2016-01-15 08:49:17 +01:00
buildscript {
2018-07-09 00:58:20 +02:00
repositories {
jcenter()
maven {
name 'forge'
url 'http://files.minecraftforge.net/maven'
}
2019-05-01 02:57:19 +02:00
// maven {
// name = 'sponge'
// url = 'https://repo.spongepowered.org/maven'
// }
2018-07-09 00:58:20 +02:00
}
dependencies {
2019-03-24 11:07:41 +01:00
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
2019-05-01 02:57:19 +02:00
classpath 'org.ajoberstar.grgit:grgit-gradle:3.1.1'
2018-07-09 00:58:20 +02:00
}
2016-01-15 08:49:17 +01:00
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
2018-07-09 00:00:58 +02:00
apply plugin: 'com.github.johnrengelman.shadow'
2019-05-01 02:57:19 +02:00
apply plugin: 'org.ajoberstar.grgit'
2016-01-15 08:49:17 +01:00
sourceCompatibility = '1.8'
targetCompatibility = '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"
}
}
2019-02-05 14:48:35 +01:00
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
2019-03-24 11:04:36 +01:00
archivesBaseName = project.name
2015-08-02 00:36:33 +02:00
2015-12-09 22:05:21 +01:00
sourceSets {
2019-03-24 10:30:57 +01:00
client {
// Client-only code
compileClasspath += main.compileClasspath
compileClasspath += main.output
2018-07-09 00:58:20 +02:00
}
2019-03-24 10:30:57 +01:00
main {
}
fml {
compileClasspath += main.compileClasspath
compileClasspath += main.output
compileClasspath += client.output
}
2019-04-14 13:32:01 +02:00
// TODO: Disable the hidden "test" sourceset
// TODO: Disable the resources folders for sourcesets that don't need them
}
2019-03-24 11:22:25 +01:00
minecraft {
2019-03-25 00:29:56 +01:00
mappings channel: project.mappings_channel, version: project.mappings_version + "-" + project.minecraft_version
2019-03-24 11:22:25 +01:00
runs {
client {
workingDirectory project.file('run')
2019-04-14 13:56:09 +02:00
property 'forge.logging.markers', 'SCAN'
2019-03-24 11:22:25 +01:00
property 'forge.logging.console.level', 'debug'
mods {
minelittlepony {
// TODO: Remember to add /bin/default to the Environment configs
2019-03-31 12:28:14 +02:00
// minelittlepony%%C:/.../bin/default
source sourceSets.fml
2019-03-24 11:22:25 +01:00
}
}
}
}
}
2019-03-25 00:29:56 +01:00
repositories {
maven {
url = 'https://repo.spongepowered.org/maven'
}
2019-05-01 02:57:19 +02:00
maven {
url = 'https://jitpack.io'
}
2019-03-25 00:29:56 +01:00
}
2018-07-08 09:35:11 +02:00
dependencies {
// TODO: Add HDSkins as a dependency. It won't compile without it.
2019-04-14 13:32:01 +02:00
// TODO: Add KirinUI as a dependency.
2019-04-14 13:56:09 +02:00
minecraft "net.minecraftforge:forge:" + project.minecraft_version + "-" + project.forge_version
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
transitive = false
}
2019-05-01 02:57:19 +02:00
compile "com.github.MineLittlePony:Kirin:master-SNAPSHOT:base"
compile "com.github.MineLittlePony:HDSkins:1.13-SNAPSHOT:base"
//
// compile(project(':HDSkins')) {
// transitive = false
// }
2018-07-08 09:35:11 +02:00
}
2019-05-01 02:57:19 +02:00
compileJava.options.compilerArgs += '-proc:none'
manifest {
2019-04-14 13:56:09 +02:00
attributes(
"Implementation-Version": "${version} (git-${project.hash})",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
)
}
2018-07-08 09:35:11 +02:00
2015-08-02 00:36:33 +02:00
jar {
from sourceSets.main.output
from sourceSets.client.output
from sourceSets.fml.output
classifier 'base'
extension 'jar'
2018-07-09 00:00:58 +02:00
}
2019-04-14 13:56:09 +02:00
//
// Imports the Background Ponies from the MLP Community Skin Pack
//
task copyBGPones(type: Copy) {
def illegals = /[^a-z0-9_\/.-]/
2018-11-14 22:21:40 +01:00
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, '')
}
}
}
2019-04-14 13:56:09 +02:00
//
// Creates HorseLib
// A common library for mods to load MineLP features on the server without
// any client components
2019-03-24 10:30:57 +01:00
task horseLib(type: Jar) {
2019-04-14 13:56:09 +02:00
// TODO: Add KirinUI as a dependency.
2019-03-24 10:30:57 +01:00
from sourceSets.main.output
2019-04-14 13:56:09 +02:00
baseName = "HorseLib"
2019-03-24 10:30:57 +01:00
}