fix: resolve configuration cache issue in processLspResources task
Changed processLspResources from a generic task with doLast block to a proper Copy task. This eliminates Gradle script object references that were incompatible with configuration cache. - Converted to Copy task type - Moved copy logic from doLast to task configuration - Maintains same functionality while being configuration cache compatible
This commit is contained in:
@@ -77,30 +77,24 @@ tasks {
|
||||
onlyIfModified(true)
|
||||
}
|
||||
}
|
||||
val processLspResources by registering {
|
||||
val processLspResources by registering(Copy::class) {
|
||||
|
||||
dependsOn(downloadTasks)
|
||||
inputs.dir(downloadDir)
|
||||
outputs.dir(extractedDir)
|
||||
|
||||
doLast {
|
||||
slintViewerFilenames.forEach { (filename, renamed) ->
|
||||
val fileTarget = downloadDir.get().file(filename)
|
||||
copy {
|
||||
val fileTree = if (filename.endsWith("zip")) zipTree(fileTarget) else tarTree(fileTarget)
|
||||
from(fileTree) {
|
||||
// 匹配压缩包内的 slint-lsp 文件夹及其内容
|
||||
include("**/slint-lsp*")
|
||||
// 展平目录并重命名
|
||||
eachFile {
|
||||
path = renamed
|
||||
}
|
||||
includeEmptyDirs = false
|
||||
}
|
||||
into(extractedDir)
|
||||
slintViewerFilenames.forEach { (filename, renamed) ->
|
||||
val fileTarget = downloadDir.get().file(filename)
|
||||
val fileTree = if (filename.endsWith("zip")) zipTree(fileTarget) else tarTree(fileTarget)
|
||||
from(fileTree) {
|
||||
// 匹配压缩包内的 slint-lsp 文件夹及其内容
|
||||
include("**/slint-lsp*")
|
||||
// 展平目录并重命名
|
||||
eachFile {
|
||||
path = renamed
|
||||
}
|
||||
includeEmptyDirs = false
|
||||
}
|
||||
}
|
||||
into(extractedDir)
|
||||
}
|
||||
prepareSandbox {
|
||||
dependsOn(processLspResources)
|
||||
|
||||
Reference in New Issue
Block a user