Skip to content

Commit

Permalink
New: unstable projects
Browse files Browse the repository at this point in the history
These are (successful) experiments, originally developed internally at Essential, of future Elementa features.

While a feature is classified as an unstable project, no guarantees with respect to backwards compatibility are made. We will however attempt to avoid non-obvious behavioral changes and try to provide a gradual migration path where possible.

Note: Due to these features not being backwards compatible, they are also not yet included in the main Elementa publication (which does guarantee indefinite backwards compatibility).
Instead if you want to use one of these, you must depend on the respective unstable artifact, relocate it to a dedicated package within your mod and bundle this relocated version in your jar (that way your mod always gets the version it needs, and you can freely choose when to upgrade to a newer version).

GitHub: #134
Co-authored-by: Jonas Herzig <jonas@spark-squared.com>
  • Loading branch information
Sychic and Johni0702 authored Feb 29, 2024
1 parent d10bb13 commit 281319f
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {
}

apiValidation {
ignoredProjects.add("platform")
ignoredProjects.addAll(listOf("platform", "statev2", "layoutdsl"))
ignoredPackages.add("com.example")
nonPublicMarkers.add("org.jetbrains.annotations.ApiStatus\$Internal")
}
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ project(":platform").apply {
projectDir = file("versions/")
buildFileName = "root.gradle.kts"
}
include(":unstable:statev2")
include(":unstable:layoutdsl")

listOf(
"1.8.9-forge",
Expand Down
39 changes: 39 additions & 0 deletions unstable/layoutdsl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import gg.essential.gradle.multiversion.StripReferencesTransform.Companion.registerStripReferencesAttribute
import gg.essential.gradle.util.setJvmDefault
import gg.essential.gradle.util.versionFromBuildIdAndBranch

plugins {
kotlin("jvm")
id("gg.essential.defaults")
id("maven-publish")
}

version = versionFromBuildIdAndBranch()
group = "gg.essential"

dependencies {
compileOnly(project(":"))
api(project(":unstable:statev2"))

val common = registerStripReferencesAttribute("common") {
excludes.add("net.minecraft")
}
compileOnly(libs.versions.universalcraft.map { "gg.essential:universalcraft-1.8.9-forge:$it" }) {
attributes { attribute(common, true) }
}
}
tasks.compileKotlin.setJvmDefault("all")

kotlin.jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8))
}

publishing {
publications {
register<MavenPublication>("maven") {
from(components["java"])

artifactId = "elementa-unstable-${project.name}"
}
}
}
38 changes: 38 additions & 0 deletions unstable/statev2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import gg.essential.gradle.multiversion.StripReferencesTransform.Companion.registerStripReferencesAttribute
import gg.essential.gradle.util.setJvmDefault
import gg.essential.gradle.util.versionFromBuildIdAndBranch

plugins {
kotlin("jvm")
id("gg.essential.defaults")
id("maven-publish")
}

version = versionFromBuildIdAndBranch()
group = "gg.essential"

dependencies {
compileOnly(project(":"))

val common = registerStripReferencesAttribute("common") {
excludes.add("net.minecraft")
}
compileOnly(libs.versions.universalcraft.map { "gg.essential:universalcraft-1.8.9-forge:$it" }) {
attributes { attribute(common, true) }
}
}
tasks.compileKotlin.setJvmDefault("all")

kotlin.jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8))
}

publishing {
publications {
register<MavenPublication>("maven") {
from(components["java"])

artifactId = "elementa-unstable-${project.name}"
}
}
}

0 comments on commit 281319f

Please sign in to comment.