[LL FIR] KT-55329 Rename refinementDependency to dependsOnDependency

- The new Kotlin MPP name for `refinementDependency` is
  `dependsOnDependency`.
This commit is contained in:
Marco Pennekamp
2022-12-19 21:35:16 +01:00
committed by teamcity
parent fa352fd20e
commit 7c96124a38
18 changed files with 62 additions and 63 deletions
@@ -71,7 +71,7 @@ internal class KtFe10SymbolContainingDeclarationProvider(
override val librarySources: KtLibrarySourceModule? = null
override fun getBinaryRoots(): Collection<Path> = listOf(libraryPath)
override val directRegularDependencies: List<KtModule> = emptyList()
override val directRefinementDependencies: List<KtModule> = emptyList()
override val directDependsOnDependencies: List<KtModule> = emptyList()
override val directFriendDependencies: List<KtModule> = emptyList()
override val contentScope: GlobalSearchScope = ProjectScope.getLibrariesScope(project)
override val platform: TargetPlatform
@@ -20,7 +20,7 @@ public class KtLibraryModuleBuilder : KtBinaryModuleBuilder() {
override fun build(): KtLibraryModule {
return KtLibraryModuleImpl(
directRegularDependencies,
directRefinementDependencies,
directDependsOnDependencies,
directFriendDependencies,
contentScope,
platform,
@@ -20,7 +20,7 @@ public class KtLibrarySourceModuleBuilder : KtModuleBuilder() {
override fun build(): KtLibrarySourceModule {
return KtLibrarySourceModuleImpl(
directRegularDependencies,
directRefinementDependencies,
directDependsOnDependencies,
directFriendDependencies,
contentScope,
platform,
@@ -13,15 +13,15 @@ import org.jetbrains.kotlin.platform.TargetPlatform
@KtModuleBuilderDsl
public abstract class KtModuleBuilder {
protected val directRegularDependencies: MutableList<KtModule> = mutableListOf()
protected val directRefinementDependencies: MutableList<KtModule> = mutableListOf()
protected val directDependsOnDependencies: MutableList<KtModule> = mutableListOf()
protected val directFriendDependencies: MutableList<KtModule> = mutableListOf()
public fun addRegularDependency(module: KtModule) {
directRegularDependencies.add(module)
}
public fun addRefinementDependency(module: KtModule) {
directRefinementDependencies.add(module)
public fun addDependsOnDependency(module: KtModule) {
directDependsOnDependencies.add(module)
}
public fun addFriendDependency(module: KtModule) {
@@ -18,7 +18,7 @@ public class KtSdkModuleBuilder : KtBinaryModuleBuilder() {
override fun build(): KtSdkModule {
return KtSdkModuleImpl(
directRegularDependencies,
directRefinementDependencies,
directDependsOnDependencies,
directFriendDependencies,
contentScope,
platform,
@@ -34,7 +34,7 @@ public class KtSourceModuleBuilder : KtModuleBuilder() {
override fun build(): KtSourceModule {
return KtSourceModuleImpl(
directRegularDependencies,
directRefinementDependencies,
directDependsOnDependencies,
directFriendDependencies,
contentScope,
platform,
@@ -16,7 +16,7 @@ import java.nio.file.Path
internal class KtLibraryModuleImpl(
override val directRegularDependencies: List<KtModule>,
override val directRefinementDependencies: List<KtModule>,
override val directDependsOnDependencies: List<KtModule>,
override val directFriendDependencies: List<KtModule>,
override val contentScope: GlobalSearchScope,
override val platform: TargetPlatform,
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
internal class KtLibrarySourceModuleImpl(
override val directRegularDependencies: List<KtModule>,
override val directRefinementDependencies: List<KtModule>,
override val directDependsOnDependencies: List<KtModule>,
override val directFriendDependencies: List<KtModule>,
override val contentScope: GlobalSearchScope,
override val platform: TargetPlatform,
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
internal class KtNotUnderContentRootModuleImpl(
override val name: String,
override val directRegularDependencies: List<KtModule> = emptyList(),
override val directRefinementDependencies: List<KtModule> = emptyList(),
override val directDependsOnDependencies: List<KtModule> = emptyList(),
override val directFriendDependencies: List<KtModule> = emptyList(),
override val platform: TargetPlatform = JvmPlatforms.defaultJvmPlatform,
override val file: PsiFile? = null,
@@ -15,7 +15,7 @@ import java.nio.file.Path
internal class KtSdkModuleImpl(
override val directRegularDependencies: List<KtModule>,
override val directRefinementDependencies: List<KtModule>,
override val directDependsOnDependencies: List<KtModule>,
override val directFriendDependencies: List<KtModule>,
override val contentScope: GlobalSearchScope,
override val platform: TargetPlatform,
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
internal class KtSourceModuleImpl(
override val directRegularDependencies: List<KtModule>,
override val directRefinementDependencies: List<KtModule>,
override val directDependsOnDependencies: List<KtModule>,
override val directFriendDependencies: List<KtModule>,
override val contentScope: GlobalSearchScope,
override val platform: TargetPlatform,
@@ -55,7 +55,7 @@ abstract class KtModuleByCompilerConfiguration(
}
}
val directRefinementDependencies: List<KtModule> by lazy(LazyThreadSafetyMode.PUBLICATION) {
val directDependsOnDependencies: List<KtModule> by lazy(LazyThreadSafetyMode.PUBLICATION) {
testModule.dependsOnDependencies
.map { moduleProvider.getModule(it.moduleName) }
}
@@ -139,7 +139,7 @@ private class LibraryByRoots(
) : KtLibraryModule {
override val libraryName: String get() = "Test Library"
override val directRegularDependencies: List<KtModule> get() = emptyList()
override val directRefinementDependencies: List<KtModule> get() = emptyList()
override val directDependsOnDependencies: List<KtModule> get() = emptyList()
override val directFriendDependencies: List<KtModule> get() = emptyList()
override val contentScope: GlobalSearchScope get() = ProjectScope.getLibrariesScope(project)
override val platform: TargetPlatform get() = module.platform
@@ -16,7 +16,7 @@ import java.nio.file.Path
interface KtModuleWithModifiableDependencies {
val directRegularDependencies: MutableList<KtModule>
val directRefinementDependencies: MutableList<KtModule>
val directDependsOnDependencies: MutableList<KtModule>
val directFriendDependencies: MutableList<KtModule>
}
@@ -30,7 +30,7 @@ class KtSourceModuleImpl(
override val analyzerServices: PlatformDependentAnalyzerServices get() = platform.getAnalyzerServices()
override val directRegularDependencies: MutableList<KtModule> = mutableListOf()
override val directRefinementDependencies: MutableList<KtModule> = mutableListOf()
override val directDependsOnDependencies: MutableList<KtModule> = mutableListOf()
override val directFriendDependencies: MutableList<KtModule> = mutableListOf()
}
@@ -47,7 +47,7 @@ class KtJdkModuleImpl(
override fun getBinaryRoots(): Collection<Path> = binaryRoots
override val directRegularDependencies: MutableList<KtModule> = mutableListOf()
override val directRefinementDependencies: MutableList<KtModule> = mutableListOf()
override val directDependsOnDependencies: MutableList<KtModule> = mutableListOf()
override val directFriendDependencies: MutableList<KtModule> = mutableListOf()
}
@@ -63,7 +63,7 @@ class KtLibraryModuleImpl(
override fun getBinaryRoots(): Collection<Path> = binaryRoots
override val directRegularDependencies: MutableList<KtModule> = mutableListOf()
override val directRefinementDependencies: MutableList<KtModule> = mutableListOf()
override val directDependsOnDependencies: MutableList<KtModule> = mutableListOf()
override val directFriendDependencies: MutableList<KtModule> = mutableListOf()
}
@@ -77,6 +77,6 @@ class KtLibrarySourceModuleImpl(
override val analyzerServices: PlatformDependentAnalyzerServices get() = platform.getAnalyzerServices()
override val directRegularDependencies: MutableList<KtModule> = mutableListOf()
override val directRefinementDependencies: MutableList<KtModule> = mutableListOf()
override val directDependsOnDependencies: MutableList<KtModule> = mutableListOf()
override val directFriendDependencies: MutableList<KtModule> = mutableListOf()
}
@@ -94,7 +94,7 @@ object TestModuleStructureFactory {
when (dependency.relation) {
DependencyRelation.RegularDependency -> ktModule.directRegularDependencies.add(dependencyKtModule)
DependencyRelation.FriendDependency -> ktModule.directFriendDependencies.add(dependencyKtModule)
DependencyRelation.DependsOnDependency -> ktModule.directRefinementDependencies.add(dependencyKtModule)
DependencyRelation.DependsOnDependency -> ktModule.directDependsOnDependencies.add(dependencyKtModule)
}
}
}
@@ -6,8 +6,8 @@
package org.jetbrains.kotlin.analysis.low.level.api.fir.project.structure
import org.jetbrains.kotlin.analysis.project.structure.KtModule
import org.jetbrains.kotlin.fir.FirModuleData
import org.jetbrains.kotlin.fir.FirElementWithResolvePhase
import org.jetbrains.kotlin.fir.FirModuleData
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.moduleData
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
@@ -40,7 +40,7 @@ class LLFirModuleData(
}
override val dependsOnDependencies: List<FirModuleData> by lazy(LazyThreadSafetyMode.PUBLICATION) {
ktModule.directRefinementDependencies.map(::LLFirModuleData)
ktModule.directDependsOnDependencies.map(::LLFirModuleData)
}
override val friendDependencies: List<FirModuleData> by lazy(LazyThreadSafetyMode.PUBLICATION) {
@@ -76,7 +76,7 @@ private class KtNotUnderContentRootModuleForTest(
listOf(builtinsModule)
}
override val directRefinementDependencies: List<KtModule>
override val directDependsOnDependencies: List<KtModule>
get() = emptyList()
override val directFriendDependencies: List<KtModule>
@@ -22,27 +22,27 @@ import java.nio.file.Path
*/
public sealed interface KtModule {
/**
* A list of Regular dependencies. Regular dependency allows current module to see symbols from dependent module.
* In a case for a source set, it can be other source set it depends on, library, or SDK.
* A list of Regular dependencies. Regular dependency allows the current module to see symbols from the dependent module. In the case
* of a source set, it can be either the source set it depends on, a library, or an SDK.
*
* The dependencies list is non-transitive and should not include current module.
* The dependencies list is non-transitive and should not include the current module.
*/
public val directRegularDependencies: List<KtModule>
/**
* Only for Kotlin MPP project.
* A list of Refinement dependencies.
* Refinement dependency express that the current module can provide actual declarations for expect declarations from dependent module,
* as well as see internal symbols of dependent module.
* A list of `dependsOn` dependencies. (Kotlin MPP projects only.)
*
* The dependencies list is non-transitive and should not include current module.
* A `dependsOn` dependency expresses that the current module can provide `actual` declarations for `expect` declarations from the
* dependent module, as well as see internal symbols of the dependent module.
*
* `dependsOn` dependencies are transitive, but the list is not a transitive closure. The list should not include the current module.
*/
public val directRefinementDependencies: List<KtModule>
public val directDependsOnDependencies: List<KtModule>
/**
* A list of Friend dependencies. Friend dependencies express that current module may see internal symbols of dependent module.
* A list of Friend dependencies. Friend dependencies express that the current module may see internal symbols of the dependent module.
*
* The dependencies list is non-transitive and should not include current module.
* The dependencies list is non-transitive and should not include the current module.
*/
public val directFriendDependencies: List<KtModule>
@@ -54,7 +54,7 @@ public sealed interface KtModule {
public val contentScope: GlobalSearchScope
/**
* A platform (e.g, JVM, JS, Native) current module represents.
* A platform (e.g, JVM, JS, Native) which the current module represents.
*
* @see [TargetPlatform]
*/
@@ -63,19 +63,20 @@ public sealed interface KtModule {
public val analyzerServices: PlatformDependentAnalyzerServices
/**
* [Project] to which module belongs.
* If current module depends on some other modules, all those modules should have the same [Project] as the current one.
* [Project] to which the current module belongs.
*
* If the current module depends on some other modules, all those modules should have the same [Project] as the current one.
*/
public val project: Project
/**
* Human-readable description of the module. E.g, "main sources of module 'analysis-api'"
* A human-readable description of the current module. E.g, "main sources of module 'analysis-api'".
*/
public val moduleDescription: String
}
/**
* A module which consists of a set of source declarations inside a projects.
* A module which consists of a set of source declarations inside a project.
*
* Generally, a main or test Source Set.
*/
@@ -97,8 +98,8 @@ public interface KtSourceModule : KtModule {
public sealed interface KtBinaryModule : KtModule {
/**
* A list of binary files which forms a binary module. It can be a list of JARs, KLIBs, folders with .class files.
* Should be consistent with [contentScope],
* so (pseudo-Kotlin) `
*
* It should be consistent with [contentScope], so (pseudo-Kotlin):
* ```
* library.contentScope.contains(file) <=> library.getBinaryRoots().listRecursively().contains(file)
* ```
@@ -107,7 +108,7 @@ public sealed interface KtBinaryModule : KtModule {
}
/**
* A module which represents a binary library. E.g, JAR or KLIB.
* A module which represents a binary library, e.g. JAR or KLIB.
*/
public interface KtLibraryModule : KtBinaryModule {
public val libraryName: String
@@ -122,7 +123,7 @@ public interface KtLibraryModule : KtBinaryModule {
}
/**
* A module which represent some SDK. E.g, Java JDK.
* A module which represent some SDK, e.g. Java JDK.
*/
public interface KtSdkModule : KtBinaryModule {
public val sdkName: String
@@ -132,14 +133,14 @@ public interface KtSdkModule : KtBinaryModule {
}
/**
* A sources for some [KtLibraryModule]
* Sources for some [KtLibraryModule].
*/
public interface KtLibrarySourceModule : KtModule {
public val libraryName: String
/**
* A library binary corresponding to the current library source.
* If current module is a source JAR, then [binaryLibrary] is corresponds to the binaries JAR.
* If the current module is a source JAR, then [binaryLibrary] corresponds to the binaries JAR.
*/
public val binaryLibrary: KtLibraryModule
@@ -148,8 +149,8 @@ public interface KtLibrarySourceModule : KtModule {
}
/**
* Module which contains kotlin [builtins](https://kotlinlang.org/spec/built-in-types-and-their-semantics.html) for specific platform
* Kotlin builtins are usually reside in the compiler, so [contentScope] and [getBinaryRoots] are empty
* A module which contains kotlin [builtins](https://kotlinlang.org/spec/built-in-types-and-their-semantics.html) for a specific platform.
* Kotlin builtins usually reside in the compiler, so [contentScope] and [getBinaryRoots] are empty.
*/
public class KtBuiltinsModule(
override val platform: TargetPlatform,
@@ -157,7 +158,7 @@ public class KtBuiltinsModule(
override val project: Project
) : KtBinaryModule {
override val directRegularDependencies: List<KtModule> get() = emptyList()
override val directRefinementDependencies: List<KtModule> get() = emptyList()
override val directDependsOnDependencies: List<KtModule> get() = emptyList()
override val directFriendDependencies: List<KtModule> get() = emptyList()
override val contentScope: GlobalSearchScope get() = GlobalSearchScope.EMPTY_SCOPE
override fun getBinaryRoots(): Collection<Path> = emptyList()
@@ -169,7 +170,7 @@ public class KtBuiltinsModule(
/**
* A set of sources which lives outside project content root. E.g, testdata files or source files of some other project.
* A set of sources which live outside the project content root. E.g, testdata files or source files of some other project.
*/
public interface KtNotUnderContentRootModule : KtModule {
/**
@@ -6,7 +6,7 @@
package org.jetbrains.kotlin.analysis.project.structure
/**
* A list of all modules current module can depend on with regular dependency
* A list of all modules that the current module can depend on with regular dependency.
*
* @see KtModule.directRegularDependencies
*/
@@ -14,7 +14,7 @@ public inline fun <reified M : KtModule> KtModule.directRegularDependenciesOfTyp
directRegularDependencies.asSequence().filterIsInstance<M>()
/**
* A list of all modules current module can depend on with friend dependency
* A list of all modules that the current module can depend on with friend dependency.
*
* @see KtModule.directFriendDependencies
*/
@@ -22,34 +22,32 @@ public inline fun <reified M : KtModule> KtModule.directFriendDependenciesOfType
directFriendDependencies.asSequence().filterIsInstance<M>()
/**
* A list of all modules current module can depend on with refinement dependency
* A list of all modules that the current module can depend on with refinement dependency.
*
* @see KtModule.directRefinementDependencies
* @see KtModule.directDependsOnDependencies
*/
public inline fun <reified M : KtModule> KtModule.directRefinementDependenciesOfType(): Sequence<M> =
directRefinementDependencies.asSequence().filterIsInstance<M>()
public inline fun <reified M : KtModule> KtModule.directDependsOnDependenciesOfType(): Sequence<M> =
directDependsOnDependencies.asSequence().filterIsInstance<M>()
/**
* A list of all other modules current module can depend on.
* A list of all other modules that the current module can depend on.
*
* @see KtModule.directRegularDependencies
* @see KtModule.directRefinementDependencies
* @see KtModule.directDependsOnDependencies
* @see KtModule.directFriendDependencies
*/
public fun KtModule.allDirectDependencies(): Sequence<KtModule> =
sequence {
yieldAll(directRegularDependencies)
yieldAll(directRefinementDependencies)
yieldAll(directDependsOnDependencies)
yieldAll(directFriendDependencies)
}
/**
* A list of all other modules of type [M] current module can depend on.
* A list of all other modules of type [M] that the current module can depend on.
*
* @see KtModule.directRegularDependencies
* @see KtModule.directRefinementDependencies
* @see KtModule.directDependsOnDependencies
* @see KtModule.directFriendDependencies
*/
public inline fun <reified M : KtModule> KtModule.allDirectDependenciesOfType(): Sequence<M> =