-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
112 lines (93 loc) · 3.02 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'forge'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
version = "1.0"
group= "net.heyzeer0.mgh" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "MagiHandlers"
ext {
mixinSrg = new File(project.buildDir, 'tmp/mixins/mixin.magihandlers.srg')
mixinRefMap = new File(project.buildDir, "tmp/mixins/mixin.magihandlers.refmap.json")
}
reobf.addExtraSrgFile project.mixinSrg
minecraft {
version = "1.7.10-10.13.4.1614-1.7.10"
runDir = "eclipse"
}
compileJava {
options.compilerArgs += [
'-Xlint:-processing',
"-AoutSrgFile=${project.mixinSrg.canonicalPath}",
"-AoutRefMapFile=${project.mixinRefMap.canonicalPath}",
"-AreobfSrgFile=${project.file('build/srgs/mcp-srg.srg').canonicalPath}"
]
}
afterEvaluate {
tasks.compileJava.options.compilerArgs += "-AreobfSrgFile=${tasks.reobf.srg}"
}
task copySrgs(type: Copy, dependsOn: 'genSrgs') {
from plugins.getPlugin("forge").delayedFile('{SRG_DIR}')
include '**/*.srg'
into 'build/srgs'
}
setupDecompWorkspace.dependsOn copySrgs
setupDevWorkspace.dependsOn copySrgs
compileJava.dependsOn copySrgs
configurations {
shade
compile.extendsFrom shade
}
repositories {
maven {
name = "SpongePowered"
url = "https://repo.spongepowered.org/maven"
}
}
dependencies {
shade("org.spongepowered:mixin:0.7.1-SNAPSHOT"){
exclude module: 'launchwrapper'
exclude module: 'guava'
}
compileOnly fileTree(dir: 'lib', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.8.0'
compile project(':MagiHandlersAPI-Forge')
shade files('MagiHandlersAPI-Forge/build/libs/MagiHandlersAPI-Forge-1.0.jar')
compile project(':MagiHandlersAPI-Bukkit')
shade files('MagiHandlersAPI-Bukkit/build/libs/MagiHandlersAPI-Bukkit-1.0.jar')
}
jar {
from project.mixinRefMap
manifest {
if (gradle.startParameter.getTaskNames().contains("build")) {
attributes 'FMLCorePlugin': 'net.heyzeer0.mgh.MagiCore',
'FMLCorePluginContainsFMLMod': 'true',
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': '0'
} else {
attributes 'FMLCorePlugin': 'net.heyzeer0.mgh.MagiCore',
'FMLCorePluginContainsFMLMod': 'true'
}
}
configurations.shade.each { dep ->
from(project.zipTree(dep)){
include 'org/spongepowered', 'org/spongepowered/**', 'net/heyzeer0/mgh/api/forge/**', 'net/heyzeer0/mgh/api/bukkit/**'
}
}
}
processResources {}