Fix tests
This commit is contained in:
committed by
Vyacheslav Gerasimov
parent
a4f28cd94f
commit
c153a386ab
@@ -62,6 +62,7 @@ import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.psi.stubs.BinaryFileStubBuilders
|
||||
import com.intellij.psi.util.JavaClassSupers
|
||||
import com.intellij.util.io.URLUtil
|
||||
import com.intellij.util.lang.UrlClassLoader
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import org.jetbrains.kotlin.asJava.LightClassGenerationSupport
|
||||
import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade
|
||||
@@ -526,7 +527,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
?: 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("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 (cp:\n ${(Thread.currentThread().contextClassLoader as? UrlClassLoader)?.urls?.joinToString("\n ") { it.file }})")
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginRoot, configFilePath, Extensions.getRootArea())
|
||||
}
|
||||
|
||||
+5
@@ -14,6 +14,11 @@
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-compiler</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-script-util</artifactId>
|
||||
|
||||
@@ -30,7 +30,7 @@ afterEvaluate {
|
||||
dependencies {
|
||||
compileOnly(intellijCoreJar())
|
||||
testCompile(intellijCoreJar())
|
||||
testCompile(intellij { include("idea.jar", "idea_rt.jar", "openapi.jar") })
|
||||
testCompile(intellij { include("idea.jar", "idea_rt.jar", "openapi.jar", "log4j.jar", "jdom.jar", "jps-model.jar") })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,10 +149,7 @@ val preparedResources = File(buildDir, "prepResources")
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {
|
||||
projectDefault()
|
||||
resources.srcDir(preparedResources)
|
||||
}
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
val ultimatePluginXmlContent: String by lazy {
|
||||
@@ -218,6 +215,7 @@ projectTest {
|
||||
dependsOn(preparePluginXml)
|
||||
workingDir = rootDir
|
||||
doFirst {
|
||||
classpath.add(files(preparedResources))
|
||||
systemProperty("spring.classpath", springClasspath.asPath)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user