Skip to content

Commit 4449970

Browse files
committed
refactor: Switch to conventions plugins for multiplatform configuration
refactor: Switch to mia catalog for more dependencies
1 parent dbad1eb commit 4449970

22 files changed

Lines changed: 104 additions & 112 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

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="/geary/#g; s#src="/#src="/geary/#g' {} \;
33-
34-
- name: Upload artifact
35-
uses: actions/upload-pages-artifact@v3
36-
with:
37-
path: out
25+
- uses: MineInAbyss/publish-action/docs@develop
3826

3927
deploy:
4028
environment:

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ MAJOR is set to zero.
1313

1414
### Changed
1515

16-
- Switched to our own small DI library for internal module and for addons
16+
- Switched to our own small DI library for internal module and for addons, docs can be
17+
found [here](https://docs.mineinabyss.com/dependencies-kt/)
1718
- `WorldScoped` is now the preferred receiver when writing extension functions. `WorldScoped.newScope()` can be used to
1819
register systems, observers, etc... and automatically unregister them when calling `close` on the returned scope

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,9 @@ As the project matures, our primary goal is to make it useful to more people. He
100100
- Multiplatform support, with js, jvm, and native targets
101101
- Publish numbers for benchmarks and cover more parts of the engine with them
102102
- Relation queries, ex. entities with a parent that has X component.
103+
104+
## Development
105+
106+
- `gradle build` builds the project
107+
- `gradle allTests` runs tests
108+
- `gradle docsServe` serve docs locally

addons/geary-prefabs/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id(idofrontLibs.plugins.mia.kotlin.multiplatform.get().pluginId)
3+
id("multiplatform-targets")
34
id(idofrontLibs.plugins.mia.publication.get().pluginId)
45
alias(idofrontLibs.plugins.kotlinx.serialization)
56
}

addons/geary-prefabs/test@jvm/com/mineinabyss/geary/prefabs/GearyEntityComponentIdSerializerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GearyEntityComponentIdSerializerTest : GearyTest() {
3030
@Test
3131
fun `GearyEntitySerializer should deserialize to entity correctly`() {
3232
// arrange
33-
val format = YamlFormat(world.scope.get(SerializableComponents)!!.formats.module)
33+
val format = YamlFormat(world.scope[SerializableComponents].formats.module)
3434
val file =
3535
"""
3636
test:thing.a: {}

addons/geary-serialization/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id(idofrontLibs.plugins.mia.kotlin.multiplatform.get().pluginId)
3+
id("multiplatform-targets")
34
id(idofrontLibs.plugins.mia.publication.get().pluginId)
45
alias(idofrontLibs.plugins.kotlinx.serialization)
56
}

addons/geary-uuid/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id(idofrontLibs.plugins.mia.kotlin.multiplatform.get().pluginId)
3+
id("multiplatform-targets")
34
id(idofrontLibs.plugins.mia.publication.get().pluginId)
45
}
56

build.gradle.kts

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,6 @@
11
plugins {
2-
alias(idofrontLibs.plugins.kotlin.multiplatform)
3-
alias(idofrontLibs.plugins.mia.autoversion)
4-
alias(idofrontLibs.plugins.dependencyversions)
5-
alias(idofrontLibs.plugins.version.catalog.update)
2+
alias(idofrontLibs.plugins.kotlin.multiplatform) apply false
3+
alias(idofrontLibs.plugins.mia.docs)
4+
alias(idofrontLibs.plugins.mia.publication) apply false
65
alias(idofrontLibs.plugins.kotlinx.serialization) apply false
76
}
8-
9-
allprojects {
10-
repositories {
11-
mavenCentral()
12-
google()
13-
maven("https://repo.mineinabyss.com/releases")
14-
maven("https://repo.mineinabyss.com/snapshots")
15-
mavenLocal()
16-
}
17-
}
18-
19-
allprojects {
20-
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
21-
kotlin {
22-
jvm {
23-
testRuns["test"].executionTask.configure {
24-
useJUnitPlatform()
25-
}
26-
}
27-
// TODO Other targets are missing some implementations like Roaring Bitmaps, but we hope someone
28-
// interested can add support in the future. Thus, we force a target that doesn't actually compile
29-
// so we can't accidentally use jvm-only code in the common target.
30-
linuxX64()
31-
32-
sourceSets {
33-
all {
34-
languageSettings {
35-
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
36-
optIn("kotlin.time.ExperimentalTime")
37-
optIn("kotlin.ExperimentalUnsignedTypes")
38-
optIn("kotlin.uuid.ExperimentalUuidApi")
39-
optIn("kotlinx.serialization.ExperimentalSerializationApi")
40-
optIn("kotlin.RequiresOptIn")
41-
}
42-
}
43-
}
44-
45-
compilerOptions {
46-
freeCompilerArgs.addAll(
47-
listOf(
48-
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
49-
"-Xexpect-actual-classes"
50-
)
51-
)
52-
}
53-
}
54-
}
55-
}
56-
57-
configurations {
58-
create("docs")
59-
}
60-
61-
afterEvaluate {
62-
val version = file("docs/version").readText()
63-
dependencies {
64-
"docs"("me.dvyy:shocky-docs:$version")
65-
}
66-
}
67-
68-
tasks {
69-
register<JavaExec>("docsGenerate") {
70-
classpath = configurations.getByName("docs")
71-
mainClass.set("me.dvyy.shocky.docs.MainKt")
72-
args("generate")
73-
}
74-
register<JavaExec>("docsServe") {
75-
classpath = configurations.getByName("docs")
76-
mainClass.set("me.dvyy.shocky.docs.MainKt")
77-
args("serve")
78-
}
79-
}

conventions/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
gradlePluginPortal()
7+
}
8+
9+
dependencies {
10+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${idofrontLibs.versions.kotlin.get()}")
11+
}

conventions/settings.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.util.*
2+
3+
dependencyResolutionManagement {
4+
val gradlePropertiesFile = file("../gradle.properties")
5+
val properties = Properties()
6+
gradlePropertiesFile.inputStream().use { properties.load(it) }
7+
val catalogVersion = properties.getProperty("catalogVersion")
8+
repositories {
9+
maven("https://repo.mineinabyss.com/releases")
10+
maven("https://repo.mineinabyss.com/snapshots")
11+
mavenLocal()
12+
}
13+
versionCatalogs {
14+
create("idofrontLibs") {
15+
from("com.mineinabyss:catalog:$catalogVersion")
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)