2019-05-27 17:59:15 +02:00
|
|
|
// Frabric build script
|
|
|
|
// 24/05/2019
|
|
|
|
// https://github.com/FabricMC/fabric-example-mod/blob/master/build.gradle
|
|
|
|
|
2016-01-15 08:49:17 +01:00
|
|
|
buildscript {
|
2019-05-27 17:59:15 +02:00
|
|
|
repositories {
|
|
|
|
jcenter()
|
|
|
|
maven {
|
|
|
|
name = 'Fabric'
|
|
|
|
url = 'https://maven.fabricmc.net/'
|
|
|
|
}
|
|
|
|
gradlePluginPortal()
|
|
|
|
}
|
2018-07-09 00:58:20 +02:00
|
|
|
dependencies {
|
2019-05-27 17:59:15 +02:00
|
|
|
classpath 'fabric-loom:fabric-loom.gradle.plugin:0.2.2-SNAPSHOT'
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-05-27 17:59:15 +02:00
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = 'Jit'
|
|
|
|
url = 'https://jitpack.io'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'fabric-loom'
|
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
|
|
|
|
2019-05-27 17:59:15 +02:00
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
2019-03-24 10:54:38 +01:00
|
|
|
|
2018-08-22 01:57:28 +02:00
|
|
|
ext {
|
2019-05-29 22:17:37 +02:00
|
|
|
if (grgit == null) {
|
|
|
|
revision = "nogit"
|
|
|
|
} else {
|
|
|
|
revision = "${grgit.log().size()}-${grgit.head().abbreviatedId}"
|
|
|
|
if (file('.git/shallow').exists()) {
|
|
|
|
// don't clone with --depth
|
|
|
|
revision = "-1-${shallow}"
|
|
|
|
}
|
2018-08-22 01:57:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-05 14:48:35 +01:00
|
|
|
version = "${project.minecraft_version}.${project.version}"
|
|
|
|
|
2018-08-22 01:57:28 +02:00
|
|
|
if (project.release != 'RELEASE') {
|
|
|
|
version += "-${project.release}"
|
|
|
|
}
|
|
|
|
if (project.release == 'SNAPSHOT') {
|
2019-05-29 22:17:37 +02:00
|
|
|
version += "-${project.revision}"
|
2018-08-22 01:57:28 +02:00
|
|
|
}
|
|
|
|
|
2018-08-22 02:29:17 +02:00
|
|
|
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
|
|
|
|
2019-05-27 17:59:15 +02:00
|
|
|
dependencies {
|
|
|
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
|
|
|
mappings "net.fabricmc:yarn:${project.yarn_mappings}"
|
|
|
|
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
|
|
|
|
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
|
|
|
|
|
|
|
|
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
|
|
|
|
|
|
|
modCompile "com.github.MineLittlePony:Kirin:${project.kirin_version}"
|
|
|
|
include "com.github.MineLittlePony:Kirin:${project.kirin_version}"
|
|
|
|
|
|
|
|
// TODO: HD Skins can be made optional later
|
2019-05-28 16:59:57 +02:00
|
|
|
modCompile "com.github.MineLittlePony:HDSkins:${project.hd_skins_version}"
|
|
|
|
include "com.github.MineLittlePony:HDSkins:${project.hd_skins_version}"
|
2019-05-27 17:59:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
inputs.property "version", project.version
|
2019-03-24 11:22:25 +01:00
|
|
|
|
2019-05-27 17:59:15 +02:00
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
include "fabric.mod.json"
|
|
|
|
expand "version": project.version
|
|
|
|
}
|
2019-03-24 11:22:25 +01:00
|
|
|
|
2019-05-27 17:59:15 +02:00
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude "fabric.mod.json"
|
|
|
|
}
|
2019-03-24 11:22:25 +01:00
|
|
|
}
|
|
|
|
|
2019-05-27 17:59:15 +02:00
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.encoding = "UTF-8"
|
2019-03-25 00:29:56 +01:00
|
|
|
}
|
|
|
|
|
2019-04-15 13:14:41 +02:00
|
|
|
|
2019-05-27 17:59:15 +02:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = "sources"
|
|
|
|
from sourceSets.main.allSource
|
2018-08-22 01:57:28 +02:00
|
|
|
}
|
2018-07-08 09:35:11 +02:00
|
|
|
|
2015-08-02 00:36:33 +02:00
|
|
|
jar {
|
2019-05-27 17:59:15 +02:00
|
|
|
from "LICENSE"
|
2018-07-09 00:00:58 +02:00
|
|
|
}
|
2018-08-22 02:29:17 +02:00
|
|
|
|
2019-04-14 13:56:09 +02:00
|
|
|
//
|
|
|
|
// Imports the Background Ponies from the MLP Community Skin Pack
|
|
|
|
//
|
2018-11-05 14:47:05 +01:00
|
|
|
task copyBGPones(type: Copy) {
|
2018-11-06 01:32:30 +01:00
|
|
|
|
|
|
|
def illegals = /[^a-z0-9_\/.-]/
|
|
|
|
|
2018-11-14 22:21:40 +01:00
|
|
|
from "skins/Background Ponies"
|
2018-11-06 01:32:30 +01:00
|
|
|
into temporaryDir
|
|
|
|
|
|
|
|
eachFile {
|
|
|
|
if (it.name =~ illegals){
|
|
|
|
logger.warn("Sanitizing file with illegal characters: ${it.path}")
|
|
|
|
it.name = it.name.replaceAll(/\s/, '_').replaceAll(illegals, '')
|
2018-11-05 14:47:05 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-06 01:32:30 +01:00
|
|
|
}
|