[Analysis API Standalone] deduplicate binary roots for KtBinaryModuleBuilder
^KT-60884
This commit is contained in:
committed by
Space Team
parent
d459981974
commit
0416e0423f
+3
-1
@@ -9,7 +9,7 @@ import java.nio.file.Path
|
||||
|
||||
@KtModuleBuilderDsl
|
||||
public abstract class KtBinaryModuleBuilder : KtModuleBuilder() {
|
||||
protected val binaryRoots: MutableList<Path> = mutableListOf()
|
||||
private val binaryRoots: MutableList<Path> = mutableListOf()
|
||||
|
||||
public fun addBinaryRoot(root: Path) {
|
||||
binaryRoots.add(root)
|
||||
@@ -18,4 +18,6 @@ public abstract class KtBinaryModuleBuilder : KtModuleBuilder() {
|
||||
public fun addBinaryRoots(roots: Collection<Path>) {
|
||||
binaryRoots.addAll(roots)
|
||||
}
|
||||
|
||||
protected fun getBinaryRoots(): List<Path> = binaryRoots.distinct()
|
||||
}
|
||||
+1
@@ -22,6 +22,7 @@ public class KtLibraryModuleBuilder(
|
||||
public var librarySources: KtLibrarySourceModule? = null
|
||||
|
||||
override fun build(): KtLibraryModule {
|
||||
val binaryRoots = getBinaryRoots()
|
||||
val contentScope = StandaloneProjectFactory.createSearchScopeByLibraryRoots(binaryRoots, kotlinCoreProjectEnvironment)
|
||||
return KtLibraryModuleImpl(
|
||||
directRegularDependencies,
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ public class KtSdkModuleBuilder(
|
||||
}
|
||||
|
||||
override fun build(): KtSdkModule {
|
||||
val binaryRoots = getBinaryRoots()
|
||||
val contentScope = StandaloneProjectFactory.createSearchScopeByLibraryRoots(binaryRoots, kotlinCoreProjectEnvironment)
|
||||
|
||||
return KtSdkModuleImpl(
|
||||
|
||||
Reference in New Issue
Block a user