Gradle, native: Allow setting destination directory for binaries
Issue #KT-29395 fixed
This commit is contained in:
+1
-1
@@ -122,7 +122,7 @@ open class KotlinNativeTargetConfigurator<T : KotlinNativeTarget>(
|
||||
group = BasePlugin.BUILD_GROUP
|
||||
description = "Links ${binary.outputKind.description} '${binary.name}' for a target '${target.name}'."
|
||||
enabled = binary.konanTarget.enabledOnCurrentHost
|
||||
destinationDir = binary.outputDirectory
|
||||
|
||||
addCompilerPlugins()
|
||||
|
||||
if (binary !is TestExecutable) {
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ sealed class NativeBinary(
|
||||
|
||||
// Output access.
|
||||
// TODO: Provide output configurations and integrate them with Gradle Native.
|
||||
val outputDirectory: File = with(project) {
|
||||
var outputDirectory: File = with(project) {
|
||||
val targetSubDirectory = target.disambiguationClassifier?.let { "$it/" }.orEmpty()
|
||||
buildDir.resolve("bin/$targetSubDirectory${this@NativeBinary.name}")
|
||||
}
|
||||
|
||||
+9
@@ -425,6 +425,15 @@ open class KotlinNativeLink : AbstractKotlinNativeCompile<KotlinCommonToolOption
|
||||
project.files(intermediateLibrary.get()).asFileTree
|
||||
}
|
||||
|
||||
@OutputDirectory
|
||||
override fun getDestinationDir(): File {
|
||||
return binary.outputDirectory
|
||||
}
|
||||
|
||||
override fun setDestinationDir(destinationDir: File) {
|
||||
binary.outputDirectory = destinationDir
|
||||
}
|
||||
|
||||
@get:Input
|
||||
override val outputKind: CompilerOutputKind
|
||||
get() = binary.outputKind.compilerOutputKind
|
||||
|
||||
Reference in New Issue
Block a user