generated from SmushyTaco/Example-Mod
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
104 lines (88 loc) · 3.11 KB
/
build.gradle.kts
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
/*
* AvM Staff Mod
* Copyright (c) 2024 opekope2
*
* This mod is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This mod is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this mod. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
java
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.architectury)
alias(libs.plugins.architectury.loom) apply false
alias(libs.plugins.shadow) apply false
alias(libs.plugins.dokka)
}
architectury {
minecraft = libs.versions.minecraft.get()
}
repositories {
mavenCentral()
}
buildscript {
dependencies {
classpath(libs.dokka.base)
}
}
subprojects {
apply(plugin = "dev.architectury.loom")
val loom = project.extensions.getByName<net.fabricmc.loom.api.LoomGradleExtensionAPI>("loom")
dependencies {
"minecraft"(rootProject.libs.minecraft)
//"mappings"(variantOf(rootProject.libs.yarn) { classifier("v2") })
"mappings"(loom.layered { // FIXME
mappings(variantOf(rootProject.libs.yarn) { classifier("v2") })
mappings(rootProject.libs.yarn.patch.neoforge)
})
}
}
allprojects {
apply(plugin = "java")
apply(plugin = "kotlin")
apply(plugin = "architectury-plugin")
val javaVersion = rootProject.libs.versions.java.get()
val minecraftVersion = rootProject.libs.versions.minecraft.get()
base {
archivesName = "staff-mod"
}
val loaderSuffix = if (extra.has("loom.platform")) "${extra["loom.platform"]}." else ""
version = rootProject.libs.versions.staff.mod.get() + "-" + loaderSuffix + minecraftVersion
group = "opekope2.avm_staff"
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}
dependencies {
compileOnly(rootProject.libs.kotlin.stdlib)
}
kotlin.target.compilations.all {
kotlinOptions.jvmTarget = javaVersion
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
options.release = javaVersion.toInt()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
sourceCompatibility = JavaVersion.toVersion(javaVersion)
targetCompatibility = JavaVersion.toVersion(javaVersion)
withSourcesJar()
}
}