-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
61 lines (50 loc) · 1.56 KB
/
build.gradle.kts
File metadata and controls
61 lines (50 loc) · 1.56 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
plugins {
kotlin("jvm")
id("com.gradleup.shadow") version "8.3.6"
}
base {
archivesName.set("Knit-Loader")
}
val knitVersion = property("mod_version") as String
version = knitVersion
fun convertJavaVersion(javaVersion: String): Int {
return try {
if (javaVersion.contains(".")) {
javaVersion.substring(javaVersion.lastIndexOf(".")+1).toInt()
} else {
javaVersion.toInt()
}
} catch (e : IllegalArgumentException) {
8
}
}
allprojects {
apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
repositories {
mavenCentral()
maven("https://maven.fabricmc.net")
maven("https://maven.bawnorton.com/releases")
maven("https://maven.florianreuth.de/snapshots")
}
java {
withSourcesJar()
targetCompatibility = rootProject.java.targetCompatibility
sourceCompatibility = rootProject.java.sourceCompatibility
}
kotlin {
jvmToolchain(convertJavaVersion(rootProject.kotlin.compilerOptions.jvmTarget.get().target))
}
}
subprojects {
apply(plugin = "com.gradleup.shadow")
version = knitVersion
}
dependencies {
api("org.jetbrains:annotations:26.0.2")
api("org.slf4j:slf4j-api:2.0.12")
// Right off the bat, we'll get every Kotlin standard library we'd ever need from here.
compileOnly("net.fabricmc:fabric-language-kotlin:${rootProject.property("fabric_kotlin_version")}")
// Loader-independent mixins :D
// compileOnly("net.fabricmc:sponge-mixin:${property("fabric_mixin_version")}")
}