-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
92 lines (79 loc) · 2.3 KB
/
build.gradle
File metadata and controls
92 lines (79 loc) · 2.3 KB
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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'name.valery1707.kaitai' version '0.1.3'
}
sourceCompatibility = '21'
targetCompatibility = '21'
sourceSets.main.java.srcDirs += 'build/generated/kaitai'
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://repo.spongepowered.org/maven/"
}
maven {
url "https://maven.fabricmc.net/"
}
}
dependencies {
shadow('com.thegamecommunity:excite') {
version {
branch = 'develop-extract'
}
}
implementation('com.thegamecommunity:excite') {
version {
branch = 'develop-extract'
}
}
shadow group: 'org.apache.commons', name: 'commons-text', version: '1.11.0'
shadow group: 'io.kaitai', name: 'kaitai-struct-runtime', version: '0.10'
testImplementation group: 'org.junit.jupiter', name:'junit-jupiter-api', version: '5.10.2'
testRuntimeOnly group: 'org.junit.jupiter', name :'junit-jupiter-engine', version: '5.10.2'
}
tasks.eclipse {
dependsOn 'init'
}
tasks.init {
finalizedBy 'kaitai'
}
tasks.kaitai.doFirst {
deleteRecursively(output.toPath());
}
kaitai {
url = new URL('https://github.com/kaitai-io/kaitai_struct_compiler/releases/download/0.10/kaitai-struct-compiler-0.10.zip')
packageName = 'com.gamebuster19901.excite.modding.game.file.kaitai'
}
import java.nio.file.*
import java.nio.file.attribute.*
public static void deleteRecursively(Path path) throws IOException {
if (Files.exists(path)) {
System.out.println("Deleting " + path);
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete(file);
return FileVisitResult.CONTINUE;
}
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
if (Files.isSymbolicLink(dir)) { //We MUST skip symbolic links or unintended files will be deleted!
Files.delete(dir);
return FileVisitResult.SKIP_SUBTREE;
}
return FileVisitResult.CONTINUE;
}
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
if (exc == null) {
Files.delete(dir);
return FileVisitResult.CONTINUE;
} else {
throw exc;
}
}
});
} else {
System.out.println("The specified path does not exist: " + path);
}
}