Simplified interface of IncrementalCache (depending on JDK only).
Original commit: 04f7ad450f
This commit is contained in:
@@ -168,31 +168,22 @@ public class IncrementalCacheImpl(baseDir: File): IncrementalCache {
|
|||||||
putPackagePartSourceData(moduleId, sourceFile, null)
|
putPackagePartSourceData(moduleId, sourceFile, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun getPackagesWithRemovedFiles(moduleId: String, compiledSourceFiles: Collection<JetFile>): Collection<FqName> {
|
public override fun getRemovedPackageParts(moduleId: String, compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
||||||
return getRemovedPackageParts(moduleId, compiledSourceFiles).map { it.getFqNameForClassNameWithoutDollars().parent() }
|
val result = HashSet<String>()
|
||||||
}
|
|
||||||
|
|
||||||
public override fun getRemovedPackageParts(moduleId: String, compiledSourceFiles: Collection<JetFile>): Collection<JvmClassName> {
|
|
||||||
val sourceFileToCurrentFqNameMap = HashMap<File, FqName>()
|
|
||||||
for (sourceFile in compiledSourceFiles) {
|
|
||||||
sourceFileToCurrentFqNameMap[File(sourceFile.getVirtualFile()!!.getPath())] = sourceFile.getPackageFqName()
|
|
||||||
}
|
|
||||||
|
|
||||||
val result = HashSet<JvmClassName>()
|
|
||||||
|
|
||||||
packageSourcesData.processKeysWithExistingMapping { key ->
|
packageSourcesData.processKeysWithExistingMapping { key ->
|
||||||
if (key!!.startsWith(moduleId + File.pathSeparator)) {
|
if (key!!.startsWith(moduleId + File.pathSeparator)) {
|
||||||
val indexOf = key.indexOf(File.pathSeparator)
|
val indexOf = key.indexOf(File.pathSeparator)
|
||||||
val sourceFile = File(key.substring(indexOf + 1))
|
val sourceFile = File(key.substring(indexOf + 1))
|
||||||
|
|
||||||
val packagePartClassName = JvmClassName.byInternalName(packageSourcesData[key]!!)
|
val packagePartClassName = packageSourcesData[key]!!
|
||||||
if (!sourceFile.exists()) {
|
if (!sourceFile.exists()) {
|
||||||
result.add(packagePartClassName)
|
result.add(packagePartClassName)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val previousPackageFqName = packagePartClassName.getFqNameForClassNameWithoutDollars().parent()
|
val previousPackageFqName = JvmClassName.byInternalName(packagePartClassName).getFqNameForClassNameWithoutDollars().parent()
|
||||||
val currentPackageFqName = sourceFileToCurrentFqNameMap[sourceFile]
|
val currentPackageFqName = compiledSourceFilesToFqName[sourceFile]
|
||||||
if (currentPackageFqName != null && currentPackageFqName != previousPackageFqName) {
|
if (currentPackageFqName != null && currentPackageFqName != previousPackageFqName.asString()) {
|
||||||
result.add(packagePartClassName)
|
result.add(packagePartClassName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,8 +195,8 @@ public class IncrementalCacheImpl(baseDir: File): IncrementalCache {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun getPackageData(moduleId: String, fqName: FqName): ByteArray? {
|
public override fun getPackageData(moduleId: String, fqName: String): ByteArray? {
|
||||||
return protoData[ClassOrPackageId(moduleId, fqName)]
|
return protoData[ClassOrPackageId(moduleId, FqName(fqName))]
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun close() {
|
public fun close() {
|
||||||
|
|||||||
Reference in New Issue
Block a user