Added hash test, fixed idea native cinterop resolution

This commit is contained in:
Ugljesa Jovanovic 2020-06-03 00:18:41 +02:00 committed by Ugljesa Jovanovic
parent 006dd47873
commit 14676337fc
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F
3 changed files with 10 additions and 3 deletions

View File

@ -275,6 +275,9 @@ kotlin {
val nativeMain by creating { val nativeMain by creating {
dependsOn(commonMain) dependsOn(commonMain)
isRunningInIdea {
kotlin.srcDirs()
}
dependencies { dependencies {
nativeDependencies(this) nativeDependencies(this)
} }
@ -338,7 +341,7 @@ kotlin {
compilations.getByName("main") { compilations.getByName("main") {
if (linux64Bit.contains(this@withType.name)) { if (linux64Bit.contains(this@withType.name)) {
defaultSourceSet.dependsOn(createWorkaroundNativeMainSourceSet(this@withType.name, nativeDependencies)) defaultSourceSet.dependsOn(nativeMain)
} }
if (linux32Bit.contains(this@withType.name)) { if (linux32Bit.contains(this@withType.name)) {
defaultSourceSet.dependsOn(createWorkaround32bitNativeMainSourceSet(this@withType.name, nativeDependencies)) defaultSourceSet.dependsOn(createWorkaround32bitNativeMainSourceSet(this@withType.name, nativeDependencies))
@ -449,9 +452,8 @@ kotlin {
} }
} }
val linuxX64Main by getting { val linuxX64Main by getting {
dependsOn(nativeMain)
isRunningInIdea { isRunningInIdea {
kotlin.srcDir("src/nativeMain") kotlin.srcDir("src/nativeMain/kotlin")
} }
} }
val linuxX64Test by getting { val linuxX64Test by getting {

View File

@ -1,4 +1,5 @@
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bDelegated import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bDelegated
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bStateless
import kotlin.time.ExperimentalTime import kotlin.time.ExperimentalTime
import kotlin.time.measureTime import kotlin.time.measureTime
@ -9,4 +10,5 @@ fun main() {
// Blake // Blake
val blake = Blake2bDelegated() val blake = Blake2bDelegated()
println("Result ${blake.digest()}") println("Result ${blake.digest()}")
println("Result: ${Blake2bStateless.digest("test")}")
} }

View File

@ -1,4 +1,5 @@
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bDelegated import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bDelegated
import com.ionspin.kotlin.crypto.hash.blake2b.Blake2bStateless
import kotlin.time.ExperimentalTime import kotlin.time.ExperimentalTime
import kotlin.time.measureTime import kotlin.time.measureTime
@ -9,4 +10,6 @@ fun main() {
// Blake // Blake
val blake = Blake2bDelegated() val blake = Blake2bDelegated()
blake.digest() blake.digest()
println("Result: ${Blake2bStateless.digest("test")}")
} }