-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
191 lines (171 loc) · 6.14 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
buildscript {
repositories {
maven { url = "https://sizableshrimp.me/maven" }
maven { url = "https://maven.minecraftforge.net" }
maven { url = "https://repo.spongepowered.org/maven" }
maven { url = "https://maven.latticg.com/"}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '1.2.4'
id 'java'
id 'maven-publish'
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: 'org.spongepowered.mixin'
version = "2.0-SNAPSHOT"
group = "com.minecrafttas" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "KillTheRNG"
repositories {
maven { url 'https://jitpack.io' }
}
minecraft {
version = "1.12.2-14.23.5.2847"
runDir = "run"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20171003"
makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
replace '${version}':project.version,'${mcversion}':project.minecraft.version
clientRunArgs += "--mixin mixins.killtherng.json --tweakClass org.spongepowered.asm.launch.MixinTweaker"
serverRunArgs += "--mixin mixins.killtherng.json --tweakClass org.spongepowered.asm.launch.MixinTweaker"
}
dependencies {
compile('org.spongepowered:mixin:0.8.2') {
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
exclude module: 'log4j-core'
}
compile 'org.msgpack:msgpack-core:0.8.16'
compile 'org.msgpack:jackson-dataformat-msgpack:0.8.16'
compile 'com.github.KaptainWutax:SeedUtils:b6a383113c'
}
jar {
manifest.attributes(
'MixinConfigs': 'mixins.killtherng.json',
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'FMLCorePluginContainsFMLMod': 'true',
'ForceLoadAsMod': 'true'
)
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version':project.version, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
sourceSets {
main {
ext.refMap = "mixins.killtherng.refmap.json"
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier 'deobf'
manifest.attributes(
'FMLCorePluginContainsFMLMod': 'false',
'ForceLoadAsMod': 'false'
)
exclude 'dummyThing'
exclude 'com/minecrafttas/killtherng/random2mixin/**'
//exclude 'com/minecrafttas/killtherng/mixin/**'
exclude 'mixins.killtherng.json'
exclude 'com/minecrafttas/killtherng/KillTheRNGContainer.class'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
exclude 'com/minecrafttas/killtherng/random2mixin/**'
//exclude 'com/minecrafttas/killtherng/mixin/**'
exclude 'mixins.killtherng.json'
exclude 'com/minecrafttas/killtherng/KillTheRNGContainer.java'
}
shadowJar {
mainSpec.sourcePaths.clear()
dependsOn deobfJar
configurations = [project.configurations.compile]
relocate 'org.msgpack', 'com.minecrafttas.killtherng.repack.org.msgpack'
relocate 'com.fasterxml', 'com.minecrafttas.killtherng.repack.com.fasterxml'
classifier "shadow"
exclude 'dummyThing'
exclude 'com/minecrafttas/killtherng/random2mixin/**'
afterEvaluate {
from zipTree(reobfJar.jar)
}
doLast {
delete("${buildDir}/libs/${archivesBaseName}-${version}.jar")
ant.move(file:"${buildDir}/libs/${archivesBaseName}-${version}-deobf.jar", tofile:"${buildDir}/libs/${archivesBaseName}-${version}.jar")
ant.move(file:"${buildDir}/libs/${archivesBaseName}-${version}-shadow.jar", tofile:"${buildDir}/libs/${archivesBaseName}-${version}-full.jar")
}
}
mixin {
// Specify "notch" or "searge" here
defaultObfuscationEnv searge
add sourceSets.main, "mixins.killtherng.refmap.json"
}
artifacts {
archives deobfJar
archives shadowJar
archives sourcesJar
}
publishing {
repositories {
maven {
name = "mgnetwork"
url = "https://maven.mgnet.work/main"
credentials {
username = project.findProperty("mgnetworkUsername")
password = project.findProperty("mgnetworkPassword")
}
}
}
publications {
main(MavenPublication) {
from(components.java)
artifacts = ["${buildDir}/libs/${archivesBaseName}-${version}.jar", sourceJar]
artifactId = "killtherng"
pom {
name = "killtherng"
description = "Library for making Minecraft RNG deterministic"
url = "https://github.com/MinecraftTAS/KillTheRNG"
licenses {
license {
name = "GNU General Public License v3.0"
url = "https://www.gnu.org/licenses/gpl-3.0.de.html"
}
}
}
}
full(MavenPublication) {
from(components.java)
artifacts = ["${buildDir}/libs/${archivesBaseName}-${version}-full.jar"]
artifactId = "killtherng-full"
pom {
name = "killtherng-full"
description = "Library for making Minecraft RNG deterministic. This is with all dependencies"
url = "https://github.com/MinecraftTAS/KillTheRNG"
licenses {
license {
name = "GNU General Public License v3.0"
url = "https://www.gnu.org/licenses/gpl-3.0.de.html"
}
}
}
}
}
}