Build: Use fake ideaHome for tests with intellij build number only
#KTI-82
This commit is contained in:
committed by
teamcity
parent
516e54a434
commit
944c7990a1
@@ -113,4 +113,11 @@ object IntellijRootUtils {
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
|
||||
fun Project.ideaHomePathForTests() = rootProject.buildDir.resolve("ideaHomeForTests")
|
||||
|
||||
fun Project.ideaBuildNumberFileForTests() = File(ideaHomePathForTests(), "build.txt")
|
||||
|
||||
fun Project.writeIdeaBuildNumberForTests() {
|
||||
ideaHomePathForTests().mkdirs()
|
||||
ideaBuildNumberFileForTests().writeText("IC-${rootProject.extra["versions.intellijSdk"]}")
|
||||
}
|
||||
@@ -110,6 +110,8 @@ fun Project.projectTest(
|
||||
evaluationDependsOn(":test-instrumenter")
|
||||
}
|
||||
return getOrCreateTask<Test>(taskName) {
|
||||
dependsOn(":createIdeaHomeForTests")
|
||||
|
||||
doFirst {
|
||||
if (jUnitMode == JUnitMode.JUnit5) return@doFirst
|
||||
|
||||
@@ -177,7 +179,7 @@ fun Project.projectTest(
|
||||
|
||||
maxHeapSize = "1600m"
|
||||
systemProperty("idea.is.unit.test", "true")
|
||||
systemProperty("idea.home.path", project.intellijRootDir().canonicalPath)
|
||||
systemProperty("idea.home.path", project.ideaHomePathForTests().canonicalPath)
|
||||
systemProperty("java.awt.headless", "true")
|
||||
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
|
||||
environment("PROJECT_CLASSES_DIRS", project.testSourceSet.output.classesDirs.asPath)
|
||||
|
||||
Reference in New Issue
Block a user