diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt index 7bbb8890238..a4825e52034 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/main.kt @@ -171,9 +171,9 @@ private fun processLib(konanHome: String, val userDir = System.getProperty("user.dir") val ktGenRoot = args["-generated"]?.single() ?: userDir val nativeLibsDir = args["-natives"]?.single() ?: userDir - val platformName = args["-target"]?.single() ?: "jvm" + val flavorName = args["-flavor"]?.single() ?: "jvm" - val platform = KotlinPlatform.values().single { it.name.equals(platformName, ignoreCase = true) } + val flavor = KotlinPlatform.values().single { it.name.equals(flavorName, ignoreCase = true) } val defFile = args["-def"]?.single()?.let { File(it) } @@ -238,7 +238,7 @@ private fun processLib(konanHome: String, val nativeIndex = buildNativeIndex(library) - val gen = StubGenerator(nativeIndex, configuration, libName, generateShims, platform) + val gen = StubGenerator(nativeIndex, configuration, libName, generateShims, flavor) outKtFile.parentFile.mkdirs() outKtFile.bufferedWriter().use { out -> @@ -259,7 +259,7 @@ private fun processLib(konanHome: String, val workDir = defFile?.parentFile ?: File(System.getProperty("java.io.tmpdir")) - if (platform == KotlinPlatform.JVM) { + if (flavor == KotlinPlatform.JVM) { val outOFile = createTempFile(suffix = ".o") @@ -280,7 +280,7 @@ private fun processLib(konanHome: String, runCmd(linkerCmd, workDir, verbose) outOFile.delete() - } else if (platform == KotlinPlatform.NATIVE) { + } else if (flavor == KotlinPlatform.NATIVE) { val outBcName = libName + ".bc" val outLib = nativeLibsDir + "/" + outBcName val compilerCmd = arrayOf("$llvmInstallPath/bin/$compiler", *compilerOpts.toTypedArray(), diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index fe8973014f2..86c6b60d36e 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -1508,29 +1508,29 @@ kotlinNativeInterop { sysstat { pkg 'sysstat' headers 'sys/stat.h' - target 'native' + flavor 'native' } cstdlib { pkg 'cstdlib' headers 'stdlib.h' - target 'native' + flavor 'native' } cstdio { defFile 'interop/basics/cstdio.def' - target 'native' + flavor 'native' compilerOpts '-D_POSIX_SOURCE' // Exclude Darwin extensions causing link errors. } sockets { defFile 'interop/basics/sockets.def' - target 'native' + flavor 'native' } if (isMac()) { opengl { - target 'native' + flavor 'native' compilerOpts '-framework', 'OpenGL', '-framework', 'GLUT' linkerOpts '-framework', 'OpenGL', '-framework', 'GLUT' pkg 'opengl' @@ -1578,4 +1578,4 @@ if (isMac()) { source = "interop/basics/opengl_teapot.kt" interop = 'opengl' } -} \ No newline at end of file +} diff --git a/buildSrc/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy b/buildSrc/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy index 3be61c17473..1c1fdf90d37 100644 --- a/buildSrc/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy +++ b/buildSrc/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy @@ -23,7 +23,7 @@ class NamedNativeInteropConfig implements Named { private SourceSet interopStubs final JavaExec genTask - private String target = "jvm" + private String flavor = "jvm" private String defFile @@ -38,8 +38,8 @@ class NamedNativeInteropConfig implements Named { Configuration configuration - void target(String value) { - target = value + void flavor(String value) { + flavor = value } void defFile(String value) { @@ -188,7 +188,7 @@ class NamedNativeInteropConfig implements Named { args "-properties:" + project.findProject(":backend.native").file("konan.properties") args "-generated:" + generatedSrcDir args "-natives:" + nativeLibsDir - args "-target:" + this.target + args "-flavor:" + this.flavor // Uncomment to debug. //args "-verbose:true" diff --git a/cmd/interop b/cmd/interop index 5cef7c1ab67..35f18e3b3f2 100644 --- a/cmd/interop +++ b/cmd/interop @@ -52,13 +52,13 @@ INTEROP_RUNTIME_JAR="${KONAN_HOME}/konan/lib/Runtime.jar" INTEROP_CLASSPATH="$STUB_GENERATOR_JAR:$KOTLIN_JAR:$INTEROP_INDEXER_JAR:$INTEROP_RUNTIME_JAR" INTEROP_TOOL=org.jetbrains.kotlin.native.interop.gen.jvm.MainKt -TARGET_ARG=-target:native +FLAVOR_ARG=-flavor:native LIBCLANG_DISABLE_CRASH_RECOVERY=1 \ LD_LIBRARY_PATH=${NATIVE_LIB} \ $JAVACMD $JAVA_OPTS ${java_args[@]} \ -cp $INTEROP_CLASSPATH \ $INTEROP_TOOL \ - $TARGET_ARG ${interop_args[@]} \ + $FLAVOR_ARG ${interop_args[@]} \