[Build] Fix configuration cache issues (part 3)

* Make IntelliJInstrumentCodeTask compatible with configuration cache
* Make CoreXmlShadingTransformer compatible with configuration cache
* Make :kotlin-reflect:relocateCoreSources compatible with configuration cache
* Copy some properties to not capture it's owning object into lambda to support configuration cache
Relates to #KT-44611
This commit is contained in:
Alexander Likhachev
2021-02-14 10:39:26 +03:00
parent 0e4e90dc13
commit 5f10c98a38
5 changed files with 42 additions and 15 deletions
+6 -1
View File
@@ -4,6 +4,7 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext
import kotlinx.metadata.jvm.KmModuleVisitor
import kotlinx.metadata.jvm.KotlinModuleMetadata
import org.gradle.kotlin.dsl.support.serviceOf
import shadow.org.apache.tools.zip.ZipEntry
import shadow.org.apache.tools.zip.ZipOutputStream
@@ -157,8 +158,12 @@ val proguard by task<CacheableProguardTask> {
}
val relocateCoreSources by task<Copy> {
val relocatedCoreSrc = relocatedCoreSrc
val fs = serviceOf<FileSystemOperations>()
doFirst {
delete(relocatedCoreSrc)
fs.delete {
delete(relocatedCoreSrc)
}
}
from("$core/descriptors/src")