-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
199 lines (162 loc) · 6.83 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
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
maven { url = "https://maven.minecraftforge.net/" }
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url "https://repo.spongepowered.org/repository/maven-public" }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
classpath "org.spongepowered:mixingradle:0.7.+"
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'java'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = '0.0.9-b21'
group = 'com.github.mrmks.mc' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'LegacyModsFix'
ext {
// will this runs on linux or others? i don't know.
// projectClasspath = file("$buildDir/bin/main")
filterJavaSource = file("$buildDir/tmp/javaSource")
// modListFile = file("$buildDir/tmp/mod_list.json").absoluteFile
// modRepository = file("$buildDir/tmp/mods").absoluteFile
}
//java.toolchain.languageVersion = JavaLanguageVersion.of(8)
String fg2CompatDir = 'D:/Users/MrMks/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_stable/39'
minecraft {
mappings channel: 'snapshot', version: '20171003-1.12'
accessTransformers file('ccl_at.cfg')
accessTransformers file('touhou_little_maid_at.cfg')
runs {
client {
workingDirectory project.file('run/client')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
property 'fml.coreMods.load', 'com.github.mrmks.mc.lmf.core.FMLPluginImpl'
property 'fml.debugAccessTransformer', 'true'
property 'mrmks.lmf.saveDump', "./dump"
// // CodeChickenLib compat
property 'net.minecraftforge.gradle.GradleStart.srgDir', "$fg2CompatDir/1.12.2/srgs"
property 'net.minecraftforge.gradle.GradleStart.srg.notch-srg', "$fg2CompatDir/1.12.2/srgs/notch-srg.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.notch-mcp', "$fg2CompatDir/1.12.2/srgs/notch-mcp.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.srg-mcp', "$fg2CompatDir/1.12.2/srgs/srg-mcp.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.mcp-srg', "$fg2CompatDir/1.12.2/srgs/mcp-srg.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.mcp-notch', "$fg2CompatDir/1.12.2/srgs/mcp-notch.srg"
property 'net.minecraftforge.gradle.GradleStart.csvDir', "$fg2CompatDir"
}
server {
workingDirectory project.file('run/server')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
property 'fml.coreMods.load', 'com.github.mrmks.mc.lmf.core.FMLPluginImpl'
property 'fml.debugAccessTransformer', 'true'
// // CodeChickenLib compat
property 'net.minecraftforge.gradle.GradleStart.srgDir', "$fg2CompatDir/1.12.2/srgs"
property 'net.minecraftforge.gradle.GradleStart.srg.notch-srg', "$fg2CompatDir/1.12.2/srgs/notch-srg.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.notch-mcp', "$fg2CompatDir/1.12.2/srgs/notch-mcp.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.srg-mcp', "$fg2CompatDir/1.12.2/srgs/srg-mcp.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.mcp-srg', "$fg2CompatDir/1.12.2/srgs/mcp-srg.srg"
property 'net.minecraftforge.gradle.GradleStart.srg.mcp-notch', "$fg2CompatDir/1.12.2/srgs/mcp-notch.srg"
property 'net.minecraftforge.gradle.GradleStart.csvDir', "$fg2CompatDir"
}
}
}
configurations {
shade
implementation.extendsFrom shade
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
mixin {
add sourceSets.main, "mixins.legacymodsfix.refmap.json"
debug.export = true
debug.verbose = true
}
repositories {
flatDir { dirs 'libs' }
mavenCentral()
maven {
url = "https://files.minecraftforge.net/maven/"
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2859'
compileOnly 'org.jetbrains:annotations:23.0.0'
compileOnly fg.deobf('_:CodeChickenLib-1.12.2:3.2.3.357:universal')
compileOnly fg.deobf('_:ForgeMultipart-1.12.2:2.6.2.83:universal')
compileOnly fg.deobf('_:thutcore-1.12.2:5.21.0')
compileOnly fg.deobf('_:cfm:6.3.0-mc1.12.2')
compileOnly fg.deobf('_:chiselsandbits:14.33')
compileOnly fg.deobf('_:NyaSamaCompletePack-v2-mcg:201001:a')
compileOnly fg.deobf('_:NyaSamaCompletePack-v2-mcg:201001:b')
compileOnly fg.deobf('_:Armourers-Workshop-1.12.2:0.51.0')
compileOnly fg.deobf('_:touhoulittlemaid-1.12.2:1.2.5:release')
compileOnly fg.deobf('_:foamfix:0.10.8-1.12.2')
// runtimeOnly '_:CodeChickenLib-1.12.2:3.2.3.357-universal'
// runtimeOnly '_:chiselsandbits-14.33'
shade ('org.spongepowered:mixin:0.8.3') {
exclude module: "asm-commons"
exclude module: "asm-tree"
exclude module: "launchwrapper"
exclude module: "guava"
exclude module: "log4j-core"
exclude module: "gson"
exclude module: "commons-io"
}
annotationProcessor 'org.spongepowered:mixin:0.8.3:processor'
}
tasks.register('makeJavaSources', Sync) {
inputs.property 'version', version
from sourceSets.main.java
include '**/LMFModContainer.java'
filter ReplaceTokens, tokens: [version: version.toString().replace('-b', '.')]
into filterJavaSource
}
compileJava {
dependsOn 'makeJavaSources'
source += filterJavaSource
exclude {
!it.isDirectory() && !it.file.path.contains(filterJavaSource.name) && (it.name == 'LMFModContainer.java')
}
}
processResources {
inputs.property "version", project.version
filesMatching 'mcmod.info', {
expand 'version': project.version
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
jar {
// archiveClassifier.set "trace"
manifest {
attributes 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker'
attributes 'FMLCorePlugin': 'com.github.mrmks.mc.lmf.core.FMLPluginImpl'
attributes 'FMLCorePluginContainsFMLMod': 'false'
}
}
tasks.register('shadowJar', Jar) {
archiveClassifier.set "fat"
from {
project.configurations.shade.collect {
it.isDirectory() ? it : zipTree(it)
}
}
exclude "META-INF/*"
manifest.from jar.manifest
with jar
}
artifacts {
archives shadowJar
}
reobf {
shadowJar {}
}