Revert External project storage — append postfix @maven to store maven module data

This reverts commit 2e4f94e68a

because no easy way to fix JPS for now
This commit is contained in:
Vladimir Krivosheev
2017-06-29 12:28:01 +02:00
parent e58205dd46
commit c612903b6a
2 changed files with 3 additions and 9 deletions
@@ -22,7 +22,6 @@ import com.intellij.configurationStore.XmlElementStorage
import com.intellij.openapi.components.RoamingType
import com.intellij.openapi.components.StateSplitterEx
import com.intellij.openapi.components.StoragePathMacros
import com.intellij.openapi.externalSystem.ExternalSystemModulePropertyManager
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.JDOMUtil
@@ -36,16 +35,11 @@ internal class ExternalModuleStorage(private val module: Module, storageManager:
override fun createSaveSession(states: StateMap) = object : XmlElementStorageSaveSession<ExternalModuleStorage>(states, this) {
override fun saveLocally(element: Element?) {
// our customizeStorageSpecs on write will not return our storage for not applicable module, so, we don't need to check it here
var name = module.name
if (ExternalSystemModulePropertyManager.getInstance(module).isMavenized()) {
// to distinguish because one project can contain modules from different external systems
name += "@maven"
}
if (element == null) {
manager.moduleStorage.remove(name)
manager.moduleStorage.remove(module.name)
}
else {
manager.moduleStorage.write(name, element)
manager.moduleStorage.write(module.name, element)
}
}
}
@@ -82,7 +82,7 @@ class ExternalSystemStorageTest {
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4" />""")
assertThat(cacheDir.resolve("test@maven.xml")).isEqualTo("""
assertThat(cacheDir.resolve("test.xml")).isEqualTo("""
<module>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />