diff --git a/gradle.properties b/gradle.properties index a631216..ce3ef58 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -project.version=0.0.4 +project.version=0.0.5 # Sample mainClass=dev.toastbits.sample.SampleKt diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 0b75daa..82c9387 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -68,7 +68,7 @@ mavenPublishing { coordinates("dev.toastbits.kjna", "library", project_version) publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - // signAllPublications() + signAllPublications() configure(KotlinMultiplatform( javadocJar = JavadocJar.Dokka("dokkaHtml"), diff --git a/plugin/src/main/kotlin/dev/toastbits/kjna/plugin/KJnaJextractGenerateTask.kt b/plugin/src/main/kotlin/dev/toastbits/kjna/plugin/KJnaJextractGenerateTask.kt index 80765e6..a1bd39c 100644 --- a/plugin/src/main/kotlin/dev/toastbits/kjna/plugin/KJnaJextractGenerateTask.kt +++ b/plugin/src/main/kotlin/dev/toastbits/kjna/plugin/KJnaJextractGenerateTask.kt @@ -60,7 +60,8 @@ open class KJnaJextractGenerateTask: DefaultTask(), KJnaJextractRuntimeOptions { mutableListOf( parser.getHeaderFile(header.header_path).absolutePath, "--target-package", target_package, - "--header-class-name", header_class_name + "--header-class-name", header_class_name, + "--use-system-load-library" ) for (macro in runtime_options.macros) { @@ -160,7 +161,7 @@ open class KJnaJextractGenerateTask: DefaultTask(), KJnaJextractRuntimeOptions { private fun processJextractGenFile(file: File) { val lines: MutableList = file.readLines().toMutableList() val unnamed: MutableMap = mutableMapOf() - + for ((index, line) in lines.withIndex()) { var start: Int = 0 var last_identifier: UnnamedIdentifier? = null @@ -176,7 +177,7 @@ open class KJnaJextractGenerateTask: DefaultTask(), KJnaJextractRuntimeOptions { val path: String = line.substring(unnamed_start + 13, unnamed_end) last_identifier = unnamed.getOrPut(path) { UnnamedIdentifier() } - + last_identifier.lines[index] = line.substring(0, unnamed_start).indexOfLast { it.isWhitespace() || it == '.' || it == '"' } + 1 .. unnamed_end start = unnamed_end @@ -187,7 +188,7 @@ open class KJnaJextractGenerateTask: DefaultTask(), KJnaJextractRuntimeOptions { if (withname_start != -1) { val withName_end: Int = line.indexOf("\")", withname_start + 1) check(withName_end != -1) { "$file ($index)" } - + last_identifier.identifier = line.substring(withname_start + 11, withName_end) } } @@ -203,7 +204,7 @@ open class KJnaJextractGenerateTask: DefaultTask(), KJnaJextractRuntimeOptions { if (first == '/' || first == '*') { continue } - + val final_identifier: String = identifier.identifier ?: throw NullPointerException("$file $line $range") lines[line] = lines[line].replaceRange(range, final_identifier + "\u0000".repeat((range.endInclusive - range.start + 1) - final_identifier.length)) } diff --git a/runtime/build.gradle.kts b/runtime/build.gradle.kts index 9cd7c90..38cfae9 100644 --- a/runtime/build.gradle.kts +++ b/runtime/build.gradle.kts @@ -39,7 +39,7 @@ mavenPublishing { coordinates("dev.toastbits.kjna", "runtime", project_version) publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - // signAllPublications() + signAllPublications() configure(KotlinMultiplatform( javadocJar = JavadocJar.Dokka("dokkaHtml"), diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 4e7bfeb..e9ae1a9 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -4,7 +4,7 @@ import dev.toastbits.kjna.c.CType plugins { kotlin("multiplatform") - id("dev.toastbits.kjna").version("0.0.4") + id("dev.toastbits.kjna").version("0.0.5") } kotlin {