kitgit

tirbofish/dropbear · diff

3d0d680 · tk

fixed lack of ExperimentalNativeAPI, general housekeeping and some plugin updates. it still doesn't work but hey more to come amirite???

Unverified

diff --git a/README.md b/README.md
index 27b2a00..b605152 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@ If you might have not realised, all the crates/projects names are after Australi
 ### Related Projects
 
 - [magna-carta](https://github.com/4tkbytes/dropbear/tree/main/magna-carta) is a rust library used to generate compile-time Kotlin/Native and Kotlin/JVM metadata for searching. 
+- [magna-carta-plugin](https://github.com/4tkbytes/dropbear/tree/main/magna-carta-plugin) is a Gradle plugin for generating metadata during compile time with the help of the magna-carta cli tool. 
 - [dropbear_future-queue](https://github.com/4tkbytes/dropbear/tree/main/dropbear_future-queue) is a handy library for dealing with async in a sync context
 - [model_to_image](https://github.com/4tkbytes/model_to_image) is a library used to generate thumbnails and images from a 3D model with the help of `russimp-ng` and a custom made rasteriser. _(very crude but usable)_
 
diff --git a/magna-carta-plugin/src/main/kotlin/com/dropbear/magna_carta/MagnaCartaPlugin.kt b/magna-carta-plugin/src/main/kotlin/com/dropbear/magna_carta/MagnaCartaPlugin.kt
index c888bb3..c50d31b 100644
--- a/magna-carta-plugin/src/main/kotlin/com/dropbear/magna_carta/MagnaCartaPlugin.kt
+++ b/magna-carta-plugin/src/main/kotlin/com/dropbear/magna_carta/MagnaCartaPlugin.kt
@@ -35,17 +35,29 @@ class MagnaCartaPlugin : Plugin<Project> {
 
         project.pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
             val kotlin = project.extensions.getByType(KotlinMultiplatformExtension::class)
+
             kotlin.sourceSets.apply {
-                val jvmMain = getByName("jvmMain")
-                jvmMain.kotlin.srcDir(generateJvmTask.map { it.outputDir })
+                if (names.contains("jvmMain")) {
+                    val jvmMain = getByName("jvmMain")
+                    jvmMain.kotlin.srcDir(generateJvmTask.map { it.outputDir })
+                }
 
-                val nativeMain = maybeCreate("nativeMain")
+                val nativeMain = findByName("nativeMain") ?: create("nativeMain")
                 nativeMain.kotlin.srcDir(generateNativeTask.map { it.outputDir })
 
                 kotlin.targets.withType(KotlinNativeTarget::class.java) {
                     compilations.getByName("main").defaultSourceSet.dependsOn(nativeMain)
                 }
             }
+
+
+            kotlin.targets.all {
+                this.compilations.all {
+                    this.compileTaskProvider.configure {
+                        this.dependsOn(generateJvmTask, generateNativeTask)
+                    }
+                }
+            }
         }
     }
 }
diff --git a/magna-carta/src/generator/jvm.rs b/magna-carta/src/generator/jvm.rs

Large diffs are not rendered by default. Showing the first 50 of 97 lines. Show full diff