Removed storing module ids in incremental caches.
This commit is contained in:
+1
-2
@@ -333,8 +333,7 @@ public class KotlinToJVMBytecodeCompiler {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IncrementalCache incrementalCache = incrementalCacheProvider.getIncrementalCache(moduleId);
|
IncrementalCache incrementalCache = incrementalCacheProvider.getIncrementalCache(moduleId);
|
||||||
packagesWithRemovedFiles = IncrementalPackage.getPackagesWithRemovedFiles(
|
packagesWithRemovedFiles = IncrementalPackage.getPackagesWithRemovedFiles(incrementalCache, environment.getSourceFiles());
|
||||||
incrementalCache, moduleId, environment.getSourceFiles());
|
|
||||||
}
|
}
|
||||||
BindingTraceContext diagnosticHolder = new BindingTraceContext();
|
BindingTraceContext diagnosticHolder = new BindingTraceContext();
|
||||||
GenerationState generationState = new GenerationState(
|
GenerationState generationState = new GenerationState(
|
||||||
|
|||||||
+6
-6
@@ -23,19 +23,19 @@ import org.jetbrains.jet.lang.resolve.java.JvmClassName
|
|||||||
import java.util.HashMap
|
import java.util.HashMap
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
public fun IncrementalCache.getPackagesWithRemovedFiles(moduleId: String, compiledSourceFiles: Collection<JetFile>): Collection<FqName> {
|
public fun IncrementalCache.getPackagesWithRemovedFiles(compiledSourceFiles: Collection<JetFile>): Collection<FqName> {
|
||||||
return getRemovedPackageParts(moduleId, compiledSourceFiles).map { it.getFqNameForClassNameWithoutDollars().parent() }
|
return getRemovedPackageParts(compiledSourceFiles).map { it.getFqNameForClassNameWithoutDollars().parent() }
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun IncrementalCache.getRemovedPackageParts(moduleId: String, compiledSourceFiles: Collection<JetFile>): Collection<JvmClassName> {
|
public fun IncrementalCache.getRemovedPackageParts(compiledSourceFiles: Collection<JetFile>): Collection<JvmClassName> {
|
||||||
val compiledSourceFilesToFqName = HashMap<File, String>()
|
val compiledSourceFilesToFqName = HashMap<File, String>()
|
||||||
for (sourceFile in compiledSourceFiles) {
|
for (sourceFile in compiledSourceFiles) {
|
||||||
compiledSourceFilesToFqName[File(sourceFile.getVirtualFile()!!.getPath())] = sourceFile.getPackageFqName().asString()
|
compiledSourceFilesToFqName[File(sourceFile.getVirtualFile()!!.getPath())] = sourceFile.getPackageFqName().asString()
|
||||||
}
|
}
|
||||||
|
|
||||||
return getRemovedPackageParts(moduleId, compiledSourceFilesToFqName).map { JvmClassName.byInternalName(it) }
|
return getRemovedPackageParts(compiledSourceFilesToFqName).map { JvmClassName.byInternalName(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun IncrementalCache.getPackageData(moduleId: String, fqName: FqName): ByteArray? {
|
public fun IncrementalCache.getPackageData(fqName: FqName): ByteArray? {
|
||||||
return getPackageData(moduleId, fqName.asString())
|
return getPackageData(fqName.asString())
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -52,7 +52,7 @@ public class IncrementalPackageFragmentProvider(
|
|||||||
|
|
||||||
val packagePartsToNotLoadFromCache = (
|
val packagePartsToNotLoadFromCache = (
|
||||||
sourceFiles.map { PackagePartClassUtils.getPackagePartInternalName(it) }
|
sourceFiles.map { PackagePartClassUtils.getPackagePartInternalName(it) }
|
||||||
+ incrementalCache.getRemovedPackageParts(moduleId, sourceFiles).map { it.getInternalName() }
|
+ incrementalCache.getRemovedPackageParts(sourceFiles).map { it.getInternalName() }
|
||||||
).toSet()
|
).toSet()
|
||||||
val fqNameToSubFqNames = MultiMap<FqName, FqName>()
|
val fqNameToSubFqNames = MultiMap<FqName, FqName>()
|
||||||
val fqNameToPackageFragment = HashMap<FqName, PackageFragmentDescriptor>()
|
val fqNameToPackageFragment = HashMap<FqName, PackageFragmentDescriptor>()
|
||||||
@@ -76,7 +76,7 @@ public class IncrementalPackageFragmentProvider(
|
|||||||
createPackageFragment(source.getPackageFqName())
|
createPackageFragment(source.getPackageFqName())
|
||||||
}
|
}
|
||||||
|
|
||||||
for (fqName in incrementalCache.getPackagesWithRemovedFiles(moduleId, sourceFiles)) {
|
for (fqName in incrementalCache.getPackagesWithRemovedFiles(sourceFiles)) {
|
||||||
createPackageFragment(fqName)
|
createPackageFragment(fqName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ public class IncrementalPackageFragmentProvider(
|
|||||||
get() = this@IncrementalPackageFragmentProvider.moduleId
|
get() = this@IncrementalPackageFragmentProvider.moduleId
|
||||||
|
|
||||||
val _memberScope: NotNullLazyValue<JetScope> = storageManager.createLazyValue {
|
val _memberScope: NotNullLazyValue<JetScope> = storageManager.createLazyValue {
|
||||||
val packageDataBytes = incrementalCache.getPackageData(moduleId, fqName)
|
val packageDataBytes = incrementalCache.getPackageData(fqName)
|
||||||
if (packageDataBytes == null) {
|
if (packageDataBytes == null) {
|
||||||
JetScope.EMPTY
|
JetScope.EMPTY
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -23,9 +23,9 @@ import java.util.HashMap
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
public trait IncrementalCache {
|
public trait IncrementalCache {
|
||||||
public fun getRemovedPackageParts(moduleId: String, compiledSourceFilesToFqName: Map<File, String>): Collection<String>
|
public fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String>
|
||||||
|
|
||||||
public fun getPackageData(moduleId: String, fqName: String): ByteArray?
|
public fun getPackageData(fqName: String): ByteArray?
|
||||||
|
|
||||||
public fun close()
|
public fun close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,17 +221,8 @@ public class KotlinBuilder extends ModuleLevelBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (ModuleBuildTarget target : chunk.getTargets()) {
|
for (ModuleBuildTarget target : chunk.getTargets()) {
|
||||||
String targetId = target.getId();
|
incrementalCaches.get(target).clearCacheForRemovedFiles(
|
||||||
|
KotlinSourceFileCollector.getRemovedKotlinFiles(dirtyFilesHolder, target), target.getOutputDir());
|
||||||
List<File> removedFiles = ContainerUtil.map(KotlinSourceFileCollector.getRemovedKotlinFiles(dirtyFilesHolder, target),
|
|
||||||
new Function<String, File>() {
|
|
||||||
@Override
|
|
||||||
public File fun(String s) {
|
|
||||||
return new File(s);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
incrementalCaches.get(target).clearCacheForRemovedFiles(targetId, removedFiles, target.getOutputDir());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IncrementalCacheImpl.RecompilationDecision recompilationDecision = IncrementalCacheImpl.RecompilationDecision.DO_NOTHING;
|
IncrementalCacheImpl.RecompilationDecision recompilationDecision = IncrementalCacheImpl.RecompilationDecision.DO_NOTHING;
|
||||||
@@ -250,8 +241,7 @@ public class KotlinBuilder extends ModuleLevelBuilder {
|
|||||||
File outputFile = outputItem.getOutputFile();
|
File outputFile = outputItem.getOutputFile();
|
||||||
|
|
||||||
if (IncrementalCompilation.ENABLED) {
|
if (IncrementalCompilation.ENABLED) {
|
||||||
IncrementalCacheImpl.RecompilationDecision newDecision =
|
IncrementalCacheImpl.RecompilationDecision newDecision = incrementalCaches.get(target).saveFileToCache(sourceFiles, outputFile);
|
||||||
incrementalCaches.get(target).saveFileToCache(target.getId(), sourceFiles, outputFile);
|
|
||||||
recompilationDecision = recompilationDecision.merge(newDecision);
|
recompilationDecision = recompilationDecision.merge(newDecision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
|
|
||||||
private val maps = listOf(protoMap, constantsMap, inlineFunctionsMap, packagePartMap)
|
private val maps = listOf(protoMap, constantsMap, inlineFunctionsMap, packagePartMap)
|
||||||
|
|
||||||
public fun saveFileToCache(moduleId: String, sourceFiles: Collection<File>, classFile: File): RecompilationDecision {
|
public fun saveFileToCache(sourceFiles: Collection<File>, classFile: File): RecompilationDecision {
|
||||||
val fileBytes = classFile.readBytes()
|
val fileBytes = classFile.readBytes()
|
||||||
val classNameAndHeader = VirtualFileKotlinClass.readClassNameAndHeader(fileBytes)
|
val classNameAndHeader = VirtualFileKotlinClass.readClassNameAndHeader(fileBytes)
|
||||||
if (classNameAndHeader == null) return DO_NOTHING
|
if (classNameAndHeader == null) return DO_NOTHING
|
||||||
@@ -72,12 +72,12 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
val data = BitEncoding.decodeBytes(annotationDataEncoded)
|
val data = BitEncoding.decodeBytes(annotationDataEncoded)
|
||||||
when (header.kind) {
|
when (header.kind) {
|
||||||
KotlinClassHeader.Kind.PACKAGE_FACADE -> {
|
KotlinClassHeader.Kind.PACKAGE_FACADE -> {
|
||||||
return if (protoMap.put(moduleId, className, data)) COMPILE_OTHERS else DO_NOTHING
|
return if (protoMap.put(className, data)) COMPILE_OTHERS else DO_NOTHING
|
||||||
}
|
}
|
||||||
KotlinClassHeader.Kind.CLASS -> {
|
KotlinClassHeader.Kind.CLASS -> {
|
||||||
val inlinesChanged = inlineFunctionsMap.process(moduleId, className, fileBytes)
|
val inlinesChanged = inlineFunctionsMap.process(className, fileBytes)
|
||||||
val protoChanged = protoMap.put(moduleId, className, data)
|
val protoChanged = protoMap.put(className, data)
|
||||||
val constantsChanged = constantsMap.process(moduleId, className, fileBytes)
|
val constantsChanged = constantsMap.process(className, fileBytes)
|
||||||
|
|
||||||
return if (inlinesChanged) RECOMPILE_ALL else if (protoChanged || constantsChanged) COMPILE_OTHERS else DO_NOTHING
|
return if (inlinesChanged) RECOMPILE_ALL else if (protoChanged || constantsChanged) COMPILE_OTHERS else DO_NOTHING
|
||||||
}
|
}
|
||||||
@@ -88,31 +88,29 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
}
|
}
|
||||||
if (header.syntheticClassKind == JvmAnnotationNames.KotlinSyntheticClass.Kind.PACKAGE_PART) {
|
if (header.syntheticClassKind == JvmAnnotationNames.KotlinSyntheticClass.Kind.PACKAGE_PART) {
|
||||||
assert(sourceFiles.size == 1) { "Package part from several source files: $sourceFiles" }
|
assert(sourceFiles.size == 1) { "Package part from several source files: $sourceFiles" }
|
||||||
packagePartMap.putPackagePartSourceData(moduleId, sourceFiles.first(), className)
|
packagePartMap.putPackagePartSourceData(sourceFiles.first(), className)
|
||||||
val inlinesChanged = inlineFunctionsMap.process(moduleId, className, fileBytes)
|
val inlinesChanged = inlineFunctionsMap.process(className, fileBytes)
|
||||||
val constantsChanged = constantsMap.process(moduleId, className, fileBytes)
|
val constantsChanged = constantsMap.process(className, fileBytes)
|
||||||
return if (inlinesChanged) RECOMPILE_ALL else if (constantsChanged) COMPILE_OTHERS else DO_NOTHING
|
return if (inlinesChanged) RECOMPILE_ALL else if (constantsChanged) COMPILE_OTHERS else DO_NOTHING
|
||||||
}
|
}
|
||||||
|
|
||||||
return DO_NOTHING
|
return DO_NOTHING
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun clearCacheForRemovedFiles(moduleId: String, removedSourceFiles: Collection<File>, outDirectory: File) {
|
public fun clearCacheForRemovedFiles(removedSourceFiles: Collection<String>, outDirectory: File) {
|
||||||
for (removedSourceFile in removedSourceFiles) {
|
removedSourceFiles.forEach { packagePartMap.remove(it) }
|
||||||
packagePartMap.remove(moduleId, removedSourceFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
inlineFunctionsMap.clearOutdated(outDirectory)
|
inlineFunctionsMap.clearOutdated(outDirectory)
|
||||||
constantsMap.clearOutdated(outDirectory)
|
constantsMap.clearOutdated(outDirectory)
|
||||||
protoMap.clearOutdated(outDirectory)
|
protoMap.clearOutdated(outDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun getRemovedPackageParts(moduleId: String, compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
public override fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
||||||
return packagePartMap.getRemovedPackageParts(moduleId, compiledSourceFilesToFqName)
|
return packagePartMap.getRemovedPackageParts(compiledSourceFilesToFqName)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun getPackageData(moduleId: String, fqName: String): ByteArray? {
|
public override fun getPackageData(fqName: String): ByteArray? {
|
||||||
return protoMap[moduleId, JvmClassName.byFqNameWithoutInnerClasses(PackageClassUtils.getPackageClassFqName(FqName(fqName)))]
|
return protoMap[JvmClassName.byFqNameWithoutInnerClasses(PackageClassUtils.getPackageClassFqName(FqName(fqName)))]
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun flush(memoryCachesOnly: Boolean) {
|
override fun flush(memoryCachesOnly: Boolean) {
|
||||||
@@ -164,21 +162,13 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
}
|
}
|
||||||
|
|
||||||
private abstract class ClassFileBasedMap<V>: BasicMap<V>() {
|
private abstract class ClassFileBasedMap<V>: BasicMap<V>() {
|
||||||
protected fun getKeyString(moduleId: String, className: JvmClassName): String {
|
|
||||||
return moduleId + ":" + className.getInternalName()
|
|
||||||
}
|
|
||||||
|
|
||||||
protected fun parseKeyString(key: String): Pair<String, JvmClassName> {
|
|
||||||
val colon = key.lastIndexOf(":")
|
|
||||||
return Pair(key.substring(0, colon), JvmClassName.byInternalName(key.substring(colon + 1)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO may be too expensive, because it traverses all files in out directory
|
// TODO may be too expensive, because it traverses all files in out directory
|
||||||
public fun clearOutdated(outDirectory: File) {
|
public fun clearOutdated(outDirectory: File) {
|
||||||
val keysToRemove = HashSet<String>()
|
val keysToRemove = HashSet<String>()
|
||||||
|
|
||||||
map.processKeysWithExistingMapping { key ->
|
map.processKeysWithExistingMapping { key ->
|
||||||
val (moduleId, className) = parseKeyString(key!!)
|
val className = JvmClassName.byInternalName(key!!)
|
||||||
val classFile = File(outDirectory, FileUtil.toSystemDependentName(className.getInternalName()) + ".class")
|
val classFile = File(outDirectory, FileUtil.toSystemDependentName(className.getInternalName()) + ".class")
|
||||||
if (!classFile.exists()) {
|
if (!classFile.exists()) {
|
||||||
keysToRemove.add(key)
|
keysToRemove.add(key)
|
||||||
@@ -200,8 +190,8 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
ByteArrayExternalizer
|
ByteArrayExternalizer
|
||||||
)
|
)
|
||||||
|
|
||||||
public fun put(moduleId: String, className: JvmClassName, data: ByteArray): Boolean {
|
public fun put(className: JvmClassName, data: ByteArray): Boolean {
|
||||||
val key = getKeyString(moduleId, className)
|
val key = className.getInternalName()
|
||||||
val oldData = map[key]
|
val oldData = map[key]
|
||||||
if (Arrays.equals(data, oldData)) {
|
if (Arrays.equals(data, oldData)) {
|
||||||
return false
|
return false
|
||||||
@@ -210,8 +200,8 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun get(moduleId: String, className: JvmClassName): ByteArray? {
|
public fun get(className: JvmClassName): ByteArray? {
|
||||||
return map[getKeyString(moduleId, className)]
|
return map[className.getInternalName()]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,12 +228,12 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun process(moduleId: String, className: JvmClassName, bytes: ByteArray): Boolean {
|
public fun process(className: JvmClassName, bytes: ByteArray): Boolean {
|
||||||
return put(moduleId, className, getConstantsMap(bytes))
|
return put(className, getConstantsMap(bytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun put(moduleId: String, className: JvmClassName, constantsMap: Map<String, Any>): Boolean {
|
private fun put(className: JvmClassName, constantsMap: Map<String, Any>): Boolean {
|
||||||
val key = getKeyString(moduleId, className)
|
val key = className.getInternalName()
|
||||||
|
|
||||||
val oldMap = map[key]
|
val oldMap = map[key]
|
||||||
if (oldMap == constantsMap) {
|
if (oldMap == constantsMap) {
|
||||||
@@ -351,12 +341,12 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
return if (result.isEmpty()) null else result
|
return if (result.isEmpty()) null else result
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun process(moduleId: String, className: JvmClassName, bytes: ByteArray): Boolean {
|
public fun process(className: JvmClassName, bytes: ByteArray): Boolean {
|
||||||
return put(moduleId, className, getInlineFunctionsMap(bytes))
|
return put(className, getInlineFunctionsMap(bytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun put(moduleId: String, className: JvmClassName, inlineFunctionsMap: Map<String, Long>?): Boolean {
|
private fun put(className: JvmClassName, inlineFunctionsMap: Map<String, Long>?): Boolean {
|
||||||
val key = getKeyString(moduleId, className)
|
val key = className.getInternalName()
|
||||||
|
|
||||||
val oldMap = map[key]
|
val oldMap = map[key]
|
||||||
if (oldMap == inlineFunctionsMap) {
|
if (oldMap == inlineFunctionsMap) {
|
||||||
@@ -396,43 +386,37 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
|
|
||||||
|
|
||||||
private inner class PackagePartMap: BasicMap<String>() {
|
private inner class PackagePartMap: BasicMap<String>() {
|
||||||
// Format of serialization to string: <module id> <path separator> <source file path> --> <package part JVM internal name>
|
// Format of serialization to string: <source file path> --> <package part JVM internal name>
|
||||||
override fun createMap(): PersistentHashMap<String, String> = PersistentHashMap(
|
override fun createMap(): PersistentHashMap<String, String> = PersistentHashMap(
|
||||||
File(baseDir, PACKAGE_PARTS),
|
File(baseDir, PACKAGE_PARTS),
|
||||||
EnumeratorStringDescriptor(),
|
EnumeratorStringDescriptor(),
|
||||||
EnumeratorStringDescriptor()
|
EnumeratorStringDescriptor()
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun getKey(moduleId: String, sourceFile: File): String {
|
public fun putPackagePartSourceData(sourceFile: File, className: JvmClassName) {
|
||||||
return moduleId + File.pathSeparator + sourceFile.getAbsolutePath()
|
map.put(sourceFile.getAbsolutePath(), className.getInternalName())
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun putPackagePartSourceData(moduleId: String, sourceFile: File, className: JvmClassName) {
|
public fun remove(sourceFile: String) {
|
||||||
map.put(getKey(moduleId, sourceFile), className.getInternalName())
|
map.remove(sourceFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun remove(moduleId: String, sourceFile: File) {
|
public fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
||||||
map.remove(getKey(moduleId, sourceFile))
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun getRemovedPackageParts(moduleId: String, compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
|
||||||
val result = HashSet<String>()
|
val result = HashSet<String>()
|
||||||
|
|
||||||
map.processKeysWithExistingMapping { key ->
|
map.processKeysWithExistingMapping { key ->
|
||||||
if (key!!.startsWith(moduleId + File.pathSeparator)) {
|
val sourceFile = File(key!!)
|
||||||
val sourceFile = File(key.substring(moduleId.length + 1))
|
|
||||||
|
|
||||||
val packagePartClassName = map[key]!!
|
val packagePartClassName = map[key]!!
|
||||||
if (!sourceFile.exists()) {
|
if (!sourceFile.exists()) {
|
||||||
|
result.add(packagePartClassName)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val previousPackageFqName = JvmClassName.byInternalName(packagePartClassName).getFqNameForClassNameWithoutDollars().parent()
|
||||||
|
val currentPackageFqName = compiledSourceFilesToFqName[sourceFile]
|
||||||
|
if (currentPackageFqName != null && currentPackageFqName != previousPackageFqName.asString()) {
|
||||||
result.add(packagePartClassName)
|
result.add(packagePartClassName)
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
val previousPackageFqName = JvmClassName.byInternalName(packagePartClassName).getFqNameForClassNameWithoutDollars().parent()
|
|
||||||
val currentPackageFqName = compiledSourceFilesToFqName[sourceFile]
|
|
||||||
if (currentPackageFqName != null && currentPackageFqName != previousPackageFqName.asString()) {
|
|
||||||
result.add(packagePartClassName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
@@ -441,17 +425,15 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun getModulesToPackages(): MultiMap<String, FqName> {
|
public fun getPackages(): Set<FqName> {
|
||||||
val result = MultiMap.createSet<String, FqName>()
|
val result = HashSet<FqName>()
|
||||||
|
|
||||||
map.processKeysWithExistingMapping { key ->
|
map.processKeysWithExistingMapping { key ->
|
||||||
val indexOf = key!!.indexOf(File.pathSeparator)
|
val packagePartClassName = map[key!!]!!
|
||||||
val moduleId = key.substring(0, indexOf)
|
|
||||||
val packagePartClassName = map[key]!!
|
|
||||||
|
|
||||||
val packageFqName = JvmClassName.byInternalName(packagePartClassName).getFqNameForClassNameWithoutDollars().parent()
|
val packageFqName = JvmClassName.byInternalName(packagePartClassName).getFqNameForClassNameWithoutDollars().parent()
|
||||||
|
|
||||||
result.putValue(moduleId, packageFqName)
|
result.add(packageFqName)
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user