11buildscript {
2+
23 repositories {
34 jcenter()
5+
46 maven {
57 name = ' forge'
68 url = ' http://files.minecraftforge.net/maven'
79 }
10+
811 maven {
912 name = ' SpongePowered'
1013 url = ' http://repo.spongepowered.org/maven'
1114 }
1215 }
16+
1317 dependencies {
14- classpath ' net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
15- classpath ' org.spongepowered:mixingradle:0.6-SNAPSHOT'
16- classpath ' com.github.jengelman.gradle.plugins:shadow:4.0.3'
17- classpath group : ' org.jetbrains.kotlin' , name : ' kotlin-gradle-plugin' , version : " ${ kotlin_version} "
18+ classpath ' net.minecraftforge.gradle:ForgeGradle:3.+'
19+ classpath ' org.spongepowered:mixingradle:0.7-SNAPSHOT'
20+ classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
1821 }
22+
1923}
2024
25+ apply plugin : ' idea'
26+ apply plugin : ' eclipse'
27+
2128apply plugin : ' kotlin'
22- apply plugin : ' net.minecraftforge.gradle.forge '
29+ apply plugin : ' net.minecraftforge.gradle'
2330apply plugin : ' org.spongepowered.mixin'
24- apply plugin : ' com.github.johnrengelman.shadow'
2531
2632version project. modVersion
2733group project. modGroup
2834
29- sourceSets {
30- main . java . srcDirs + = ' src/main/cape-api'
31- main . java . srcDirs + = ' src/main/commons'
35+ sourceSets. main . java {
36+ srcDirs + = ' src/main/cape-api'
37+ srcDirs + = ' src/main/commons'
3238}
3339
3440compileKotlin {
35- kotlinOptions {
36- jvmTarget = " 1.8"
37- }
38- }
39- compileTestKotlin {
40- kotlinOptions {
41- jvmTarget = " 1.8"
42- }
41+ kotlinOptions. jvmTarget = " 1.8"
4342}
4443
4544compileJava {
4645 sourceCompatibility = targetCompatibility = ' 1.8'
47- }
48-
49- minecraft {
50- version = project. forgeVersion
51- runDir = ' run'
52- mappings = project. mcpVersion
53- coreMod = ' me.zeroeightsix.kami.mixin.MixinLoaderForge'
54- makeObfSourceJar = false
46+ options. encoding = ' UTF-8'
5547}
5648
5749repositories {
@@ -75,105 +67,129 @@ repositories {
7567 jcenter()
7668}
7769
70+
71+ minecraft {
72+ mappings channel : ' stable' , version : ' 39-1.12'
73+
74+ runs {
75+ client {
76+ workingDirectory project. file(' run' )
77+
78+ property ' fml.coreMods.load' , ' me.zeroeightsix.kami.mixin.MixinLoaderForge'
79+ property ' mixin.env.disableRefMap' , ' true' // Disable refmap so we don't get trolled by Baritone
80+
81+ property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
82+ property ' forge.logging.console.level' , ' debug'
83+ }
84+ }
85+ }
86+
87+ configurations {
88+ jarLibs
89+ }
90+
7891dependencies {
79- compile( " org.spongepowered:mixin:0.7.11-SNAPSHOT " ) { // do NOT update this to 8.0 or above, it breaks compatibility with future client
80- exclude module : ' launchwrapper '
81- exclude module : ' guava '
82- exclude module : ' gson '
92+ // Forge
93+ minecraft ' net.minecraftforge:forge:1.12.2-14.23.5.2854 '
94+
95+ jarLibs( ' org.spongepowered:mixin:0.7.11-SNAPSHOT ' ) {
8396 exclude module : ' commons-io'
97+ exclude module : ' gson'
98+ exclude module : ' guava'
99+ exclude module : ' launchwrapper'
84100 exclude module : ' log4j-core' // we want to exclude this as well because 0.7.11 includes it too new for MC
85101 }
86102
87- compile(group : ' org.reflections' , name : ' reflections' , version : ' 0.9.12' ) {
88- exclude group : ' com.google.guava' , module : ' guava'
103+ // Hacky way to get mixin work
104+ annotationProcessor(' org.spongepowered:mixin:0.8.2:processor' ) {
105+ exclude module : ' gson'
89106 }
90107
91- compile ' club.minnced:java-discord-rpc:2.0.2'
92- compile ' com.github.kevinsawicki:http-request:http-request-6.0'
93- compile ' com.github.MrPowerGamerBR:TemmieWebhook:-SNAPSHOT'
108+ jarLibs(' org.reflections:reflections:0.9.12' ) {
109+ exclude module : ' gson'
110+ exclude module : ' guava'
111+ }
94112
95- compile ' com.github.cabaletta:baritone:1.2.14'
96- compile ' cabaletta:baritone-api:1.2'
113+ jarLibs(' club.minnced:java-discord-rpc:2.0.2' ) {
114+ exclude module : ' jna'
115+ }
97116
98- compile group : " org.jetbrains.kotlin" , name : " kotlin-stdlib" , version : kotlin_version
99- compile group : " org.jetbrains.kotlin" , name : " kotlin-stdlib-jdk7" , version : kotlin_version
100- compile group : " org.jetbrains.kotlin" , name : " kotlin-stdlib-jdk8" , version : kotlin_version
101- compile group : " org.jetbrains.kotlin" , name : " kotlin-reflect" , version : kotlin_version
117+ jarLibs(' com.github.MrPowerGamerBR:TemmieWebhook:-SNAPSHOT' ) {
118+ exclude module : ' gson'
119+ }
102120
103- compile group : " org.jetbrains" , name : " annotations" , version : annotations_version
104- }
121+ jarLibs ' com.github.kevinsawicki:http-request:6.0'
105122
106- processResources {
107- inputs. property ' version' , project. version
108- inputs. property ' mcversion' , project. minecraft. version
109123
110- exclude ' **/rawimagefiles'
124+ // Kotlin libs
125+ // kotlin-stdlib-common and annotations aren't required at runtime
126+ jarLibs(" org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version " ) {
127+ exclude module : ' kotlin-stdlib-common'
128+ exclude module : ' annotations'
129+ }
111130
112- from(sourceSets. main. resources. srcDirs) {
113- include ' mcmod.info'
131+ jarLibs(" org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version " ) {
132+ exclude module : ' kotlin-stdlib-common'
133+ exclude module : ' annotations'
134+ }
114135
115- expand ' version' : project. version, ' mcversion' : project. minecraft. version
136+ jarLibs(" org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version " ) {
137+ exclude module : ' kotlin-stdlib-common'
138+ exclude module : ' annotations'
116139 }
117140
118- from(sourceSets. main. resources. srcDirs) {
119- exclude ' mcmod.info'
141+ jarLibs(" org.jetbrains.kotlin:kotlin-reflect:$kotlin_version " ) {
142+ exclude module : ' kotlin-stdlib-common'
143+ exclude module : ' annotations'
120144 }
121145
122- rename ' (.+_at.cfg)' , ' META-INF/$1'
123- }
146+ // Add them back to compileOnly (provided)
147+ compileOnly " org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version "
148+ compileOnly ' org.jetbrains:annotations:13.0'
124149
125- shadowJar {
126- dependencies {
127- include(dependency(' cabaletta:baritone-api' ))
128- include(dependency(' club.minnced:java-discord-rpc' ))
129- include(dependency(' com.github.kevinsawicki:http-request' ))
130- include(dependency(' com.github.MrPowerGamerBR:TemmieWebhook' ))
131- include(dependency(" org.jetbrains.kotlin:kotlin-reflect:${ kotlin_version} " ))
132- include(dependency(" org.jetbrains.kotlin:kotlin-stdlib:${ kotlin_version} " ))
133- include(dependency(" org.jetbrains.kotlin:kotlin-stdlib-jdk7:${ kotlin_version} " ))
134- include(dependency(" org.jetbrains.kotlin:kotlin-stdlib-jdk8:${ kotlin_version} " ))
135- include(dependency(' org.javassist:javassist' ))
136- include(dependency(' org.reflections:reflections' ))
137- include(dependency(' org.spongepowered:mixin' ))
138- }
139-
140- exclude ' dummyThing' // can someone explain why this is here
141- classifier = ' release'
150+ // This Baritone will NOT be included in the jar
151+ implementation ' com.github.cabaletta:baritone:1.2.14'
152+
153+ // This Baritone WILL be included in the jar
154+ jarLibs ' cabaletta:baritone-api:1.2'
155+
156+ // Add everything in jarLibs to implementation (compile)
157+ implementation configurations. jarLibs
142158}
143159
144160mixin {
145- defaultObfuscationEnv searge
161+ defaultObfuscationEnv ' searge'
146162 add sourceSets. main, ' mixins.kami.refmap.json'
147163}
148164
149- reobf {
150- shadowJar {
151- mappingType = ' SEARGE'
152- classpath = sourceSets. main. compileClasspath
153- }
154- }
165+ processResources {
166+ inputs. property ' version' , project. version
155167
156- // Don't put baritone mixin here please c:
157- jar {
158- manifest {
159- attributes(
160- ' MixinConfigs' : ' mixins.kami.json' ,
161- ' tweakClass' : ' org.spongepowered.asm.launch.MixinTweaker' ,
162- ' TweakOrder' : 0 ,
163- ' FMLCorePluginContainsFMLMod' : ' true' ,
164- ' FMLCorePlugin' : ' me.zeroeightsix.kami.mixin.MixinLoaderForge' ,
165- ' ForceLoadAsMod' : ' true' ,
166- ' FMLAT' : ' kami_at.cfg'
167- )
168+ exclude ' **/rawimagefiles'
169+
170+ from(sourceSets. main. resources. srcDirs) {
171+ include ' mcmod.info'
172+ expand ' version' : project. version
168173 }
169174}
170175
176+ // Don't put baritone mixin here please c:
171177jar {
172- manifest {
173- attributes(
174- ' Main-Class' : ' me.zeroeightsix.installer.Installer'
175- )
178+ manifest. attributes(
179+ ' Manifest-Version' : 1.0 ,
180+ ' MixinConfigs' : ' mixins.kami.json' ,
181+ ' TweakClass' : ' org.spongepowered.asm.launch.MixinTweaker' ,
182+ ' TweakOrder' : 0 ,
183+ ' FMLCorePluginContainsFMLMod' : ' true' ,
184+ ' FMLCorePlugin' : ' me.zeroeightsix.kami.mixin.MixinLoaderForge' ,
185+ ' ForceLoadAsMod' : ' true' ,
186+ ' Main-Class' : ' me.zeroeightsix.installer.Installer'
187+ )
188+
189+ // Copy needed libs to jar
190+ from {
191+ configurations. jarLibs. collect {
192+ it. isDirectory() ? it : zipTree(it)
193+ }
176194 }
177- }
178-
179- build. dependsOn(shadowJar)
195+ }
0 commit comments