forked from EssentialGG/Vigilance
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
64 lines (53 loc) · 2.26 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
import gg.essential.gradle.multiversion.StripReferencesTransform.Companion.registerStripReferencesAttribute
import gg.essential.gradle.util.*
import gg.essential.gradle.util.RelocationTransform.Companion.registerRelocationAttribute
plugins {
kotlin("jvm") version "1.6.10"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.8.0"
id("org.jetbrains.dokka") version "1.6.10" apply false
id("gg.essential.defaults")
id("maven-publish")
}
kotlin.jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8))
}
tasks.compileKotlin.setJvmDefault("all-compatibility")
val internal by configurations.creating {
val relocated = registerRelocationAttribute("internal-relocated") {
relocate("com.electronwill.nightconfig", "gg.essential.vigilance.impl.nightconfig")
remapStringsIn("com.electronwill.nightconfig.core.file.FormatDetector")
}
attributes { attribute(relocated, true) }
}
val common = registerStripReferencesAttribute("common") {
excludes.add("net.minecraft")
}
dependencies {
internal(libs.nightconfig.toml)
implementation(prebundle(internal))
compileOnly(libs.kotlin.stdlib.jdk8)
compileOnly(libs.kotlin.reflect)
compileOnly(libs.jetbrains.annotations)
// 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.versions.elementa.map { "gg.essential:elementa-1.8.9-forge:$it" }) {
attributes { attribute(common, true) }
}
compileOnly("gg.essential:universalcraft-1.8.9-forge") {
attributes { attribute(common, true) }
}
compileOnly("com.google.code.gson:gson:2.2.4")
testImplementation("io.mockk:mockk:1.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
testImplementation("io.strikt:strikt-core:0.22.1")
}
apiValidation {
ignoredProjects.addAll(project("platform").allprojects.map { it.name })
ignoredPackages.add("gg.essential.vigilance.example")
nonPublicMarkers.add("org.jetbrains.annotations.ApiStatus\$Internal")
}
tasks.test {
useJUnitPlatform()
}