tirbofish/dropbear · commit
01c4c64ea374082640b4a1593d6a5b2539b57f48
ci: fixing build.gradle.kts for dokka docs
Signature present but could not be verified.
Unverified
@@ -33,7 +33,6 @@ val libPathProvider = provider { ) candidates.firstOrNull { it.exists() }?.absolutePath - ?: println("No Rust library exists") } kotlin { @@ -51,13 +50,33 @@ kotlin { } val nativeLibPath = libPathProvider.get() - val nativeLibDir = file(nativeLibPath).parentFile.absolutePath - val nativeLibFileName = file(nativeLibPath).name - val nativeLibNameForLinking = when { - isMacOs -> nativeLibFileName.removePrefix("lib").removeSuffix(".dylib") - isLinux -> nativeLibFileName.removePrefix("lib").removeSuffix(".so") - isMingwX64 -> nativeLibFileName.removeSuffix(".dll") - else -> throw GradleException("Unsupported OS for library name derivation.") + if (nativeLibPath != null) { + val nativeLibDir = file(nativeLibPath).parentFile.absolutePath + val nativeLibFileName = file(nativeLibPath).name + val nativeLibNameForLinking = when { + isMacOs -> nativeLibFileName.removePrefix("lib").removeSuffix(".dylib") + isLinux -> nativeLibFileName.removePrefix("lib").removeSuffix(".so") + isMingwX64 -> nativeLibFileName.removeSuffix(".dll") + else -> throw GradleException("Unsupported OS for library name derivation.") + } + + nativeTarget.apply { + binaries { + sharedLib { + baseName = "dropbear" + + if (isLinux || isMacOs) { + linkerOpts("-L$nativeLibDir", "-l$nativeLibNameForLinking", "-Wl,-rpath,\\\$ORIGIN") + } else if (isMingwX64) { + val importLibName = "$nativeLibNameForLinking.lib" + val importLibPath = file("$nativeLibDir/$importLibName").absolutePath + linkerOpts( + importLibPath + ) + } + } + } + } } nativeTarget.apply { @@ -69,21 +88,6 @@ kotlin { } } } - binaries { - sharedLib { - baseName = "dropbear" - - if (isLinux || isMacOs) { - linkerOpts("-L$nativeLibDir", "-l$nativeLibNameForLinking", "-Wl,-rpath,\\\$ORIGIN") - } else if (isMingwX64) { - val importLibName = "$nativeLibNameForLinking.lib" - val importLibPath = file("$nativeLibDir/$importLibName").absolutePath - linkerOpts( - importLibPath - ) - } - } - } } sourceSets { @@ -1,20 +0,0 @@ -import com.dropbear.DropbearEngine -import com.dropbear.Runnable -import com.dropbear.System - -@Runnable -class Example: System() { - override fun load(engine: DropbearEngine) { - val entity = engine.getEntity("example") - val transform = entity?.getTransform() - transform?.position?.x = 10.0 - entity?.setTransform(transform) - } - - override fun update(engine: DropbearEngine, deltaTime: Float) { - } - - override fun destroy(engine: DropbearEngine) { - - } -}