-
Notifications
You must be signed in to change notification settings - Fork 32
/
build.gradle
99 lines (82 loc) · 2.66 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io/' }
maven { url 'https://maven.fabricmc.net/' }
maven { url 'https://mcphackers.org/libraries/' }
maven { url 'https://maven.glass-launcher.net/releases/'}
}
configurations {
shadow
implementation.extendsFrom shadow
}
dependencies {
runtimeOnly sourceSets.test.output
// Required libraries
shadow "org.ow2.asm:asm:${project.asm_version}"
shadow "org.ow2.asm:asm-analysis:${project.asm_version}"
shadow "org.ow2.asm:asm-commons:${project.asm_version}"
shadow "org.ow2.asm:asm-tree:${project.asm_version}"
shadow "org.ow2.asm:asm-util:${project.asm_version}"
shadow "com.github.MCPHackers.RetroDebugInjector:RetroDebugInjector-NIO:${project.rdi_version}"
shadow "com.github.MCPHackers.RetroDebugInjector:RetroDebugInjector:${project.rdi_version}"
shadow "io.github.lassebq:fernflower:${project.fernflower_version}"
shadow "org.fusesource.jansi:jansi:${project.jansi_version}"
shadow "org.json:json:${project.json_version}"
shadow "com.github.MCPHackers:DiffPatch:${project.diffpatch_version}"
shadow "net.fabricmc:mapping-io:${project.mapping_io_version}"
shadow "com.formdev:flatlaf:${project.flatlaf_version}"
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
// Use release flag on Java 9+ instead of source & target flags
// This makes the JDK read the boot classpath and use the proper
// libraries to be compliant with Java 8 without issues
if (JavaVersion.current().isJava9Compatible()) {
it.options.release.set(8)
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
application {
// Redirect all execution into the testing folder
mainClass = 'org.mcphackers.mcp.main.MainGUI'
executableDir = 'test'
mkdir(executableDir)
}
run {
workingDir 'test'
}
runShadow {
workingDir 'test'
}
shadowJar {
manifest {
attributes 'Main-Class': 'org.mcphackers.mcp.main.MainGUI'
}
archiveClassifier = 'GUI'
configurations = [project.configurations.shadow]
minimize {
exclude(dependency('com.formdev:.*:.*'))
}
}
tasks.register('jarCLI', ShadowJar) {
manifest {
attributes 'Main-Class': 'org.mcphackers.mcp.main.MainCLI'
}
archiveClassifier = 'CLI'
from sourceSets.main.output
configurations = [project.configurations.shadow]
minimize()
exclude('com/formdev/**/**')
exclude('META-INF/versions/**/**')
exclude('META-INF/**.RSA')
exclude('META-INF/**.SF')
}
jar.dependsOn(jarCLI)