forked from s7n1ax/711.club
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
128 lines (113 loc) · 3.74 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/**
* @author bush
*
* increment this counter every time you try to switch this to kotlin and fail
* counter = 2
*/
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.minecraftforge.net/' }
maven { url 'https://repo.spongepowered.org/maven/' }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:$forgegradleversion"
classpath "org.spongepowered:mixingradle:$mixinversion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinversion"
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'idea'
archivesBaseName = modname
version = modversion
group = modgroup
compileJava {
// So unicode stuff doesn't get converted into other characters
options.encoding 'UTF-8'
// Suppress sun.misc.Unsafe warnings
options.compilerArgs += '-XDignore.symbol.file'
sourceCompatibility = targetCompatibility = '1.8'
}
compileKotlin.kotlinOptions.freeCompilerArgs += '-Xlambdas=indy'
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://repo.spongepowered.org/maven' }
}
minecraft {
mappings channel: "$mappingschannel", version: "$mappingsversion"
// AT config because mixin ats suck ass
accessTransformer = file(transformerpath + accesstransformer)
runs {
client {
workingDirectory file('run')
// Tells mixin to use our mixin config in IDE's.
property 'fml.coreMods.load', mixinclass
}
}
}
configurations {
// Create new configuration
godblessamerica
}
dependencies {
minecraft "net.minecraftforge:forge:$mcforgeversion"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
godblessamerica 'org.spongepowered:mixin:0.8.5'
// Apparently future crashes with v10
godblessamerica 'org.reflections:reflections:0.9.12'
godblessamerica 'club.minnced:java-discord-rpc:2.0.2'
godblessamerica 'com.github.therealbush:translator:1.0.2'
godblessamerica('com.github.therealbush:eventbus-kotlin:v1.0.1') {
// Included in minecraft, we don't need it in our jar
exclude module: "log4j-api"
exclude module: 'log4j-core'
}
godblessamerica "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinversion"
godblessamerica "org.jetbrains.kotlin:kotlin-reflect:$kotlinversion"
godblessamerica "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesversion"
// Implement everything from our configuration
implementation configurations.godblessamerica
}
mixin {
// Types of obf env: searge, notch.
defaultObfuscationEnv 'searge'
sourceSets {
main {
ext.refMap = mixinrefmapconfig
}
}
}
processResources {
// Replace the version in mcmod.info
inputs.property 'version', version
from(sourceSets.main.resources.srcDirs) {
duplicatesStrategy DuplicatesStrategy.WARN
include 'mcmod.info'
expand version: version
}
}
jar {
manifest.attributes(
'Main-Class': mainclass,
'ForceLoadAsMod': 'true',
'FMLAT': accesstransformer,
'MixinConfigs': mixinconfig,
'FMLCorePlugin': mixinclass,
'FMLCorePluginContainsFMLMod': 'true',
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker'
)
from {
duplicatesStrategy DuplicatesStrategy.WARN
// Exclude files specified in gradle.properties
exclude excluded.split(',')
// Put everything from our configuration into our built jar
configurations.godblessamerica.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}