Skip to content

Commit a0c11dd

Browse files
committed
chore: Update conventions plugins
refactor: Merge features project into DI, remove old DI classes
1 parent 2d426d4 commit a0c11dd

30 files changed

Lines changed: 88 additions & 360 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
push:
66
branches:
77
- master
8-
paths:
9-
- 'docs/**'
10-
- .github/workflows/docs.yml
118

129
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1310
permissions:
@@ -22,19 +19,7 @@ jobs:
2219
steps:
2320
- uses: actions/checkout@v4
2421

25-
- uses: MineInAbyss/publish-action@v3
26-
with:
27-
publish-github-release: false
28-
build-tasks: 'docsGenerate'
29-
30-
- name: Update HTML links for GitHub Pages subdomain
31-
run: |
32-
find out -name "*.html" -exec sed -i 's#href="/#href="/Idofront/#g; s#src="/#src="/Idofront/#g' {} \;
33-
34-
- name: Upload artifact
35-
uses: actions/upload-pages-artifact@v3
36-
with:
37-
path: out
22+
- uses: MineInAbyss/publish-action/docs@develop
3823

3924
deploy:
4025
environment:

build.gradle.kts

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3-
import kotlin.io.path.createFile
4-
import kotlin.io.path.notExists
5-
import kotlin.io.path.writeText
6-
71
plugins {
82
java
93
alias(libs.plugins.kotlin.jvm) apply false
@@ -12,53 +6,37 @@ plugins {
126
alias(miaConventions.plugins.mia.docs)
137
}
148

15-
subprojects {
16-
repositories {
17-
mavenCentral()
18-
maven("https://repo.mineinabyss.com/releases")
19-
maven("https://repo.mineinabyss.com/snapshots")
20-
maven("https://repo.mineinabyss.com/mirror")
21-
maven("https://repo.papermc.io/repository/maven-public/")
22-
mavenLocal()
23-
}
24-
25-
tasks {
26-
withType<KotlinCompile> {
27-
compilerOptions {
28-
freeCompilerArgs = listOf(
29-
"-opt-in=kotlin.RequiresOptIn",
30-
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
31-
)
32-
}
33-
}
34-
}
35-
}
36-
37-
repositories {
38-
mavenCentral()
39-
maven("https://repo.mineinabyss.com/releases")
40-
maven("https://repo.mineinabyss.com/snapshots")
41-
}
42-
439
tasks {
10+
updateDaemonJvm {
11+
languageVersion = JavaLanguageVersion.of(25)
12+
vendor = JvmVendorSpec.JETBRAINS
13+
}
4414
dependencyUpdates {
4515
rejectVersionIf {
4616
isNonStable(candidate.version)
4717
}
4818
}
4919

20+
val versions = libs.versions
21+
val minecraftVersion = versions.minecraft.get()
22+
val kotlinVersion = versions.kotlin.get()
23+
val javaVersion = versions.java.get()
24+
5025
register("versionInfo") {
51-
file("build/versions.md").apply { ensureParentDirsCreated() }.toPath()
52-
.also { if (it.notExists()) it.createFile() }
53-
.writeText(
26+
val outputFile = file("build/versions.md")
27+
inputs.properties("minecraft" to minecraftVersion, "kotlin" to kotlinVersion, "java" to javaVersion)
28+
outputs.file(outputFile)
29+
doLast {
30+
outputFile.writeText(
5431
"""
5532
### Built for
56-
| Minecraft | `${libs.versions.minecraft.get().substringBefore("-R")}` |
33+
| Minecraft | `${minecraftVersion.substringBefore("-R")}` |
5734
|-----------|--|
58-
| Kotlin | `${libs.versions.kotlin.get()}` |
59-
| Java | `${libs.versions.java.get()}` |
35+
| Kotlin | `$kotlinVersion` |
36+
| Java | `$javaVersion` |
6037
""".trimIndent()
6138
)
39+
}
6240
}
6341
}
6442

@@ -77,7 +55,3 @@ versionCatalogUpdate {
7755
keepUnusedVersions = true
7856
}
7957
}
80-
81-
idofront {
82-
docsVersion = "0.0.4"
83-
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ group=com.mineinabyss
22
version=2.0
33
# Version to use for our conventions plugins.
44
# Idofront will point to this version in its catalog.
5-
conventionsVersion=1.1.1
5+
conventionsVersion=1.2.3
66
org.gradle.configuration-cache=true
77
org.gradle.caching=true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#This file is generated by updateDaemonJvm
2+
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ff832c875b57113076fee4f253b26a7d/redirect
3+
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/a2f766003b96f64a2ea8b94366df3521/redirect
4+
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ff832c875b57113076fee4f253b26a7d/redirect
5+
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/a2f766003b96f64a2ea8b94366df3521/redirect
6+
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9dd431e9b5e0fb4d071f9ec98fdbcf74/redirect
7+
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/9b892017f53da3db52320b6c212e6874/redirect
8+
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/ff832c875b57113076fee4f253b26a7d/redirect
9+
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/a2f766003b96f64a2ea8b94366df3521/redirect
10+
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/f9ff5ae41d9c64bfe1899fd7115dcd2b/redirect
11+
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/39ed049e9205de21f33a1ae19ef59436/redirect
12+
toolchainVendor=JETBRAINS
13+
toolchainVersion=25

gradle/wrapper/gradle-wrapper.jar

-504 Bytes
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
44
networkTimeout=10000
5+
retries=0
6+
retryBackOffMs=500
57
validateDistributionUrl=true
68
zipStoreBase=GRADLE_USER_HOME
79
zipStorePath=wrapper/dists
Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
import me.champeau.gradle.japicmp.JapicmpTask
2+
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder
23
import kotlin.io.path.isDirectory
34
import kotlin.io.path.listDirectoryEntries
5+
import kotlin.io.path.name
46

57
plugins {
68
id(miaConventions.plugins.mia.kotlin.jvm.get().pluginId)
7-
id(miaConventions.plugins.mia.copyjar.get().pluginId)
9+
id("com.mineinabyss.conventions.copyjar")
10+
// id(miaConventions.plugins.mia.copyjar.get().pluginId)
811
id(miaConventions.plugins.mia.papermc.get().pluginId)
912
id("me.champeau.gradle.japicmp") version "0.4.5"
1013
}
1114

12-
val libs = rootProject.extensions.getByType<VersionCatalogsExtension>().named("libs")
13-
1415
repositories {
1516
google()
1617
}
1718

1819
tasks {
1920
register<JapicmpTask>("checkBreakingChanges") {
21+
val pastReleases = isolated.rootProject.projectDirectory.file("past-releases")
2022
oldClasspath.from(
21-
rootProject.file("past-releases").toPath().takeIf { it.isDirectory() }?.listDirectoryEntries()?.firstOrNull()
23+
pastReleases.asFile.toPath().takeIf { it.isDirectory() }?.listDirectoryEntries()?.firstOrNull()
2224
)
2325
newClasspath.from(shadowJar)
2426
onlyBinaryIncompatibleModified = true
@@ -31,17 +33,23 @@ tasks {
3133
}
3234

3335
dependencies {
34-
libs.findBundle("platform").get().get().forEach {
36+
libs.bundles.platform.get().forEach {
3537
implementation(it)
3638
}
3739

38-
rootProject.subprojects
39-
.filter { it.name.startsWith("idofront-") }
40+
isolated.rootProject.projectDirectory.asFile.toPath().listDirectoryEntries("idofront-*")
41+
// .filter { it.name.startsWith("idofront-") }
4042
.filter { it.name !in setOf("idofront-catalog", "idofront-catalog-shaded") }
41-
.forEach { implementation(project(it.path)) }
43+
.forEach { implementation(project(":${it.name}")) }
4244
}
4345

4446
copyJar {
45-
jarName.set("idofront-$version.jar")
46-
excludePlatformDependencies.set(false)
47+
jarName = "idofront-$version.jar"
48+
excludePlatformDependencies = false
4749
}
50+
51+
paper {
52+
main = "com.mineinabyss.idofront.IdofrontPlugin"
53+
authors = listOf("Offz", "boy0000")
54+
load = PluginLoadOrder.STARTUP
55+
}

idofront-catalog-shaded/src/main/java/com/mineinabyss/idofront/IdofrontBootstrapper.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

idofront-catalog-shaded/src/main/resources/paper-plugin.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

idofront-catalog/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ plugins {
33
id(miaConventions.plugins.mia.publication.get().pluginId)
44
}
55

6+
val rootDir = isolated.rootProject.projectDirectory
7+
68
catalog {
79
versionCatalog {
8-
from(rootProject.files("gradle/libs.versions.toml"))
10+
from(rootDir.files("gradle/libs.versions.toml"))
911

1012
// Add aliases for all our conventions plugins by copying the catalog provided by the conventions repo
11-
val conventions = rootProject.extensions
13+
val conventions = extensions
1214
.getByType<VersionCatalogsExtension>()
1315
.named("miaConventions")
1416
version("mia-conventions", miaConventions.versions.mia.conventions.get())
@@ -17,15 +19,14 @@ catalog {
1719
}
1820

1921
// Add all idofront projects to the catalog
20-
rootProject.file(".").list()?.filter { it.startsWith("idofront") }?.forEach { name ->
22+
rootDir.asFile.list()?.filter { it.startsWith("idofront") }?.forEach { name ->
2123
library(name, "com.mineinabyss:$name:$version")
2224
}
2325
bundle(
2426
"idofront-core", listOf(
2527
"idofront-commands",
2628
"idofront-config",
2729
"idofront-di",
28-
"idofront-features",
2930
"idofront-fonts",
3031
"idofront-logging",
3132
"idofront-serializers",

0 commit comments

Comments
 (0)