MineLittlePony/build.gradle

237 lines
5.6 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
}
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
}
fml {
compileClasspath += main.compileClasspath
compileClasspath += main.output
compileClasspath += client.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 {
// TODO: Remember to add /bin/default to the Environment configs
2019-03-31 12:28:14 +02:00
// minelittlepony%%C:/.../bin/default
source sourceSets.common
source sourceSets.client
source sourceSets.main
2019-03-31 12:28:14 +02:00
source sourceSets.fml
2019-03-24 11:22:25 +01:00
// 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 {
// TODO: Add HDSkins as a dependency. It won't compile without it.
minecraft 'net.minecraftforge:forge:1.13.2-25.0.90'
// use the same version as httpclient
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
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"
// 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
from sourceSets.common.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
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
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{}
//}