generated from QuiltMC/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
90 lines (79 loc) · 2.18 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
plugins {
id 'java'
alias libs.plugins.idea.ext
alias libs.plugins.loom apply false
}
version = "${project.version}+mc.${libs.versions.minecraft.get()}"
if (!project.classification.isBlank())
version += "-${project.classification}"
group = project.maven_group
repositories {
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/'
}
maven {
name = "Forge"
url = "https://maven.minecraftforge.net/"
}
maven {
name = 'Ladysnake Mods'
url = 'https://maven.ladysnake.org/releases'
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
def awToAt() {
var exec = "deno run -A ${rootProject.rootDir}/scripts/mod.ts aw_to_at ${rootProject.rootDir}/common ${rootProject.rootDir}/neoforge ${libs.versions.minecraft.get()}".execute()
println(exec.text)
}
def generate(String type, String input, String output) {
var exec = "deno run -A ${rootProject.rootDir}/scripts/mod.ts ${type} ${rootProject.rootDir}/data/${input} ${rootProject.rootDir}/common/src/generated/resources/${output}".execute()
println(exec.text)
}
def generate(String type, String output) {
generate(type, type, output)
}
def transpile(String input, String output) {
generate("transpile", input, output)
}
def loot(String input, String output) {
generate("loot", input, output)
}
tasks.register("generateData") {
doFirst {
try {
generate("lang", "assets/wwizardry/lang")
generate("tags", "data")
generate("archex", "staticdata/architecture_extensions")
loot("basic_block_loot.fennec", "data/wwizardry/loot_table/blocks")
generate("bricks", "data/wwizardry/recipe")
transpile("recipes", "data/wwizardry/recipe")
transpile("loot", "data/wwizardry/loot_table")
transpile("world", "data/wwizardry/worldgen")
generate("blockstate", "assets/wwizardry/blockstates")
// awToAt()
} catch (e) {
e.printStackTrace()
}
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 21
dependsOn "generateData"
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
}