2019-12-15 05:04:52 +00:00
|
|
|
buildscript {
|
2020-12-08 16:24:21 +00:00
|
|
|
|
2019-12-15 05:04:52 +00:00
|
|
|
repositories {
|
|
|
|
jcenter()
|
2020-12-08 16:24:21 +00:00
|
|
|
|
2019-12-15 05:04:52 +00:00
|
|
|
maven {
|
|
|
|
name = 'forge'
|
|
|
|
url = 'http://files.minecraftforge.net/maven'
|
|
|
|
}
|
2020-12-08 16:24:21 +00:00
|
|
|
|
2019-12-15 05:04:52 +00:00
|
|
|
maven {
|
|
|
|
name = 'SpongePowered'
|
|
|
|
url = 'http://repo.spongepowered.org/maven'
|
|
|
|
}
|
|
|
|
}
|
2020-12-08 16:24:21 +00:00
|
|
|
|
2019-12-15 05:04:52 +00:00
|
|
|
dependencies {
|
2020-12-08 16:24:21 +00:00
|
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
|
|
|
|
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
|
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
2020-07-15 14:23:19 +00:00
|
|
|
}
|
2020-12-08 16:24:21 +00:00
|
|
|
|
2019-12-15 05:04:52 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
apply plugin: 'idea'
|
|
|
|
apply plugin: 'eclipse'
|
|
|
|
|
2020-04-22 14:52:54 +00:00
|
|
|
apply plugin: 'kotlin'
|
2020-12-08 16:24:21 +00:00
|
|
|
apply plugin: 'net.minecraftforge.gradle'
|
2019-12-15 05:04:52 +00:00
|
|
|
apply plugin: 'org.spongepowered.mixin'
|
|
|
|
|
|
|
|
version project.modVersion
|
2020-08-14 03:53:25 +00:00
|
|
|
group project.modGroup
|
2019-12-15 05:04:52 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
sourceSets.main.java {
|
|
|
|
srcDirs += 'src/main/cape-api'
|
2020-12-20 23:23:13 +00:00
|
|
|
srcDirs += 'src/main/command'
|
2020-12-08 16:24:21 +00:00
|
|
|
srcDirs += 'src/main/commons'
|
2020-12-14 14:39:06 +00:00
|
|
|
srcDirs += 'src/main/event'
|
2020-11-17 19:14:03 +00:00
|
|
|
}
|
|
|
|
|
2020-04-23 16:37:03 +00:00
|
|
|
compileKotlin {
|
2020-12-08 16:24:21 +00:00
|
|
|
kotlinOptions.jvmTarget = "1.8"
|
2020-04-23 16:37:03 +00:00
|
|
|
}
|
|
|
|
|
2019-12-15 05:04:52 +00:00
|
|
|
compileJava {
|
|
|
|
sourceCompatibility = targetCompatibility = '1.8'
|
2020-12-08 16:24:21 +00:00
|
|
|
options.encoding = 'UTF-8'
|
2019-12-15 05:04:52 +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()
|
2020-03-04 14:39:30 +00:00
|
|
|
jcenter()
|
2019-12-15 05:04:52 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
|
|
|
|
minecraft {
|
|
|
|
mappings channel: 'stable', version: '39-1.12'
|
|
|
|
|
|
|
|
runs {
|
|
|
|
client {
|
|
|
|
workingDirectory project.file('run')
|
|
|
|
|
|
|
|
property 'fml.coreMods.load', 'me.zeroeightsix.kami.mixin.MixinLoaderForge'
|
|
|
|
property 'mixin.env.disableRefMap', 'true' // Disable refmap so we don't get trolled by Baritone
|
|
|
|
|
|
|
|
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
jarLibs
|
2021-01-01 22:05:33 +00:00
|
|
|
// Force choosing the correct nightly build because Mac OS chooses an invalid one
|
|
|
|
all {
|
|
|
|
resolutionStrategy {
|
|
|
|
force 'org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209'
|
|
|
|
}
|
|
|
|
}
|
2020-12-08 16:24:21 +00:00
|
|
|
}
|
|
|
|
|
2019-12-15 05:04:52 +00:00
|
|
|
dependencies {
|
2020-12-08 16:24:21 +00:00
|
|
|
// Forge
|
|
|
|
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2854'
|
|
|
|
|
|
|
|
jarLibs('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
|
2019-12-15 05:04:52 +00:00
|
|
|
exclude module: 'commons-io'
|
2020-12-08 16:24:21 +00:00
|
|
|
exclude module: 'gson'
|
|
|
|
exclude module: 'guava'
|
|
|
|
exclude module: 'launchwrapper'
|
2020-05-20 15:50:43 +00:00
|
|
|
exclude module: 'log4j-core' // we want to exclude this as well because 0.7.11 includes it too new for MC
|
2019-12-15 05:04:52 +00:00
|
|
|
}
|
2020-08-14 03:53:25 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
// Hacky way to get mixin work
|
|
|
|
annotationProcessor('org.spongepowered:mixin:0.8.2:processor') {
|
|
|
|
exclude module: 'gson'
|
2020-11-27 08:32:25 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
jarLibs('org.reflections:reflections:0.9.12') {
|
|
|
|
exclude module: 'gson'
|
|
|
|
exclude module: 'guava'
|
|
|
|
}
|
2020-08-14 03:53:25 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
jarLibs('club.minnced:java-discord-rpc:2.0.2') {
|
|
|
|
exclude module: 'jna'
|
|
|
|
}
|
2020-08-14 03:53:25 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
jarLibs('com.github.MrPowerGamerBR:TemmieWebhook:-SNAPSHOT') {
|
|
|
|
exclude module: 'gson'
|
|
|
|
}
|
2020-08-14 03:53:25 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
jarLibs 'com.github.kevinsawicki:http-request:6.0'
|
2019-12-15 05:04:52 +00:00
|
|
|
|
2020-08-14 03:53:25 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
// Kotlin libs
|
|
|
|
// kotlin-stdlib-common and annotations aren't required at runtime
|
|
|
|
jarLibs("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") {
|
|
|
|
exclude module: 'kotlin-stdlib-common'
|
|
|
|
exclude module: 'annotations'
|
|
|
|
}
|
2019-12-15 05:04:52 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
jarLibs("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") {
|
|
|
|
exclude module: 'kotlin-stdlib-common'
|
|
|
|
exclude module: 'annotations'
|
|
|
|
}
|
2019-12-15 05:04:52 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
jarLibs("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") {
|
|
|
|
exclude module: 'kotlin-stdlib-common'
|
|
|
|
exclude module: 'annotations'
|
2019-12-15 05:04:52 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
jarLibs("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") {
|
|
|
|
exclude module: 'kotlin-stdlib-common'
|
|
|
|
exclude module: 'annotations'
|
2019-12-15 05:04:52 +00:00
|
|
|
}
|
|
|
|
|
2020-12-20 23:23:13 +00:00
|
|
|
jarLibs("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_coroutines_version") {
|
|
|
|
exclude module: 'kotlin-stdlib-common'
|
|
|
|
exclude module: 'annotations'
|
|
|
|
}
|
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
// Add them back to compileOnly (provided)
|
|
|
|
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
|
2020-12-09 06:11:31 +00:00
|
|
|
compileOnly 'org.jetbrains:annotations:20.1.0'
|
2019-12-15 05:04:52 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
// This Baritone will NOT be included in the jar
|
|
|
|
implementation 'com.github.cabaletta:baritone:1.2.14'
|
|
|
|
|
|
|
|
// This Baritone WILL be included in the jar
|
|
|
|
jarLibs 'cabaletta:baritone-api:1.2'
|
|
|
|
|
|
|
|
// Add everything in jarLibs to implementation (compile)
|
|
|
|
implementation configurations.jarLibs
|
2019-12-15 05:04:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mixin {
|
2020-12-08 16:24:21 +00:00
|
|
|
defaultObfuscationEnv 'searge'
|
2019-12-15 05:04:52 +00:00
|
|
|
add sourceSets.main, 'mixins.kami.refmap.json'
|
|
|
|
}
|
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
processResources {
|
|
|
|
inputs.property 'version', project.version
|
2019-12-15 05:04:52 +00:00
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
exclude '**/rawimagefiles'
|
|
|
|
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
include 'mcmod.info'
|
|
|
|
expand 'version': project.version
|
2019-12-15 05:04:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 16:24:21 +00:00
|
|
|
// Don't put baritone mixin here please c:
|
2020-07-15 14:23:19 +00:00
|
|
|
jar {
|
2020-12-08 16:24:21 +00:00
|
|
|
manifest.attributes(
|
|
|
|
'Manifest-Version': 1.0,
|
|
|
|
'MixinConfigs': 'mixins.kami.json',
|
|
|
|
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
|
|
|
|
'TweakOrder': 0,
|
|
|
|
'FMLCorePluginContainsFMLMod': 'true',
|
|
|
|
'FMLCorePlugin': 'me.zeroeightsix.kami.mixin.MixinLoaderForge',
|
|
|
|
'ForceLoadAsMod': 'true',
|
|
|
|
'Main-Class': 'me.zeroeightsix.installer.Installer'
|
|
|
|
)
|
|
|
|
|
|
|
|
// Copy needed libs to jar
|
|
|
|
from {
|
|
|
|
configurations.jarLibs.collect {
|
|
|
|
it.isDirectory() ? it : zipTree(it)
|
|
|
|
}
|
2020-07-15 14:23:19 +00:00
|
|
|
}
|
2020-12-08 16:24:21 +00:00
|
|
|
}
|