fun copyFromYAML()

in src/main/kotlin/org/arend/module/config/ArendModuleConfigService.kt [134:182]


    fun copyFromYAML(yaml: YAMLFile, update: Boolean) {
        val newDependencies = yaml.dependencies
        if (dependencies != newDependencies) {
            updateDependencies(newDependencies, update) {
                ModuleSynchronizer.synchronizeModule(this, false)
            }
        }

        modules = yaml.modules
        flaggedBinariesDir = yaml.binariesDir
        testsDir = yaml.testsDir
        val extDir = yaml.extensionsDir
        val extMain = yaml.extensionMainClass
        withExtensions = extDir != null && extMain != null
        if (extDir != null) {
            extensionsDirectory = extDir
        }
        if (extMain != null) {
            extensionMainClassData = extMain
        }
        sourcesDir = yaml.sourcesDir ?: ""
        versionString = yaml.version
        langVersionString = yaml.langVersion

        if (sourcesDir == binariesDirectory) {
            binariesDirectory = ""
            invokeLater {
                runUndoTransparentWriteAction {
                    yaml.binariesDir = ""
                }
            }
        }
        if (sourcesDir == testsDir) {
            testsDir = ""
            invokeLater {
                runUndoTransparentWriteAction {
                    yaml.testsDir = ""
                }
            }
        }
        if (binariesDirectory == testsDir) {
            testsDir = ""
            invokeLater {
                runUndoTransparentWriteAction {
                    yaml.testsDir = ""
                }
            }
        }
    }