-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
189 lines (161 loc) · 5.62 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
/*
* Adapted from the Wizardry License
*
* Copyright (c) 2018-2020 DaPorkchop_ and contributors
*
* Permission is hereby granted to any persons and/or organizations using this software to copy, modify, merge, publish, and distribute it.
* Said persons and/or organizations are not allowed to use the software or any derivatives of the work for commercial use or any other means to generate income, nor are they allowed to claim this software as their own.
*
* The persons and/or organizations are also disallowed from sub-licensing and/or trademarking this software without explicit permission from DaPorkchop_.
*
* Any persons and/or organizations using this software must disclose their source code and have it publicly available, include this license, provide sufficient credit to the original authors of the project (IE: DaPorkchop_), as well as provide a link to the original project.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = "SpongePowered"
url = "https://repo.spongepowered.org/maven"
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "org.spongepowered:mixingradle:0.6-SNAPSHOT"
}
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "org.spongepowered.mixin"
ext {
//general things
javaVersion = "1.8"
speedboostVersion = "0.0.1." + ('git rev-list --count HEAD'.execute().text.trim())
//minecraft things
mcpmappingsVersion = "stable_39"
minecraftforgeVersion = "14.23.5.2847"
minecraftVersion = "1.12.2"
//dependency things
guavaVersion = "21.0"
lombokVersion = "1.16.20"
mixinVersion = "0.8.2"
porklibVersion = "0.5.5-SNAPSHOT"
}
version = "$speedboostVersion"
group = "net.daporkchop"
archivesBaseName = "speedboost"
compileJava {
sourceCompatibility = targetCompatibility = "$javaVersion"
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
minecraft {
version = "$minecraftVersion-$minecraftforgeVersion"
runDir = "run"
mappings = "$mcpmappingsVersion"
makeObfSourceJar = false
coreMod = "net.daporkchop.speedboost.MixinLoader"
def args = [
"-Dmixin.checks.interfaces=true",
"-Dmixin.debug.export=true",
"-Dmixin.debug.verbose=true",
"-Dmixin.hotSwap=true",
"-Dfp2.debug=true",
"-Xmx2G",
"-XX:+UseG1GC",
"-ea",
"-da:io.netty..."
]
clientJvmArgs += args
serverJvmArgs += args
}
configurations {
shade
compile.extendsFrom shade
all {
resolutionStrategy {
force("com.google.guava:guava:$guavaVersion")
}
}
}
repositories {
maven {
name = "DaPorkchop_"
url = "https://maven.daporkchop.net/"
}
maven {
name = "spongepowered-repo"
url = "https://repo.spongepowered.org/maven/"
}
mavenCentral()
}
dependencies {
shade("org.spongepowered:mixin:$mixinVersion") {
//transitive = false
}
annotationProcessor "org.spongepowered:mixin:$mixinVersion:processor"
//shade "net.daporkchop.lib:unsafe:$porklibVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
}
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"
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
mixin {
defaultObfuscationEnv searge
add sourceSets.main, "mixins.speedboost.refmap.json"
}
reobf.jar {
mappingType = "SEARGE"
classpath = sourceSets.main.compileClasspath
}
jar {
archiveName "SpeedBoost-v$speedboostVersion-$minecraftVersion" + ".jar"
from {
configurations.shade.collect {
it.isDirectory() ? it : zipTree(it)
}.unique(true)
} {
exclude "META-INF/**"
exclude sourceSets.main.output.asFileTree.collect {
return it.getPath().split("java/main/").last()
}
}
manifest {
attributes(
"MixinConfigs": "mixins.speedboost.json",
"tweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"TweakOrder": 0,
"FMLCorePluginContainsFMLMod": "false",
"FMLCorePlugin": "net.daporkchop.speedboost.MixinLoader",
"ForceLoadAsMod": "false",
"FMLAT": "speedboost_at.cfg"
)
}
}
task preIntellijRuns {
doFirst {
StreamSupport.stream(configurations.annotationProcessor.spliterator(), false).filter({
it.name.contains("mixin")
}).findAny().ifPresent({
minecraft.clientJvmArgs += "-javaagent:" + it.absolutePath
minecraft.serverJvmArgs += "-javaagent:" + it.absolutePath
})
}
}
genIntellijRuns.dependsOn(preIntellijRuns)