Move META-INF/extensions/compiler.xml to module 'cli'

This commit is contained in:
Alexander Udalov
2017-12-08 13:53:42 +01:00
parent 02857dbfdb
commit 95f9884799
4 changed files with 7 additions and 13 deletions
-8
View File
@@ -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 {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
workingDir = rootDir
@@ -509,7 +509,6 @@ class KotlinCoreEnvironment private constructor(
}
private fun registerApplicationExtensionPointsAndExtensionsFrom(configuration: CompilerConfiguration, configFilePath: String) {
fun File.hasConfigFile(configFile: String): Boolean =
if (isDirectory) File(this, "META-INF" + File.separator + configFile).exists()
else try {
@@ -524,9 +523,9 @@ class KotlinCoreEnvironment private constructor(
val pluginRoot =
configuration.get(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT)?.let(::File)
?: 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)
?: File("idea/src").takeIf { it.hasConfigFile(configFilePath) }
?: File("compiler/cli/src").takeIf { it.hasConfigFile(configFilePath) }
?: throw IllegalStateException("Unable to find extension point configuration $configFilePath")
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginRoot, configFilePath, Extensions.getRootArea())
+5 -2
View File
@@ -1,5 +1,3 @@
import org.gradle.jvm.tasks.Jar
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 {
dependsOnTaskIfExistsRec("dist", project = rootProject)
workingDir = rootDir