Make KotlinCoreEnvironment.disposeApplicationEnvironment() public

The method disposeApplicationEnvironment should be used in Gradle
after the configuration phase. This allows not to recreate the compiler
environment after each kts file compilation and improve overall
performance the evaluation and configuration phases.
This commit is contained in:
Andrey Uskov
2020-09-11 14:36:06 +03:00
parent fca6436170
commit 175a8bec9d

View File

@@ -486,7 +486,10 @@ class KotlinCoreEnvironment private constructor(
}
}
private fun disposeApplicationEnvironment() {
/**
* This method is also used in Gradle after configuration phase finished.
*/
fun disposeApplicationEnvironment() {
synchronized(APPLICATION_LOCK) {
val environment = ourApplicationEnvironment ?: return
ourApplicationEnvironment = null