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'
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = 'sponge'
|
|
|
|
url = 'https://repo.spongepowered.org/maven'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
2019-03-24 11:07:41 +01:00
|
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
2018-07-09 01:02:24 +02:00
|
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
|
2018-07-09 00:58:20 +02:00
|
|
|
}
|
2016-01-15 08:49:17 +01:00
|
|
|
}
|
|
|
|
|
2018-08-22 01:57:28 +02:00
|
|
|
plugins {
|
|
|
|
id 'org.ajoberstar.grgit' version '1.7.2'
|
|
|
|
}
|
|
|
|
|
2019-03-24 10:54:38 +01:00
|
|
|
apply plugin: 'net.minecraftforge.gradle'
|
|
|
|
apply plugin: 'eclipse'
|
2018-07-09 00:00:58 +02:00
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2016-01-15 08:49:17 +01:00
|
|
|
|
2019-03-24 10:54:38 +01:00
|
|
|
sourceCompatibility = '1.8'
|
|
|
|
targetCompatibility = '1.8'
|
|
|
|
compileJava.sourceCompatibility = '1.8'
|
|
|
|
compileJava.targetCompatibility = '1.8'
|
|
|
|
|
2018-08-22 01:57:28 +02:00
|
|
|
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}"
|
|
|
|
|
2018-08-22 01:57:28 +02:00
|
|
|
if (project.release != 'RELEASE') {
|
|
|
|
version += "-${project.release}"
|
|
|
|
}
|
|
|
|
if (project.release == 'SNAPSHOT') {
|
|
|
|
version += "-${project.revision}-${project.hash}"
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2015-12-09 22:05:21 +01:00
|
|
|
sourceSets {
|
2019-03-24 10:30:57 +01:00
|
|
|
common {
|
|
|
|
// code shared between HDSkins and MineLP mods
|
|
|
|
// TODO: Make this into a library? I mean, it's not a lot.
|
|
|
|
compileClasspath += main.compileClasspath
|
|
|
|
}
|
|
|
|
|
|
|
|
client {
|
|
|
|
// Client-only code
|
|
|
|
compileClasspath += main.compileClasspath
|
|
|
|
compileClasspath += main.output
|
|
|
|
compileClasspath += common.output
|
2018-07-09 00:58:20 +02:00
|
|
|
ext.refMap = 'minelp.mixin.refmap.json'
|
|
|
|
}
|
2019-03-24 10:30:57 +01:00
|
|
|
main {
|
|
|
|
// Non-client code. Called main because gradle calls it that
|
|
|
|
// TODO: HorseLib.java
|
|
|
|
|
|
|
|
compileClasspath += common.output
|
|
|
|
}
|
|
|
|
|
|
|
|
// Litemod stuff, separated for future removal
|
|
|
|
litemod {
|
|
|
|
compileClasspath += main.compileClasspath
|
|
|
|
compileClasspath += main.output
|
|
|
|
compileClasspath += client.output
|
|
|
|
}
|
2019-03-25 16:33:58 +01:00
|
|
|
|
2019-03-24 10:54:38 +01:00
|
|
|
fml {
|
|
|
|
compileClasspath += main.compileClasspath
|
|
|
|
compileClasspath += main.output
|
|
|
|
compileClasspath += client.output
|
|
|
|
}
|
|
|
|
|
2017-06-13 05:55:50 +02:00
|
|
|
}
|
2016-11-24 08:01:23 +01:00
|
|
|
|
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')
|
|
|
|
|
|
|
|
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
|
|
|
|
// replace '@VERSION@', project.version
|
|
|
|
|
|
|
|
mods {
|
|
|
|
minelittlepony {
|
|
|
|
source sourceSets.common
|
|
|
|
source sourceSets.client
|
|
|
|
source sourceSets.main
|
|
|
|
|
|
|
|
// replace '@VERSION@', project.version
|
|
|
|
}
|
|
|
|
|
|
|
|
// replace '@VERSION@', project.version
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// replace '@VERSION@', project.version
|
|
|
|
}
|
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
repositories {
|
|
|
|
// jcenter()
|
|
|
|
maven {
|
|
|
|
url = 'https://repo.spongepowered.org/maven'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-08 09:35:11 +02:00
|
|
|
dependencies {
|
2019-03-26 18:50:49 +01:00
|
|
|
// TODO: Add HDSkins as a dependency. It won't compile without it.
|
|
|
|
|
2019-03-24 10:54:38 +01:00
|
|
|
minecraft 'net.minecraftforge:forge:1.13.2-25.0.90'
|
|
|
|
|
2019-03-25 16:33:58 +01:00
|
|
|
// use the same version as httpclient
|
2018-08-26 04:40:07 +02:00
|
|
|
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
|
|
|
|
transitive = false
|
|
|
|
}
|
2018-07-08 09:35:11 +02:00
|
|
|
}
|
2018-08-22 02:29:17 +02:00
|
|
|
|
2018-08-22 01:57:28 +02:00
|
|
|
manifest {
|
|
|
|
attributes 'Implementation-Version': "${project.version} (git-${project.hash})"
|
|
|
|
}
|
2018-07-08 09:35:11 +02:00
|
|
|
|
2015-08-02 00:36:33 +02:00
|
|
|
jar {
|
2019-03-24 10:54:38 +01:00
|
|
|
from sourceSets.common.output
|
|
|
|
from sourceSets.main.output
|
|
|
|
|
|
|
|
from sourceSets.client.output
|
|
|
|
from sourceSets.fml.output
|
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
// replace '@VERSION@', project.version
|
2019-03-24 11:22:25 +01:00
|
|
|
|
2018-07-09 01:02:24 +02:00
|
|
|
classifier 'base'
|
|
|
|
extension 'jar'
|
2018-07-09 00:00:58 +02:00
|
|
|
}
|
2018-08-22 02:29:17 +02:00
|
|
|
|
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-14 23:51:44 +01:00
|
|
|
// TODO: What is tempDir????
|
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
|
|
|
}
|
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
/*
|
2018-07-09 00:00:58 +02:00
|
|
|
shadowJar {
|
2019-03-25 00:29:56 +01:00
|
|
|
// classifier "mc$minecraft.version"
|
2018-07-09 01:02:24 +02:00
|
|
|
|
2019-03-26 18:50:49 +01:00
|
|
|
// TODO: Remember, we still have to include HDSkins in our build litemod, even if it's a separate repository now
|
2019-03-24 10:30:57 +01:00
|
|
|
|
2019-03-26 18:50:49 +01:00
|
|
|
from sourceSets.common.output
|
2019-03-24 10:30:57 +01:00
|
|
|
|
|
|
|
from sourceSets.client.output
|
2019-03-24 10:54:38 +01:00
|
|
|
from sourceSets.fml.output
|
2018-08-22 02:29:17 +02:00
|
|
|
|
2018-11-05 14:47:05 +01:00
|
|
|
exclude "/assets/minelittlepony/textures/entity/pony"
|
|
|
|
from(copyBGPones) {
|
|
|
|
into "/assets/minelittlepony/textures/entity/pony"
|
|
|
|
}
|
2019-02-05 14:48:35 +01:00
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
// replace '@VERSION@', project.version
|
2019-03-24 11:22:25 +01:00
|
|
|
|
2018-07-09 01:02:24 +02:00
|
|
|
dependencies {
|
|
|
|
exclude dependency('deobf.org.ow2.asm:')
|
2018-08-26 04:40:07 +02:00
|
|
|
exclude dependency('org.spongepowered:mixin:')
|
2018-07-09 01:02:24 +02:00
|
|
|
exclude 'META-INF/**'
|
|
|
|
}
|
2018-08-22 02:29:17 +02:00
|
|
|
|
2018-07-09 01:02:24 +02:00
|
|
|
relocate 'org.apache.http.entity.mime', 'com.voxelmodpack.repack.org.apache.http.entity.mime'
|
|
|
|
exclude 'dummyThing'
|
2018-11-14 23:51:44 +01:00
|
|
|
doLast {
|
|
|
|
file('build/libs/' + archivesBaseName + '-' + version + '-base.jar').delete();
|
|
|
|
}
|
2016-08-25 07:36:00 +02:00
|
|
|
}
|
2018-08-22 02:29:17 +02:00
|
|
|
|
2016-07-20 01:11:06 +02:00
|
|
|
task srgJar(type: Jar) {
|
2019-03-24 10:30:57 +01:00
|
|
|
from sourceSets.common.output
|
|
|
|
|
2018-07-09 00:58:20 +02:00
|
|
|
from sourceSets.main.output
|
2019-03-24 10:30:57 +01:00
|
|
|
from sourceSets.client.output
|
2019-03-24 10:54:38 +01:00
|
|
|
from sourceSets.fml.output
|
2019-03-24 10:30:57 +01:00
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
// replace '@VERSION@', project.version
|
2019-03-24 11:22:25 +01:00
|
|
|
|
2018-07-09 00:58:20 +02:00
|
|
|
classifier "mc$minecraft.version-srg"
|
2016-07-20 01:11:06 +02:00
|
|
|
}
|
2019-03-25 00:29:56 +01:00
|
|
|
*/
|
2018-08-22 02:29:17 +02:00
|
|
|
|
2019-03-24 10:30:57 +01:00
|
|
|
task horseLib(type: Jar) {
|
|
|
|
from sourceSets.common.output
|
|
|
|
|
|
|
|
from sourceSets.main.output
|
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
// replace '@VERSION@', project.version
|
2019-03-24 11:22:25 +01:00
|
|
|
|
2019-03-24 10:30:57 +01:00
|
|
|
baseName = "HoarseLib"
|
|
|
|
}
|
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
//sourceJar.enabled = false
|
2018-11-14 23:51:44 +01:00
|
|
|
|
2019-03-25 00:29:56 +01:00
|
|
|
//reobf {
|
|
|
|
// srgJar {
|
|
|
|
// mappingType = 'SEARGE'
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// shadowJar{}
|
|
|
|
//}
|