|
1 |
| -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar |
2 |
| - |
3 | 1 | plugins {
|
4 |
| - id 'application' |
5 |
| - id 'com.github.johnrengelman.shadow' version '7.1.2' |
6 |
| -} |
7 |
| - |
8 |
| -repositories { |
9 |
| - mavenCentral() |
10 |
| - maven { url 'https://jitpack.io/' } |
11 |
| - maven { url 'https://maven.fabricmc.net/' } |
12 |
| - maven { url 'https://mcphackers.org/libraries/' } |
13 |
| - maven { url 'https://maven.glass-launcher.net/releases/'} |
| 2 | + id "java" |
14 | 3 | }
|
15 | 4 |
|
16 |
| -configurations { |
17 |
| - shadow |
18 |
| - implementation.extendsFrom shadow |
19 |
| -} |
| 5 | +allprojects { |
| 6 | + apply plugin: "java" |
20 | 7 |
|
21 |
| -dependencies { |
22 |
| - runtimeOnly sourceSets.test.output |
| 8 | + repositories { |
| 9 | + mavenCentral() |
| 10 | + maven { url "https://jitpack.io/" } |
| 11 | + maven { url "https://maven.fabricmc.net/" } |
| 12 | + maven { url "https://mcphackers.org/libraries/" } |
| 13 | + maven { url "https://maven.glass-launcher.net/releases" } |
| 14 | + } |
23 | 15 |
|
24 |
| - // Required libraries |
25 |
| - shadow "org.ow2.asm:asm:${project.asm_version}" |
26 |
| - shadow "org.ow2.asm:asm-analysis:${project.asm_version}" |
27 |
| - shadow "org.ow2.asm:asm-commons:${project.asm_version}" |
28 |
| - shadow "org.ow2.asm:asm-tree:${project.asm_version}" |
29 |
| - shadow "org.ow2.asm:asm-util:${project.asm_version}" |
| 16 | + dependencies { |
| 17 | + runtimeOnly sourceSets.test.output |
30 | 18 |
|
31 |
| - shadow "com.github.MCPHackers.RetroDebugInjector:RetroDebugInjector-NIO:${project.rdi_version}" |
32 |
| - shadow "com.github.MCPHackers.RetroDebugInjector:RetroDebugInjector:${project.rdi_version}" |
33 |
| - shadow "io.github.lassebq:fernflower:${project.fernflower_version}" |
34 |
| - shadow "org.fusesource.jansi:jansi:${project.jansi_version}" |
35 |
| - shadow "org.json:json:${project.json_version}" |
36 |
| - shadow "com.github.MCPHackers:DiffPatch:${project.diffpatch_version}" |
37 |
| - shadow "net.fabricmc:mapping-io:${project.mapping_io_version}" |
| 19 | + // Required libraries |
| 20 | + implementation "org.ow2.asm:asm:${project.asm_version}" |
| 21 | + implementation "org.ow2.asm:asm-analysis:${project.asm_version}" |
| 22 | + implementation "org.ow2.asm:asm-commons:${project.asm_version}" |
| 23 | + implementation "org.ow2.asm:asm-tree:${project.asm_version}" |
| 24 | + implementation "org.ow2.asm:asm-util:${project.asm_version}" |
38 | 25 |
|
39 |
| - shadow "com.formdev:flatlaf:${project.flatlaf_version}" |
40 |
| -} |
| 26 | + implementation "com.github.MCPHackers.RetroDebugInjector:rdi-nio:${project.rdi_version}" |
| 27 | + implementation "com.github.MCPHackers.RetroDebugInjector:rdi:${project.rdi_version}" |
41 | 28 |
|
42 |
| -tasks.withType(JavaCompile).configureEach { |
43 |
| - it.options.encoding = "UTF-8" |
| 29 | + implementation "io.github.lassebq:fernflower:${project.fernflower_version}" |
44 | 30 |
|
45 |
| - // Use release flag on Java 9+ instead of source & target flags |
46 |
| - // This makes the JDK read the boot classpath and use the proper |
47 |
| - // libraries to be compliant with Java 8 without issues |
48 |
| - if (JavaVersion.current().isJava9Compatible()) { |
49 |
| - it.options.release.set(8) |
| 31 | + implementation "org.json:json:${project.json_version}" |
| 32 | + implementation "com.github.MCPHackers:DiffPatch:${project.diffpatch_version}" |
| 33 | + implementation "org.apache.commons:commons-lang3:${project.apache_version}" |
| 34 | + implementation "net.fabricmc:mapping-io:${project.mapping_io_version}" |
50 | 35 | }
|
51 |
| -} |
52 |
| - |
53 |
| -java { |
54 |
| - sourceCompatibility = JavaVersion.VERSION_1_8 |
55 |
| - targetCompatibility = JavaVersion.VERSION_1_8 |
56 |
| -} |
57 |
| - |
58 |
| -application { |
59 |
| - // Redirect all execution into the testing folder |
60 |
| - mainClass = 'org.mcphackers.mcp.main.MainGUI' |
61 |
| - executableDir = 'test' |
62 |
| - mkdir(executableDir) |
63 |
| -} |
64 |
| - |
65 |
| -run { |
66 |
| - workingDir 'test' |
67 |
| -} |
68 | 36 |
|
69 |
| -runShadow { |
70 |
| - workingDir 'test' |
71 |
| -} |
| 37 | + tasks.withType(JavaCompile).configureEach { |
| 38 | + it.options.encoding = "UTF-8" |
72 | 39 |
|
73 |
| -shadowJar { |
74 |
| - manifest { |
75 |
| - attributes 'Main-Class': 'org.mcphackers.mcp.main.MainGUI' |
| 40 | + // Use release flag on Java 9+ instead of source & target flags |
| 41 | + // This makes the JDK read the boot classpath and use the proper |
| 42 | + // libraries to be compliant with Java 8 without issues |
| 43 | + if (JavaVersion.current().isJava9Compatible()) { |
| 44 | + it.options.release.set(8) |
| 45 | + } |
76 | 46 | }
|
77 |
| - archiveClassifier = 'GUI' |
78 | 47 |
|
79 |
| - configurations = [project.configurations.shadow] |
80 |
| - minimize { |
81 |
| - exclude(dependency('com.formdev:.*:.*')) |
| 48 | + java { |
| 49 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 50 | + targetCompatibility = JavaVersion.VERSION_1_8 |
82 | 51 | }
|
83 | 52 | }
|
84 | 53 |
|
85 |
| -tasks.register('jarCLI', ShadowJar) { |
86 |
| - manifest { |
87 |
| - attributes 'Main-Class': 'org.mcphackers.mcp.main.MainCLI' |
88 |
| - } |
89 |
| - archiveClassifier = 'CLI' |
90 |
| - from sourceSets.main.output |
91 |
| - configurations = [project.configurations.shadow] |
92 |
| - minimize() |
93 |
| - exclude('com/formdev/**/**') |
94 |
| - exclude('META-INF/versions/**/**') |
95 |
| - exclude('META-INF/**.RSA') |
96 |
| - exclude('META-INF/**.SF') |
| 54 | +subprojects { |
| 55 | + apply plugin: "application" |
97 | 56 | }
|
98 |
| - |
99 |
| -jar.dependsOn(jarCLI) |
0 commit comments