Commit d3de3cfc authored by Alexey Tsvetkov's avatar Alexey Tsvetkov

Get rid of copying skia in case SKIA_DIR is provided

parent a43e971b
...@@ -82,19 +82,21 @@ fun AbstractCopyTask.configureSkiaCopy(targetDir: File) { ...@@ -82,19 +82,21 @@ fun AbstractCopyTask.configureSkiaCopy(targetDir: File) {
} }
val skiaDir = run { val skiaDir = run {
val targetDir = properties.dependenciesDir.resolve("skia/skia") if (properties.skiaDir != null) {
val taskProvider = if (properties.skiaDir != null) { tasks.register("skiaDir", DefaultTask::class) {
tasks.register("syncSkia", Sync::class) { // dummy task to simplify usage of the resulting provider (see `else` branch)
from(properties.skiaDir!!.absoluteFile) // if a file provider is not created from a task provider,
configureSkiaCopy(targetDir) // then it cannot be used instead of a task in `dependsOn` clauses of other tasks.
} // e.g. the resulting `skiaDir` could not be used in `dependsOn` of CppCompile configuration
enabled = false
}.map { properties.skiaDir!! }
} else { } else {
val targetDir = properties.dependenciesDir.resolve("skia/skia")
tasks.register("unzipSkia", Copy::class) { tasks.register("unzipSkia", Copy::class) {
from(skiaZip.map { zipTree(it) }) from(skiaZip.map { zipTree(it) })
configureSkiaCopy(targetDir) configureSkiaCopy(targetDir)
} }.map { targetDir }
} }
taskProvider.map { targetDir }
} }
val skijaZip = run { val skijaZip = run {
...@@ -111,7 +113,7 @@ val skijaZip = run { ...@@ -111,7 +113,7 @@ val skijaZip = run {
val skijaDir = run { val skijaDir = run {
if (properties.skijaDir != null) { if (properties.skijaDir != null) {
tasks.register("unzipSkija", Copy::class) { tasks.register("skijaDir", DefaultTask::class) {
enabled = false enabled = false
}.map { properties.skijaDir!! } }.map { properties.skijaDir!! }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment