Skip to content

Commit

Permalink
Merge pull request EssentialGG#69 from EssentialGG/fix/missing-intern…
Browse files Browse the repository at this point in the history
…al-jar-in-dev

Build: Fix internal dependencies not being available in dev
  • Loading branch information
Johni0702 authored Jun 28, 2022
2 parents 020c206 + b9c4afc commit 4d3219d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
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"
Expand All @@ -13,26 +14,30 @@ kotlin.jvmToolchain {
}
tasks.compileKotlin.setJvmDefault("all-compatibility")

val internal = makeConfigurationForInternalDependencies {
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")
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 {
implementation(libs.kotlin.stdlib.jdk8)
implementation(libs.kotlin.reflect)
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))

// Depending on LWJGL3 instead of 2 so we can choose opengl bindings only
compileOnly("org.lwjgl:lwjgl-opengl:3.3.1")
Expand Down
2 changes: 1 addition & 1 deletion versions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
exclude(group = "org.jetbrains.kotlin")
}

common(project(":")) { isTransitive = false }
common(project(":"))

if (platform.isFabric) {
val fabricApiVersion = when(platform.mcVersion) {
Expand Down

0 comments on commit 4d3219d

Please sign in to comment.