All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jetbrains.plugin.structure.ide.layout.ModuleClasspathProvider.kt Maven / Gradle / Ivy

There is a newer version: 3.289
Show newest version
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()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy