-
Notifications
You must be signed in to change notification settings - Fork 31
/
build.gradle.kts
85 lines (71 loc) · 2.58 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
import gg.essential.gradle.multiversion.StripReferencesTransform.Companion.registerStripReferencesAttribute
import gg.essential.gradle.util.*
import gg.essential.gradle.util.RelocationTransform.Companion.registerRelocationAttribute
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.23"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.8.0"
id("org.jetbrains.dokka") version "1.9.20"
id("gg.essential.defaults")
id("gg.essential.defaults.maven-publish")
}
group = "gg.essential"
version = versionFromBuildIdAndBranch()
kotlin.jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8))
}
tasks.withType<KotlinCompile> {
setJvmDefault("all-compatibility")
kotlinOptions {
languageVersion = "1.6"
apiVersion = "1.6"
}
}
val internal by configurations.creating {
val relocated = registerRelocationAttribute("internal-relocated") {
relocate("org.dom4j", "gg.essential.elementa.impl.dom4j")
relocate("org.commonmark", "gg.essential.elementa.impl.commonmark")
remapStringsIn("org.dom4j.DocumentFactory")
remapStringsIn("org.commonmark.internal.util.Html5Entities")
}
attributes { attribute(relocated, true) }
}
val common = registerStripReferencesAttribute("common") {
excludes.add("net.minecraft")
}
dependencies {
compileOnly(libs.kotlin.stdlib.jdk8)
compileOnly(libs.kotlin.reflect)
compileOnly(libs.jetbrains.annotations)
internal(libs.commonmark)
internal(libs.commonmark.ext.gfm.strikethrough)
internal(libs.commonmark.ext.ins)
internal(libs.dom4j)
implementation(prebundle(internal))
compileOnly(project(":mc-stubs"))
// Depending on LWJGL3 instead of 2 so we can choose opengl bindings only
compileOnly("org.lwjgl:lwjgl-opengl:3.3.1")
// Depending on 1.8.9 for all of these because that's the oldest version we support
compileOnly(libs.universalcraft.forge10809) {
attributes { attribute(common, true) }
}
compileOnly("com.google.code.gson:gson:2.2.4")
}
tasks.processResources {
inputs.property("project.version", project.version)
filesMatching("fabric.mod.json") {
expand("version" to project.version)
}
}
tasks.jar {
dependsOn(internal)
from({ internal.map { zipTree(it) } })
}
apiValidation {
ignoredProjects.addAll(subprojects.map { it.name })
nonPublicMarkers.add("org.jetbrains.annotations.ApiStatus\$Internal")
}
java.withSourcesJar()
publishing.publications.named<MavenPublication>("maven") {
artifactId = "elementa"
}