[K/N][build] Add artifacts depending on input in library task
Depending on noPack option compiler produces file or directory. Artifact field that contains .klib file can't use @OutputDirectory annotation. The same applies for @OutputFile with directory. To workaround make an artifact field internal and use two optional fields that return either file or directory depending on noPack option.
This commit is contained in:
@@ -439,7 +439,6 @@ konanArtifacts {
|
|||||||
stdlibBuildTask = project.findKonanBuildTask("stdlib", project.platformManager.hostPlatform.target).apply {
|
stdlibBuildTask = project.findKonanBuildTask("stdlib", project.platformManager.hostPlatform.target).apply {
|
||||||
configure {
|
configure {
|
||||||
dependsOn(":kotlin-native:distCompiler")
|
dependsOn(":kotlin-native:distCompiler")
|
||||||
outputs.dir(project.buildDir.resolve("stdlib/$hostName/stdlib"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -391,6 +391,18 @@ open class KonanCompileFrameworkTask: KonanCompileNativeBinary() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open class KonanCompileLibraryTask: KonanCompileTask() {
|
open class KonanCompileLibraryTask: KonanCompileTask() {
|
||||||
|
override val artifact: File
|
||||||
|
@Internal get() = destinationDir.resolve(artifactFullName)
|
||||||
|
|
||||||
|
val artifactFile: File?
|
||||||
|
@Optional @OutputFile get() = if (!noPack) artifact else null
|
||||||
|
|
||||||
|
val artifactDirectory: File?
|
||||||
|
@Optional @OutputDirectory get() = if (noPack) artifact else null
|
||||||
|
|
||||||
|
override val artifactSuffix: String
|
||||||
|
@Internal get() = if (!noPack) produce.suffix(konanTarget) else ""
|
||||||
|
|
||||||
override fun buildCommonArgs() = super.buildCommonArgs().apply {
|
override fun buildCommonArgs() = super.buildCommonArgs().apply {
|
||||||
addKey("-nopack", noPack)
|
addKey("-nopack", noPack)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user