Get rid of reflection in new project wizard core: manually specify properties in plugins
This commit is contained in:
committed by
Kirill Shmakov
parent
cc35529b9a
commit
63e2d771b3
+2
-2
@@ -32,7 +32,7 @@ class YamlWizard(
|
||||
|
||||
context.writeSettings {
|
||||
settingsValuesFromYaml.forEach { (reference, value) -> reference.setValue(value) }
|
||||
StructurePlugin::projectPath.reference.setValue(projectPath)
|
||||
StructurePlugin.projectPath.reference.setValue(projectPath)
|
||||
}
|
||||
|
||||
super.apply(services, phases, onTaskExecuting)
|
||||
@@ -49,7 +49,7 @@ fun Reader.parseYaml(
|
||||
yaml: String,
|
||||
pluginSettings: List<PluginSetting<*, *>>
|
||||
): TaskResult<Map<SettingReference<*, *>, Any>> {
|
||||
val parsingData = ParsingState(TemplatesPlugin::templates.propertyValue, emptyMap())
|
||||
val parsingData = ParsingState(TemplatesPlugin.templates.propertyValue, emptyMap())
|
||||
val yamlParser = YamlSettingsParser(pluginSettings, parsingData)
|
||||
return yamlParser.parseYamlText(yaml)
|
||||
}
|
||||
|
||||
+5
-5
@@ -43,11 +43,11 @@ class ProjectTemplateBasedTestWizard(
|
||||
super.apply(services, setOf(GenerationPhase.PREPARE), onTaskExecuting).ensure()
|
||||
context.writeSettings {
|
||||
applyProjectTemplate(projectTemplate)
|
||||
BuildSystemPlugin::type.reference.setValue(buildSystem.buildSystemType)
|
||||
StructurePlugin::projectPath.reference.setValue(projectDirectory)
|
||||
StructurePlugin::name.reference.setValue(projectTemplate.id)
|
||||
StructurePlugin::groupId.reference.setValue(GROUP_ID)
|
||||
StructurePlugin::artifactId.reference.setValue(ARTIFACT_ID)
|
||||
BuildSystemPlugin.type.reference.setValue(buildSystem.buildSystemType)
|
||||
StructurePlugin.projectPath.reference.setValue(projectDirectory)
|
||||
StructurePlugin.name.reference.setValue(projectTemplate.id)
|
||||
StructurePlugin.groupId.reference.setValue(GROUP_ID)
|
||||
StructurePlugin.artifactId.reference.setValue(ARTIFACT_ID)
|
||||
}
|
||||
applyAdditionalSettingsFromYaml().ensure()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user