[CLI] reduce memory usage for compiler settings

make write protection directly in properties
it creates no additional wrapper with the link to the containing class
for ij project, this reduces memory usage for ~15 mb

^KT-56351
This commit is contained in:
Anna Kozlova
2023-02-01 11:24:16 +01:00
committed by Space Team
parent 441c74e2c8
commit f784628ebf
9 changed files with 1160 additions and 252 deletions
@@ -20,11 +20,31 @@ import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.cli.common.arguments.Freezable
class CompilerSettings : Freezable() {
var additionalArguments: String by FreezableVar(DEFAULT_ADDITIONAL_ARGUMENTS)
var scriptTemplates: String by FreezableVar("")
var scriptTemplatesClasspath: String by FreezableVar("")
var copyJsLibraryFiles: Boolean by FreezableVar(true)
var outputDirectoryForJsLibraryFiles: String by FreezableVar(DEFAULT_OUTPUT_DIRECTORY)
var additionalArguments: String = DEFAULT_ADDITIONAL_ARGUMENTS
set(value) {
checkFrozen()
field = value
}
var scriptTemplates: String = ""
set(value) {
checkFrozen()
field = value
}
var scriptTemplatesClasspath: String = ""
set(value) {
checkFrozen()
field = value
}
var copyJsLibraryFiles = true
set(value) {
checkFrozen()
field = value
}
var outputDirectoryForJsLibraryFiles: String = DEFAULT_OUTPUT_DIRECTORY
set(value) {
checkFrozen()
field = value
}
companion object {
val DEFAULT_ADDITIONAL_ARGUMENTS = ""
@@ -9,5 +9,9 @@ import org.jetbrains.kotlin.cli.common.arguments.Freezable
class JpsPluginSettings : Freezable() {
@Suppress("unused") // Used in Kotlin plugin
var version: String by FreezableVar("") // KTIJ-20555 Fix default value?
var version: String = "" // KTIJ-20555 Fix default value?
set(value) {
checkFrozen()
field = value
}
}