[Gradle, K/N] Move NativeBinaryTypes from kotlin-gradle-plugin to kotlin-gradle-plugin-api
This commit is contained in:
@@ -11,7 +11,8 @@ publish()
|
|||||||
standardPublicJars()
|
standardPublicJars()
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlinStdlib())
|
implementation(kotlinStdlib())
|
||||||
|
implementation(project(":native:kotlin-native-utils"))
|
||||||
|
|
||||||
compileOnly(gradleApi())
|
compileOnly(gradleApi())
|
||||||
compileOnly("com.android.tools.build:gradle:0.4.2")
|
compileOnly("com.android.tools.build:gradle:0.4.2")
|
||||||
|
|||||||
+16
-1
@@ -1,8 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
|
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
|
||||||
package org.jetbrains.kotlin.gradle.plugin.mpp
|
package org.jetbrains.kotlin.gradle.plugin.mpp
|
||||||
|
|
||||||
import org.gradle.api.Named
|
import org.gradle.api.Named
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework.BitcodeEmbeddingMode
|
|
||||||
import org.jetbrains.kotlin.konan.target.Architecture.ARM32
|
import org.jetbrains.kotlin.konan.target.Architecture.ARM32
|
||||||
import org.jetbrains.kotlin.konan.target.Architecture.ARM64
|
import org.jetbrains.kotlin.konan.target.Architecture.ARM64
|
||||||
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||||
@@ -72,3 +76,14 @@ enum class NativeOutputKind(
|
|||||||
|
|
||||||
open fun availableFor(target: KonanTarget) = true
|
open fun availableFor(target: KonanTarget) = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class BitcodeEmbeddingMode {
|
||||||
|
/** Don't embed LLVM IR bitcode. */
|
||||||
|
DISABLE,
|
||||||
|
|
||||||
|
/** Embed LLVM IR bitcode as data. */
|
||||||
|
BITCODE,
|
||||||
|
|
||||||
|
/** Embed placeholder LLVM IR data as a marker. */
|
||||||
|
MARKER,
|
||||||
|
}
|
||||||
@@ -42,7 +42,6 @@ dependencies {
|
|||||||
|
|
||||||
compile(kotlinStdlib())
|
compile(kotlinStdlib())
|
||||||
compile(project(":kotlin-util-klib"))
|
compile(project(":kotlin-util-klib"))
|
||||||
compileOnly(project(":native:kotlin-native-utils"))
|
|
||||||
compileOnly(project(":kotlin-reflect-api"))
|
compileOnly(project(":kotlin-reflect-api"))
|
||||||
compileOnly(project(":kotlin-android-extensions"))
|
compileOnly(project(":kotlin-android-extensions"))
|
||||||
compileOnly(project(":kotlin-build-common"))
|
compileOnly(project(":kotlin-build-common"))
|
||||||
|
|||||||
-11
@@ -270,17 +270,6 @@ class Framework(
|
|||||||
*/
|
*/
|
||||||
var isStatic = false
|
var isStatic = false
|
||||||
|
|
||||||
enum class BitcodeEmbeddingMode {
|
|
||||||
/** Don't embed LLVM IR bitcode. */
|
|
||||||
DISABLE,
|
|
||||||
|
|
||||||
/** Embed LLVM IR bitcode as data. */
|
|
||||||
BITCODE,
|
|
||||||
|
|
||||||
/** Embed placeholder LLVM IR data as a marker. */
|
|
||||||
MARKER,
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val frameworkTargets = Attribute.of(
|
val frameworkTargets = Attribute.of(
|
||||||
"org.jetbrains.kotlin.native.framework.targets",
|
"org.jetbrains.kotlin.native.framework.targets",
|
||||||
|
|||||||
+4
-4
@@ -578,8 +578,8 @@ open class KotlinNativeLink : AbstractKotlinNativeCompile<KotlinCommonToolOption
|
|||||||
}
|
}
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
val embedBitcode: Framework.BitcodeEmbeddingMode by project.provider {
|
val embedBitcode: BitcodeEmbeddingMode by project.provider {
|
||||||
(binary as? Framework)?.embedBitcode ?: Framework.BitcodeEmbeddingMode.DISABLE
|
(binary as? Framework)?.embedBitcode ?: BitcodeEmbeddingMode.DISABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun buildCompilerArgs(): List<String> = mutableListOf<String>().apply {
|
override fun buildCompilerArgs(): List<String> = mutableListOf<String>().apply {
|
||||||
@@ -590,8 +590,8 @@ open class KotlinNativeLink : AbstractKotlinNativeCompile<KotlinCommonToolOption
|
|||||||
addKey("-tr", processTests)
|
addKey("-tr", processTests)
|
||||||
addArgIfNotNull("-entry", entryPoint)
|
addArgIfNotNull("-entry", entryPoint)
|
||||||
when (embedBitcode) {
|
when (embedBitcode) {
|
||||||
Framework.BitcodeEmbeddingMode.MARKER -> add("-Xembed-bitcode-marker")
|
BitcodeEmbeddingMode.MARKER -> add("-Xembed-bitcode-marker")
|
||||||
Framework.BitcodeEmbeddingMode.BITCODE -> add("-Xembed-bitcode")
|
BitcodeEmbeddingMode.BITCODE -> add("-Xembed-bitcode")
|
||||||
else -> { /* Do nothing. */
|
else -> { /* Do nothing. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user