Skip to content

Commit be5c211

Browse files
Merge pull request #262 from EduardKrieger/feature/wikiRunnerAdaptTemplatesCobiGen
feature/wikiRunnerAdaptTemplates
2 parents 3be3073 + 68447c7 commit be5c211

4 files changed

Lines changed: 41 additions & 0 deletions

File tree

runners/wikiConsole/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ export class WikiConsole extends WikiRunner {
135135
return null;
136136
}
137137

138+
runAdaptTemplatesCobiGen(runComannd: RunCommand): RunResult{
139+
let devonPath = path.relative(this.getWorkingDirectory(), this.getVariable(this.WORKSPACE_DIRECTORY)).replace(/\\/g, "/");
140+
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "adaptTemplates.asciidoc"), {devonPath: devonPath});
141+
return null;
142+
}
143+
138144
runNextKatacodaStep(runCommand: RunCommand): RunResult {
139145
let tempFile = path.join(this.getTempDirectory(), runCommand.command.name + ".md");
140146
fs.writeFileSync(tempFile, "");
@@ -153,6 +159,7 @@ export class WikiConsole extends WikiRunner {
153159

154160
let content = fs.readFileSync(tempFile, "utf-8");
155161
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "nextKatacodaStep.asciidoc"), { title: runCommand.command.parameters[0], content: content, path: runCommand.command.parameters[2]});
162+
156163
return null;
157164
}
158165
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
== Generate CobiGen Templates
2+
How to use CobiGen, to generate templates for the following code generation.
3+
More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html.
4+
5+
=== Prerequisites
6+
7+
* 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.
8+
9+
=== Generate CobiGen Templates with CobiGen CLI
10+
11+
First open a command prompt in your current workspace. You should be inside your devonfw directory, if not change your directory to *<%= devonPath;%>*.
12+
Run the CobiGen command `devon cobigen adapt-templates`
13+
to generate a new templates folder next to the CobiGen CLI and save its location in a configuration file.
14+
15+
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.
16+
17+
18+
19+

runners/wikiEclipse/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,8 @@ export class WikiEclipse extends WikiRunner {
5858
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "createDevon4jProject.asciidoc"), { name: runCommand.command.parameters[0]});
5959
return null;
6060
}
61+
runAdaptTemplatesCobiGen(runComannd: RunCommand): RunResult{
62+
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "adaptTemplates.asciidoc"), {});
63+
return null;
64+
}
6165
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
== Generate new Templates for CobiGen
2+
How to use CobiGen, to generate templates for the following code generation.
3+
More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html.
4+
5+
=== Prerequisites
6+
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.
7+
8+
=== Generate CobiGen Templates with Eclipse IDE
9+
10+
First, open Eclipse IDE, and if your file explorer is empty load any file, create a file, or project into Eclipse.
11+
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.

0 commit comments

Comments
 (0)