From 8149af30b40263a20ecbd99bc7364eb736a9e902 Mon Sep 17 00:00:00 2001 From: EduardKrieger Date: Wed, 26 May 2021 20:23:03 +0200 Subject: [PATCH 1/4] added adaptTemplates for WikiRUnner --- runners/wikiConsole/index.ts | 6 ++++++ .../templates/adaptTemplates.asciidoc | 19 +++++++++++++++++++ .../templates/adaptTemplates.asciidoc | 11 +++++++++++ 3 files changed, 36 insertions(+) create mode 100644 runners/wikiConsole/templates/adaptTemplates.asciidoc create mode 100644 runners/wikiEclipse/templates/adaptTemplates.asciidoc diff --git a/runners/wikiConsole/index.ts b/runners/wikiConsole/index.ts index 07b0ff0d..54a712eb 100644 --- a/runners/wikiConsole/index.ts +++ b/runners/wikiConsole/index.ts @@ -126,5 +126,11 @@ export class WikiConsole extends WikiRunner { this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "createDevon4jProject.asciidoc"), { name: runCommand.command.parameters[0] }); return null; } + + runAdaptTemplatesCobiGen(runCOmannd: RunCommand): RunResult{ + let devonPath = path.relative(this.getWorkingDirectory(), this.getVariable(this.WORKSPACE_DIRECTORY)).replace(/\\/g, "/"); + this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "adaptTemplates.asciidoc"), {devonPath: devonPath}); + return null; + } } diff --git a/runners/wikiConsole/templates/adaptTemplates.asciidoc b/runners/wikiConsole/templates/adaptTemplates.asciidoc new file mode 100644 index 00000000..58bc1284 --- /dev/null +++ b/runners/wikiConsole/templates/adaptTemplates.asciidoc @@ -0,0 +1,19 @@ +== Generate CobiGen Templates +How to use CobiGen, to generate templates for the following code generation. +More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html. + +=== Prerequisites + +* An installed devonfw distribution is needed. To execute the CobiGen CLI, you have to install the devonfw IDE first. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw-ide] documentation to install the same. + +=== Generate CobiGen Templates with CobiGen CLI + +First open a command prompt in your current workspace. You should be inside your devonfw destribution, if not change your directory to *<%= devonPath;%>*. +Run the CobiGen command `devon cobigen adapt-templates` +to generate a new templates folder next to the CobiGen CLI and save its location in a configuration file. + +You can also spezify the location of the templates folder with the parameter `--custom-location` or `-cl` and pass the absolute path to your custom location. + + + + diff --git a/runners/wikiEclipse/templates/adaptTemplates.asciidoc b/runners/wikiEclipse/templates/adaptTemplates.asciidoc new file mode 100644 index 00000000..a79945ef --- /dev/null +++ b/runners/wikiEclipse/templates/adaptTemplates.asciidoc @@ -0,0 +1,11 @@ +== Generate new Templates for CobiGen +How to use CobiGen, to generate templates for the following code generation. +More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html. + +=== Prerequisites +An installed devonfw distribution is needed. To execute CobiGen in Eclipse IDE, you have to install the devonfw IDE with the Eclipse IDE first. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw-ide] documentation to install the same. + +=== Generate CobiGen Templates with Eclipse IDE + +First, open Eclipse IDE, and if your file explorer is empty load any file, create a file, or project into Eclipse. +Right-click any file in the file explorer to open a dropdown menu where you can select CobiGen and an additional menu opens. Select *Adapt Templates...* and CobiGen starts generating a new template folder. CobiGen gives you a warning that existing templates will be overridden in your current workspace, you can confirm to continue. If the folder is already existing CobiGen will inform you, to update your templates you have to use the *Update Templates...* functionality else CobiGen will create a folder and download the latest template to use it. You can confirm and the messages with *OK* or *Update* and the CobiGen templates folder is imported successfully. \ No newline at end of file From 16c2d4d97edc7535e8a81dcfcfdf4a7cbd255492 Mon Sep 17 00:00:00 2001 From: EduardKrieger Date: Fri, 28 May 2021 09:55:28 +0200 Subject: [PATCH 2/4] wiki completed --- runners/wikiConsole/index.ts | 2 +- runners/wikiEclipse/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runners/wikiConsole/index.ts b/runners/wikiConsole/index.ts index 54a712eb..290d0b14 100644 --- a/runners/wikiConsole/index.ts +++ b/runners/wikiConsole/index.ts @@ -127,7 +127,7 @@ export class WikiConsole extends WikiRunner { return null; } - runAdaptTemplatesCobiGen(runCOmannd: RunCommand): RunResult{ + runAdaptTemplatesCobiGen(runComannd: RunCommand): RunResult{ let devonPath = path.relative(this.getWorkingDirectory(), this.getVariable(this.WORKSPACE_DIRECTORY)).replace(/\\/g, "/"); this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "adaptTemplates.asciidoc"), {devonPath: devonPath}); return null; diff --git a/runners/wikiEclipse/index.ts b/runners/wikiEclipse/index.ts index ee0390e6..fe254d3f 100644 --- a/runners/wikiEclipse/index.ts +++ b/runners/wikiEclipse/index.ts @@ -45,4 +45,8 @@ export class WikiEclipse extends WikiRunner { this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "createDevon4jProject.asciidoc"), { name: runCommand.command.parameters[0]}); return null; } + runAdaptTemplatesCobiGen(runComannd: RunCommand): RunResult{ + this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "adaptTemplates.asciidoc"), {}); + return null; + } } \ No newline at end of file From 5217659c1dbe8c94d6983d41630f51d37ba30cc8 Mon Sep 17 00:00:00 2001 From: EduardKrieger Date: Fri, 28 May 2021 09:55:56 +0200 Subject: [PATCH 3/4] wiki completed --- runners/wikiEclipse/templates/adaptTemplates.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runners/wikiEclipse/templates/adaptTemplates.asciidoc b/runners/wikiEclipse/templates/adaptTemplates.asciidoc index a79945ef..84a6ffd3 100644 --- a/runners/wikiEclipse/templates/adaptTemplates.asciidoc +++ b/runners/wikiEclipse/templates/adaptTemplates.asciidoc @@ -8,4 +8,4 @@ An installed devonfw distribution is needed. To execute CobiGen in Eclipse IDE, === Generate CobiGen Templates with Eclipse IDE First, open Eclipse IDE, and if your file explorer is empty load any file, create a file, or project into Eclipse. -Right-click any file in the file explorer to open a dropdown menu where you can select CobiGen and an additional menu opens. Select *Adapt Templates...* and CobiGen starts generating a new template folder. CobiGen gives you a warning that existing templates will be overridden in your current workspace, you can confirm to continue. If the folder is already existing CobiGen will inform you, to update your templates you have to use the *Update Templates...* functionality else CobiGen will create a folder and download the latest template to use it. You can confirm and the messages with *OK* or *Update* and the CobiGen templates folder is imported successfully. \ No newline at end of file +Right-click any file in the file explorer to open a dropdown menu where you can select CobiGen and an additional menu opens. Select *Adapt Templates...* and CobiGen starts generating a new template folder. CobiGen gives you a warning that existing templates will be overridden in your current workspace, you can confirm to continue. If the folder is already existing CobiGen will inform you, that for updating your templates you have to use the *Update Templates...* functionality else CobiGen will create a folder and download the latest template to use it. You can confirm the messages with *OK* or *Update* and the CobiGen templates folder is imported successfully. \ No newline at end of file From 68447c77a8f236a6ad4733891e0927aa52ce09a9 Mon Sep 17 00:00:00 2001 From: EduardKrieger Date: Tue, 1 Jun 2021 08:27:15 +0200 Subject: [PATCH 4/4] fixed spelling --- runners/wikiConsole/templates/adaptTemplates.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runners/wikiConsole/templates/adaptTemplates.asciidoc b/runners/wikiConsole/templates/adaptTemplates.asciidoc index 58bc1284..d57429a3 100644 --- a/runners/wikiConsole/templates/adaptTemplates.asciidoc +++ b/runners/wikiConsole/templates/adaptTemplates.asciidoc @@ -4,11 +4,11 @@ More information about CobiGen on https://devonfw.com/website/pages/docs/master- === Prerequisites -* An installed devonfw distribution is needed. To execute the CobiGen CLI, you have to install the devonfw IDE first. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw-ide] documentation to install the same. +* An installed devonfw distribution is needed. To execute the CobiGen CLI, you have to install the devonfw IDE first. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw IDE] documentation to install the same. === Generate CobiGen Templates with CobiGen CLI -First open a command prompt in your current workspace. You should be inside your devonfw destribution, if not change your directory to *<%= devonPath;%>*. +First open a command prompt in your current workspace. You should be inside your devonfw directory, if not change your directory to *<%= devonPath;%>*. Run the CobiGen command `devon cobigen adapt-templates` to generate a new templates folder next to the CobiGen CLI and save its location in a configuration file.