forked from Toasterbirb/kami-red
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
225 lines (182 loc) · 5.8 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
buildscript {
repositories {
jcenter()
maven {
name = 'forge'
url = 'https://files.minecraftforge.net/maven'
}
maven {
name = 'SpongePowered'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'kotlin'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
version project.modVersion
group project.modGroup
sourceSets.main.java {
srcDirs += 'src/main/cape-api'
srcDirs += 'src/main/command'
srcDirs += 'src/main/commons'
srcDirs += 'src/main/event'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.useIR = true
}
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
options.encoding = 'UTF-8'
}
repositories {
maven {
name = 'spongepowered-repo'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
name = 'impactdevelopment-repo'
url = 'https://impactdevelopment.github.io/maven/'
}
maven {
name = 'swt-repo'
url = "https://maven-eclipse.github.io/maven"
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
mavenCentral()
jcenter()
}
minecraft {
mappings channel: 'stable', version: '39-1.12'
runs {
client {
workingDirectory project.file('run')
property 'fml.coreMods.load', 'org.kamiblue.client.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
// 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'
}
}
}
dependencies {
// Forge
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2854'
jarLibs('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
exclude module: 'commons-io'
exclude module: 'gson'
exclude module: 'guava'
exclude module: 'launchwrapper'
exclude module: 'log4j-core' // we want to exclude this as well because 0.7.11 includes it too new for MC
}
// Hacky way to get mixin work
annotationProcessor('org.spongepowered:mixin:0.8.2:processor') {
exclude module: 'gson'
}
jarLibs('org.reflections:reflections:0.9.12') {
exclude module: 'gson'
exclude module: 'guava'
}
jarLibs('club.minnced:java-discord-rpc:2.0.2') {
exclude module: 'jna'
}
// 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'
}
jarLibs("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") {
exclude module: 'kotlin-stdlib-common'
exclude module: 'annotations'
}
jarLibs("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") {
exclude module: 'kotlin-stdlib-common'
exclude module: 'annotations'
}
jarLibs("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") {
exclude module: 'kotlin-stdlib-common'
exclude module: 'annotations'
}
jarLibs("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_coroutines_version") {
exclude module: 'kotlin-stdlib-common'
exclude module: 'annotations'
}
// Add them back to compileOnly (provided)
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
compileOnly 'org.jetbrains:annotations:20.1.0'
// 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
}
mixin {
defaultObfuscationEnv 'searge'
add sourceSets.main, 'mixins.kami.refmap.json'
}
processResources {
inputs.property 'version', project.version
exclude '**/rawimagefiles'
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version
}
}
task sourceJar(type: Jar) { // Generate sources
group 'build'
description 'Assemble API library source archive'
archiveClassifier.set('api-source')
from sourceSets.main.allSource
}
task apiJar(type: Jar) {
group 'build'
description 'Assemble API library archive'
archiveClassifier.set('api')
from sourceSets.main.output
}
// Don't put baritone mixin here please c:
jar {
manifest.attributes(
'Manifest-Version': 1.0,
'MixinConfigs': 'mixins.kami.json',
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0,
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'org.kamiblue.client.mixin.MixinLoaderForge',
'ForceLoadAsMod': 'true',
'Main-Class': 'org.kamiblue.client.installer.Installer'
)
// Copy needed libs to jar
from {
configurations.jarLibs.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
task buildApi {
group 'build'
dependsOn sourceJar
dependsOn apiJar
description 'Assemble API library archives'
}