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