Move META-INF/extensions/compiler.xml to module 'cli'
This commit is contained in:
@@ -76,14 +76,6 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jar: Jar by tasks
|
|
||||||
jar.apply {
|
|
||||||
from(the<JavaPluginConvention>().sourceSets.getByName("main").output)
|
|
||||||
from("../idea/src").apply {
|
|
||||||
include("META-INF/extensions/compiler.xml")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
|
|||||||
@@ -509,7 +509,6 @@ class KotlinCoreEnvironment private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun registerApplicationExtensionPointsAndExtensionsFrom(configuration: CompilerConfiguration, configFilePath: String) {
|
private fun registerApplicationExtensionPointsAndExtensionsFrom(configuration: CompilerConfiguration, configFilePath: String) {
|
||||||
|
|
||||||
fun File.hasConfigFile(configFile: String): Boolean =
|
fun File.hasConfigFile(configFile: String): Boolean =
|
||||||
if (isDirectory) File(this, "META-INF" + File.separator + configFile).exists()
|
if (isDirectory) File(this, "META-INF" + File.separator + configFile).exists()
|
||||||
else try {
|
else try {
|
||||||
@@ -524,9 +523,9 @@ class KotlinCoreEnvironment private constructor(
|
|||||||
val pluginRoot =
|
val pluginRoot =
|
||||||
configuration.get(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT)?.let(::File)
|
configuration.get(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT)?.let(::File)
|
||||||
?: configuration.get(CLIConfigurationKeys.COMPILER_JAR_LOCATOR)?.compilerJar
|
?: configuration.get(CLIConfigurationKeys.COMPILER_JAR_LOCATOR)?.compilerJar
|
||||||
?: PathUtil.pathUtilJar.takeIf { it.hasConfigFile(configFilePath) }
|
?: PathUtil.getResourcePathForClass(this::class.java).takeIf { it.hasConfigFile(configFilePath) }
|
||||||
// hack for load extensions when compiler run directly from project directory (e.g. in tests)
|
// hack for load extensions when compiler run directly from project directory (e.g. in tests)
|
||||||
?: File("idea/src").takeIf { it.hasConfigFile(configFilePath) }
|
?: File("compiler/cli/src").takeIf { it.hasConfigFile(configFilePath) }
|
||||||
?: throw IllegalStateException("Unable to find extension point configuration $configFilePath")
|
?: throw IllegalStateException("Unable to find extension point configuration $configFilePath")
|
||||||
|
|
||||||
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginRoot, configFilePath, Extensions.getRootArea())
|
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginRoot, configFilePath, Extensions.getRootArea())
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
|
|
||||||
apply { plugin("kotlin") }
|
apply { plugin("kotlin") }
|
||||||
@@ -107,6 +105,11 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val jar: Jar by tasks
|
||||||
|
jar.from("../compiler/cli/src") {
|
||||||
|
include("META-INF/extensions/compiler.xml")
|
||||||
|
}
|
||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
dependsOnTaskIfExistsRec("dist", project = rootProject)
|
dependsOnTaskIfExistsRec("dist", project = rootProject)
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
|
|||||||
Reference in New Issue
Block a user