kami-blue/build.gradle

175 lines
4.7 KiB
Groovy
Raw Normal View History

2019-08-07 18:24:00 +00:00
// make folders
2019-08-07 17:35:23 +00:00
task mkdir {
2019-08-07 18:24:00 +00:00
group = "kami"
2019-08-07 17:35:23 +00:00
doLast {
2019-10-18 22:16:05 +00:00
mkdir System.getProperty("user.home") + "/.minecraft/mods/1.12.2/"
2019-08-07 17:35:23 +00:00
}
}
// delete old versions
2019-08-07 19:52:31 +00:00
task rmOld(type: Delete) {
2019-08-07 18:24:00 +00:00
group = "kami"
2019-10-18 22:16:05 +00:00
delete fileTree(System.getProperty("user.home") + "/.minecraft/mods/1.12.2/").matching {
include "*-release.jar"
2019-08-07 17:35:23 +00:00
}
}
// copy file
task copy(type: Copy) {
2019-08-07 18:24:00 +00:00
group = "kami"
from file("build/libs/")
include '*-release.jar'
into file(System.getProperty("user.home") + "/.minecraft/mods/1.12.2/")
2019-08-07 17:35:23 +00:00
}
// forge's stuff
2018-07-21 18:47:46 +00:00
buildscript {
repositories {
jcenter()
maven {
2018-08-17 16:25:17 +00:00
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
2018-07-21 18:47:46 +00:00
}
maven {
name = 'SpongePowered'
url = 'http://repo.spongepowered.org/maven'
}
}
dependencies {
2018-08-17 16:25:17 +00:00
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
2018-07-21 18:47:46 +00:00
classpath 'org.spongepowered:mixingradle:0.4-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
}
}
2018-08-17 16:25:17 +00:00
apply plugin: 'net.minecraftforge.gradle.forge'
2018-07-21 18:47:46 +00:00
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.github.johnrengelman.shadow'
2018-08-17 16:25:17 +00:00
version project.modVersion
group project.modGroup // http://maven.apache.org/guides/mini/guide-naming-conventions.html
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
2018-07-21 18:47:46 +00:00
}
minecraft {
version = project.forgeVersion
2018-08-17 16:25:17 +00:00
runDir = 'run'
2018-07-21 18:47:46 +00:00
mappings = project.mcpVersion
2018-08-17 16:25:17 +00:00
coreMod = 'me.zeroeightsix.kami.mixin.MixinLoaderForge'
makeObfSourceJar = false
2018-07-21 18:47:46 +00:00
}
repositories {
maven {
name = 'spongepowered-repo'
url = 'http://repo.spongepowered.org/maven/'
}
maven {
name = 'impactdevelopment-repo'
url = 'https://impactdevelopment.github.io/maven/'
}
maven {
name = 'swt-repo'
url = "http://maven-eclipse.github.io/maven"
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
mavenCentral()
2019-10-28 14:58:34 +00:00
jcenter()
2018-07-21 18:47:46 +00:00
}
dependencies {
//mixin needs to be distributed with the mod, very important
compile("org.spongepowered:mixin:0.7.4-SNAPSHOT") {
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
}
compile "com.github.ZeroMemes:Alpine:1.5"
compile group: 'net.jodah', name: 'typetools', version: '0.5.0'
compile group: 'org.yaml', name: 'snakeyaml', version: '1.19'
2018-08-10 00:02:39 +00:00
compile(group: 'org.reflections', name: 'reflections', version: '0.9.11') {
exclude group: 'com.google.guava', module: 'guava'
}
2019-10-28 01:19:18 +00:00
// https://mvnrepository.com/artifact/club.minnced/discord-rpc-release
// discord rpc
2019-10-28 14:58:34 +00:00
//compile group: 'club.minnced', name: 'discord-rpc-release', version: 'v3.3.0'
compile 'club.minnced:java-discord-rpc:2.0.2'
//compile 'club.minnced:java-discord-rpc:%VERSION%'
2019-10-28 01:19:18 +00:00
2018-07-21 18:47:46 +00:00
}
processResources {
// this will ensure that this task is redone when the versions change.
2018-08-17 16:25:17 +00:00
inputs.property 'version', project.version
inputs.property 'mcversion', project.minecraft.version
2018-07-21 18:47:46 +00:00
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
2018-08-17 16:25:17 +00:00
include 'mcmod.info'
2018-07-21 18:47:46 +00:00
// replace version and mcversion
2018-08-17 16:25:17 +00:00
expand 'version': project.version, 'mcversion': project.minecraft.version
2018-07-21 18:47:46 +00:00
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
2018-08-17 16:25:17 +00:00
exclude 'mcmod.info'
2018-07-21 18:47:46 +00:00
}
// move _at.cfg into META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
shadowJar {
dependencies {
include(dependency('org.spongepowered:mixin'))
include(dependency('com.github.ZeroMemes:Alpine'))
include(dependency('net.jodah:typetools'))
include(dependency('org.yaml:snakeyaml'))
2018-08-10 00:02:39 +00:00
include(dependency('org.reflections:reflections'))
include(dependency('org.javassist:javassist'))
2018-07-21 18:47:46 +00:00
}
exclude 'dummyThing'
exclude 'LICENSE.txt'
2018-08-17 16:25:17 +00:00
classifier = 'release'
}
mixin {
defaultObfuscationEnv searge
add sourceSets.main, 'mixins.kami.refmap.json'
2018-07-21 18:47:46 +00:00
}
2018-08-17 16:25:17 +00:00
reobf {
shadowJar {
mappingType = 'SEARGE'
classpath = sourceSets.main.compileClasspath
}
}
2018-07-21 18:47:46 +00:00
jar {
manifest {
attributes(
2018-08-17 16:25:17 +00:00
'MixinConfigs': 'mixins.kami.json',
'tweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0,
2018-07-21 18:47:46 +00:00
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'me.zeroeightsix.kami.mixin.MixinLoaderForge',
2018-08-17 16:25:17 +00:00
'ForceLoadAsMod': 'true',
2018-07-21 18:47:46 +00:00
'FMLAT': 'kami_at.cfg'
)
}
}
2018-08-17 16:25:17 +00:00
2019-08-07 17:35:23 +00:00
build.dependsOn(shadowJar)