[gradle-plugin] Fix path to artifacts with prefixes

This commit is contained in:
Ilya Matveev
2018-01-10 14:08:21 +07:00
committed by ilmat192
parent 525561eec3
commit dab46b4c4d
3 changed files with 12 additions and 3 deletions
@@ -62,13 +62,13 @@ abstract class KonanTargetableTask: DefaultTask() {
abstract class KonanArtifactTask: KonanTargetableTask(), KonanArtifactSpec {
open val artifact: File
@OutputFile get() = destinationDir.resolve(artifactNameWithSuffix)
@OutputFile get() = destinationDir.resolve(artifactFullName)
@Internal lateinit var destinationDir: File
@Internal lateinit var artifactName: String
protected val artifactNameWithSuffix: String
@Internal get() = "$artifactName$artifactSuffix"
protected val artifactFullName: String
@Internal get() = "$artifactPrefix$artifactName$artifactSuffix"
val artifactPath: String
@Internal get() = artifact.canonicalPath
@@ -76,6 +76,9 @@ abstract class KonanArtifactTask: KonanTargetableTask(), KonanArtifactSpec {
protected abstract val artifactSuffix: String
@Internal get
protected abstract val artifactPrefix: String
@Internal get
internal open fun init(destinationDir: File, artifactName: String, target: KonanTarget) {
super.init(target)
this.destinationDir = destinationDir
@@ -46,6 +46,9 @@ abstract class KonanCompileTask: KonanBuildingTask(), KonanCompileSpec {
override val artifactSuffix: String
@Internal get() = produce.kind.suffix(konanTarget)
override val artifactPrefix: String
@Internal get() = produce.kind.prefix(konanTarget)
// Other compilation parameters -------------------------------------------
protected val srcFiles_ = mutableSetOf<FileCollection>()
@@ -44,6 +44,9 @@ open class KonanInteropTask: KonanBuildingTask(), KonanInteropSpec {
override val artifactSuffix: String
@Internal get() = ".klib"
override val artifactPrefix: String
@Internal get() = ""
// Interop stub generator parameters -------------------------------------
@InputFile lateinit var defFile: File