Wizard: fix missing module templates
This commit is contained in:
+6
-1
@@ -3,6 +3,7 @@ package org.jetbrains.kotlin.tools.projectWizard.plugins.templates
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.Context
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.PluginSettingsOwner
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.entity.PipelineTask
|
||||
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.ConsoleJvmApplicationTemplate
|
||||
|
||||
class ConsoleJvmApplicationTemplatePlugin(context: Context) : TemplatePlugin(context) {
|
||||
@@ -13,6 +14,10 @@ class ConsoleJvmApplicationTemplatePlugin(context: Context) : TemplatePlugin(con
|
||||
companion object : PluginSettingsOwner() {
|
||||
override val pluginPath = "template.consoleJvmApplicationTemplate"
|
||||
|
||||
val addTemplate by addTemplateTask(ConsoleJvmApplicationTemplate())
|
||||
val addTemplate by pipelineTask(GenerationPhase.PREPARE) {
|
||||
withAction {
|
||||
TemplatesPlugin.addTemplate.execute(ConsoleJvmApplicationTemplate())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -3,6 +3,7 @@ package org.jetbrains.kotlin.tools.projectWizard.plugins.templates
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.Context
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.PluginSettingsOwner
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.entity.PipelineTask
|
||||
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.SimpleJsClientTemplate
|
||||
|
||||
class JsTemplatesPlugin(context: Context) : TemplatePlugin(context) {
|
||||
@@ -16,6 +17,10 @@ class JsTemplatesPlugin(context: Context) : TemplatePlugin(context) {
|
||||
companion object : PluginSettingsOwner() {
|
||||
override val pluginPath = "template.jsTemplates"
|
||||
|
||||
val addTemplate by addTemplateTask(SimpleJsClientTemplate())
|
||||
val addTemplate by pipelineTask(GenerationPhase.PREPARE) {
|
||||
withAction {
|
||||
TemplatesPlugin.addTemplate.execute(SimpleJsClientTemplate())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -3,6 +3,7 @@ package org.jetbrains.kotlin.tools.projectWizard.plugins.templates
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.Context
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.PluginSettingsOwner
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.entity.PipelineTask
|
||||
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.KtorServerTemplate
|
||||
|
||||
class KtorTemplatesPlugin(context: Context) : TemplatePlugin(context) {
|
||||
@@ -16,6 +17,10 @@ class KtorTemplatesPlugin(context: Context) : TemplatePlugin(context) {
|
||||
companion object: PluginSettingsOwner() {
|
||||
override val pluginPath = "template.ktorTemplates"
|
||||
|
||||
val addTemplate by addTemplateTask(KtorServerTemplate())
|
||||
val addTemplate by pipelineTask(GenerationPhase.PREPARE) {
|
||||
withAction {
|
||||
TemplatesPlugin.addTemplate.execute(KtorServerTemplate())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.tools.projectWizard.plugins.templates
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.Context
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.PluginSettingsOwner
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.entity.PipelineTask
|
||||
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.NativeConsoleApplicationTemplate
|
||||
|
||||
class NativeConsoleApplicationTemplatePlugin(context: Context) : TemplatePlugin(context) {
|
||||
@@ -21,6 +22,10 @@ class NativeConsoleApplicationTemplatePlugin(context: Context) : TemplatePlugin(
|
||||
companion object : PluginSettingsOwner() {
|
||||
override val pluginPath = "template.nativeConsoleApplicationTemplate"
|
||||
|
||||
val addTemplate by addTemplateTask( NativeConsoleApplicationTemplate())
|
||||
val addTemplate by pipelineTask(GenerationPhase.PREPARE) {
|
||||
withAction {
|
||||
TemplatesPlugin.addTemplate.execute(NativeConsoleApplicationTemplate())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-3
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.tools.projectWizard.plugins.templates
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.Context
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.PluginSettingsOwner
|
||||
import org.jetbrains.kotlin.tools.projectWizard.core.entity.PipelineTask
|
||||
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.KtorServerTemplate
|
||||
import org.jetbrains.kotlin.tools.projectWizard.templates.SimpleNodeJsTemplate
|
||||
|
||||
@@ -19,11 +20,13 @@ class SimpleNodeJsTemplatesPlugin(context: Context) : TemplatePlugin(context) {
|
||||
KtorTemplatesPlugin.addTemplate,
|
||||
)
|
||||
|
||||
val addTemplate by addTemplateTask(SimpleNodeJsTemplate())
|
||||
|
||||
companion object : PluginSettingsOwner() {
|
||||
override val pluginPath = "template.simpleNodeJs"
|
||||
|
||||
val addTemplate by addTemplateTask(KtorServerTemplate())
|
||||
val addTemplate by pipelineTask(GenerationPhase.PREPARE) {
|
||||
withAction {
|
||||
TemplatesPlugin.addTemplate.execute(SimpleNodeJsTemplate())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-6
@@ -18,11 +18,5 @@ abstract class TemplatePlugin(context: Context) : Plugin(context) {
|
||||
|
||||
companion object : PluginSettingsOwner() {
|
||||
override val pluginPath = "template"
|
||||
|
||||
fun addTemplateTask(template: Template) = pipelineTask(GenerationPhase.PREPARE) {
|
||||
withAction {
|
||||
TemplatesPlugin.addTemplate.execute(template)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user