[gradle-plugin] Support headerFile property for dynamic libraries
This commit is contained in:
+4
@@ -21,6 +21,7 @@ import org.gradle.api.tasks.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.*
|
||||
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||
import org.jetbrains.kotlin.konan.util.visibleName
|
||||
import java.io.File
|
||||
|
||||
enum class Produce(val cliOption: String, val kind: CompilerOutputKind) {
|
||||
PROGRAM("program", CompilerOutputKind.PROGRAM),
|
||||
@@ -179,6 +180,9 @@ open class KonanCompileProgramTask: KonanCompileTask() {
|
||||
|
||||
open class KonanCompileDynamicTask: KonanCompileTask() {
|
||||
override val produce: Produce get() = Produce.DYNAMIC
|
||||
|
||||
val headerFile: File
|
||||
@OutputFile get() = destinationDir.resolve("$artifactPrefix${artifactName}_api.h")
|
||||
}
|
||||
|
||||
open class KonanCompileFrameworkTask: KonanCompileTask() {
|
||||
|
||||
+3
@@ -38,6 +38,9 @@ class PathSpecification extends BaseKonanSpecification {
|
||||
if (!target.artifact.exists()) throw new Exception("Artifact doesn't exist. Type: \${artifact.name}, target: \${target.target}")
|
||||
}
|
||||
}
|
||||
for (target in konanArtifacts.dynamic) {
|
||||
if (!target.headerFile.exists()) throw new Exception("Header file doesn't exist. Target: \${target.target}")
|
||||
}
|
||||
}
|
||||
}
|
||||
""".stripIndent())
|
||||
|
||||
Reference in New Issue
Block a user