mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not write unmodified template settings into project (regression after "write effective before run task")
create temporary RC in tests using production method
This commit is contained in:
@@ -135,7 +135,7 @@ abstract class RunManager {
|
||||
|
||||
/**
|
||||
* Creates a configuration settings object based on a specified [RunConfiguration]. Note that you need to call
|
||||
* [.addConfiguration] if you want the configuration to be persisted in the project.
|
||||
* [addConfiguration] if you want the configuration to be persisted in the project.
|
||||
* @param runConfiguration the run configuration
|
||||
* @param factory the factory instance.
|
||||
*/
|
||||
|
||||
@@ -237,23 +237,22 @@ open class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persi
|
||||
return lock.read { templateIdToConfiguration.get(key) } ?: lock.write {
|
||||
templateIdToConfiguration.getOrPut(key) {
|
||||
val template = createTemplateSettings(factory)
|
||||
val configuration = template.configuration
|
||||
(configuration as? UnknownRunConfiguration)?.let {
|
||||
it.isDoNotStore = true
|
||||
}
|
||||
|
||||
configuration.beforeRunTasks = getHardcodedBeforeRunTasks(configuration)
|
||||
|
||||
workspaceSchemeManager.addScheme(template)
|
||||
|
||||
template
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal fun createTemplateSettings(factory: ConfigurationFactory): RunnerAndConfigurationSettingsImpl {
|
||||
return RunnerAndConfigurationSettingsImpl(this, factory.createTemplateConfiguration(project, this), isTemplate = true,
|
||||
singleton = factory.isConfigurationSingletonByDefault)
|
||||
val configuration = factory.createTemplateConfiguration(project, this)
|
||||
val template = RunnerAndConfigurationSettingsImpl(this, configuration,
|
||||
isTemplate = true,
|
||||
singleton = factory.isConfigurationSingletonByDefault)
|
||||
if (configuration is UnknownRunConfiguration) {
|
||||
configuration.isDoNotStore = true
|
||||
}
|
||||
configuration.beforeRunTasks = getHardcodedBeforeRunTasks(configuration)
|
||||
return template
|
||||
}
|
||||
|
||||
override fun addConfiguration(settings: RunnerAndConfigurationSettings) {
|
||||
|
||||
Reference in New Issue
Block a user