com.jetbrains.plugin.structure.ide.layout.ModuleClasspathProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of structure-ide Show documentation
Show all versions of structure-ide Show documentation
Library for resolving class files and resources of IntelliJ Platform IDEs.
package com.jetbrains.plugin.structure.ide.layout
import com.jetbrains.plugin.structure.intellij.platform.LayoutComponent
import com.jetbrains.plugin.structure.intellij.platform.ProductInfo
import java.nio.file.Path
fun interface ModuleClasspathProvider {
fun getClasspath(moduleName: String): List
}
class ProductInfoClasspathProvider(private val productInfo: ProductInfo) : ModuleClasspathProvider {
override fun getClasspath(moduleName: String): List {
return productInfo.layout
.find { it.name == moduleName && it is LayoutComponent.Classpathable }
?.let { it as LayoutComponent.Classpathable }
?.getClasspath()
?: emptyList()
}
}