c9ed648303
The kotlin-native-shared artifact includes API allowing us to work with K/N platforms, hosts, distribution etc. This patch replaces a dependency on kotlin-native-utils containing copies of such classes with a dependency on published kotlin-native-shared in the Gradle plugin and bundles kotlin-native-shared into the Gradle plugin jar.
34 lines
1.1 KiB
Kotlin
34 lines
1.1 KiB
Kotlin
import org.gradle.jvm.tasks.Jar
|
|
|
|
plugins {
|
|
kotlin("jvm")
|
|
}
|
|
|
|
dependencies {
|
|
compile(gradleApi())
|
|
compile(project(":kotlin-gradle-plugin-api"))
|
|
compile(commonDep("org.jetbrains.kotlin:kotlin-native-shared")) { isTransitive = false }
|
|
}
|
|
|
|
val generateMppTargetContainerWithPresets by generator(
|
|
"org.jetbrains.kotlin.generators.gradle.dsl.MppPresetFunctionsCodegenKt",
|
|
sourceSets["main"]
|
|
)
|
|
|
|
val generateAbstractBinaryContainer by generator(
|
|
"org.jetbrains.kotlin.generators.gradle.dsl.MppNativeBinaryDSLCodegenKt",
|
|
sourceSets["main"]
|
|
)
|
|
|
|
listOf(generateMppTargetContainerWithPresets, generateAbstractBinaryContainer).forEach {
|
|
it.systemProperty(
|
|
"org.jetbrains.kotlin.generators.gradle.dsl.outputSourceRoot",
|
|
project(":kotlin-gradle-plugin").projectDir.resolve("src/main/kotlin").absolutePath
|
|
)
|
|
}
|
|
|
|
// Workaround: 'java -jar' refuses to read the original dotted filename on Windows, 'Unable to access jarFile org.jetbrains.kotlin....jar'
|
|
tasks.named<Jar>(generateMppTargetContainerWithPresets.name + "WriteClassPath").configure {
|
|
archiveName = generateMppTargetContainerWithPresets.name
|
|
}
|