MineLittlePony/build.gradle

264 lines
6.2 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'
}
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
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
}
plugins {
id 'org.ajoberstar.grgit' version '1.7.2'
}
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
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.sourceCompatibility = '1.8'
compileJava.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
common {
// code shared between HDSkins and MineLP mods
// TODO: Make this into a library? I mean, it's not a lot.
compileClasspath += main.compileClasspath
}
2018-07-09 00:58:20 +02:00
hdskins {
2019-03-24 10:30:57 +01:00
// HDSkins.
// TODO: Move to a separate project
2018-07-09 00:58:20 +02:00
compileClasspath += main.compileClasspath
2019-03-24 10:30:57 +01:00
compileClasspath += common.output
2018-07-09 00:58:20 +02:00
ext.refMap = 'hdskins.mixin.refmap.json'
}
2019-03-24 10:30:57 +01:00
client {
// Client-only code
compileClasspath += main.compileClasspath
compileClasspath += main.output
compileClasspath += common.output
2018-07-09 00:58:20 +02:00
compileClasspath += hdskins.output
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
}
hdskinslitemod {
compileClasspath += main.compileClasspath
compileClasspath += litemod.output
compileClasspath += hdskins.output
}
fml {
compileClasspath += main.compileClasspath
compileClasspath += main.output
compileClasspath += client.output
}
2019-03-24 11:23:46 +01:00
hdskinsfml {
compileClasspath += main.compileClasspath
compileClasspath += litemod.output
compileClasspath += hdskins.output
}
}
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.hdskins
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 {
minecraft 'net.minecraftforge:forge:1.13.2-25.0.90'
// use the same version as httpclient
compile('org.apache.httpcomponents:httpmime:4.3.2') {
transitive = false
}
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
transitive = false
}
2018-07-08 09:35:11 +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 {
from sourceSets.common.output
from sourceSets.main.output
2018-07-09 00:58:20 +02:00
from sourceSets.hdskins.output
from sourceSets.hdskinsfml.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
classifier 'base'
extension 'jar'
2018-07-09 00:00:58 +02:00
}
task copyBGPones(type: Copy) {
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????
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-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"
2019-03-24 10:30:57 +01:00
from sourceSets.common.output
from sourceSets.hdskins.output
from sourceSets.hdskinsfml.output
2019-03-24 10:30:57 +01:00
from sourceSets.client.output
from sourceSets.fml.output
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
dependencies {
exclude dependency('deobf.org.ow2.asm:')
exclude dependency('org.spongepowered:mixin:')
exclude 'META-INF/**'
}
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();
}
}
task srgJar(type: Jar) {
2019-03-24 10:30:57 +01:00
from sourceSets.common.output
from sourceSets.hdskins.output
from sourceSets.hdskinsfml.output
2019-03-24 10:30:57 +01:00
2018-07-09 00:58:20 +02:00
from sourceSets.main.output
2019-03-24 10:30:57 +01:00
from sourceSets.client.output
from sourceSets.fml.output
2019-03-24 10:30:57 +01:00
2018-07-09 00:58:20 +02:00
from sourceSets.hdskins.output
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"
}
2019-03-25 00:29:56 +01: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{}
//}