Reuse code from build-common

KT-8487
This commit is contained in:
Alexey Tsvetkov
2016-02-08 16:05:55 +03:00
parent a5e3ca3596
commit f93562299c
5 changed files with 104 additions and 141 deletions
@@ -92,12 +92,11 @@ open class IncrementalCacheImpl<Target>(
private val dependents = arrayListOf<IncrementalCacheImpl<Target>>()
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory: $target" } }
// TODO: review
val dependentsWithThis: Sequence<IncrementalCacheImpl<Target>>
get() = sequenceOf(this).plus(dependents.asSequence())
internal val dependentCaches: Iterable<IncrementalCacheImpl<Target>>
get() = dependents
val thisWithDependentCaches: Iterable<IncrementalCacheImpl<Target>> by lazy {
val result = arrayListOf(this)
result.addAll(dependents)
result
}
override fun registerInline(fromPath: String, jvmSignature: String, toPath: String) {
}
@@ -578,7 +577,7 @@ open class IncrementalCacheImpl<Target>(
val removedFqNames = removedClasses.map { it.fqNameForClassNameWithoutDollars }.toSet()
for (cache in dependentsWithThis) {
for (cache in thisWithDependentCaches) {
val parentsFqNames = hashSetOf<FqName>()
val childrenFqNames = hashSetOf<FqName>()