Get rid of reflection in new project wizard core: manually specify properties in plugins

This commit is contained in:
aleksandrina-streltsova
2020-07-22 13:56:41 +03:00
committed by Kirill Shmakov
parent cc35529b9a
commit 63e2d771b3
55 changed files with 998 additions and 1009 deletions
@@ -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)
}
@@ -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()