Skip to content

Commit

Permalink
Kotlin-native without cache and with @ExperimentalForeignApi
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfayard committed Dec 23, 2023
1 parent 6c71934 commit 40b93a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
7 changes: 2 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ val PROGRAM = "git-standup"

repositories {
mavenCentral()
@Suppress("DEPRECATION")
jcenter() // https://github.com/Kotlin/kotlinx-nodejs
}

Expand Down Expand Up @@ -57,6 +58,7 @@ kotlin {
all {
languageSettings.apply {
optIn("kotlin.RequiresOptIn")
optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
}

Expand Down Expand Up @@ -131,11 +133,6 @@ kotlin {
}
}

sourceSets.all {
languageSettings.apply {
optIn("kotlin.RequiresOptIn")
}
}
}

tasks.withType<JavaExec> {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

kotlin.mpp.stability.nowarn=true
kotlin.native.cacheKind.macosX64=none
2 changes: 2 additions & 0 deletions src/posixMain/kotlin/io/NativeActuals.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io

import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.refTo
import kotlinx.cinterop.toKString
import kotlinx.coroutines.runBlocking
Expand All @@ -14,6 +15,7 @@ actual suspend fun findExecutable(executable: String): String =
/**
* https://stackoverflow.com/questions/57123836/kotlin-native-execute-command-and-get-the-output
*/
@OptIn(ExperimentalForeignApi::class)
actual suspend fun executeCommandAndCaptureOutput(
command: List<String>, // "find . -name .git"
options: ExecuteCommandOptions
Expand Down

0 comments on commit 40b93a3

Please sign in to comment.