We have two api for creating project:
- NewModuleBuilder/NewModuleBuilderProcessor
- ModuleImportProvider
While processing both of the require call commit methods for commit data, and all that must be in write thread.
Idea - create light/modifiable model for project/module. There no need dispose/commit them by default.
That looks like ExternalSystemAPI - but it's use original modifiable api, and commit per update ssesions for libraries/etc - and can provide ui thread multiple lag.
For example
ProjectBuilder project = ProjectBuilder.newDirBased(dir)
ModuleBuilder module = project.getRootModule();
module.withName(.....)
module.withEnabledExtension(JavaModuleExtension.class, ex -> {
})
ProjectCommitService.....commitAsync(project)
Artifact model can be changed without any issues -since they not provide index, and never change project model
We have two api for creating project:
While processing both of the require call commit methods for commit data, and all that must be in write thread.
Idea - create light/modifiable model for project/module. There no need dispose/commit them by default.
That looks like ExternalSystemAPI - but it's use original modifiable api, and commit per update ssesions for libraries/etc - and can provide ui thread multiple lag.
For example
Artifact model can be changed without any issues -since they not provide index, and never change project model