11## Functions
22The following functions are already implemented:
3- :toc:
4- :toc-title:
3+ * [ installDevonfwIde] ( #installDevonfwIde )
4+ * [ restoreDevonfwIde] ( #restoreDevonfwIde )
5+ * [ restoreWorkspace] ( #restoreWorkspace )
6+ * [ changeWorkspace] ( #changeWorkspace )
7+ * [ executeCommand] ( #executeCommand )
8+ * [ installCobiGen] ( #installCobiGen )
9+ * [ cobiGenJava] ( #cobiGenJava )
10+ * [ createDevon4jProject] ( #createDevon4jProject )
11+ * [ buildJava] ( #buildJava )
12+ * [ createFile] ( #createFile )
13+ * [ changeFile] ( #changeFile )
14+ * [ createFolder] ( #createFolder )
15+ * [ cloneRepository] ( #cloneRepository )
16+ * [ runServerJava] ( #runServerJava )
17+ * [ buildNg] ( #buildNg )
18+ * [ npmInstall] ( #npmInstall )
19+ * [ dockerCompose] ( #dockerCompose )
20+ * [ downloadFile] ( #downloadFile )
21+ * [ nextKatacodaStep] ( #nextKatacodaStep )
22+ * [ adaptTemplatesCobiGen] ( #adaptTemplatesCobiGen )
23+ * [ createDevon4ngProject] ( #createDevon4ngProject )
24+ * [ addSetupScript] ( #addSetupScript )
525
626***
727
8- ### installDevonfwIde
28+ ### installDevonfwIde < a name = " installDevonfwIde " ></ a >
929#### parameter
10301 . The tools you want to install within the devonfw ide: string array
11312 . Optional: The version of the ide to install
@@ -14,7 +34,7 @@ installDevonfwIde(["java","mvn"], "2020.08.001")
1434
1535***
1636
17- ### restoreDevonfwIde
37+ ### restoreDevonfwIde < a name = " restoreDevonfwIde " ></ a >
1838#### parameter
19391 . The tools you want to install within the devonfw ide: string array
20402 . Optional: The version of the ide to install
@@ -24,7 +44,7 @@ restoreDevonfwIde(["java","mvn"], "2020.08.001")
2444In the Katacoda environment the installation of the devonfw IDE is executed in a startup script.
2545***
2646
27- ### restoreWorkspace
47+ ### restoreWorkspace < a name = " restoreWorkspace " ></ a >
2848#### parameter
29491 . (Optional) Name of the workspace repository {"workspace": string} (Default is the playbook-name)
3050
@@ -86,7 +106,7 @@ will run "git clone https://github.com/[GitHub-name]/[playbook-name]" and checko
86106Learn more about the workspace directory and working directory on [ Structure] ( https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Structure )
87107
88108
89- ### changeWorkspace
109+ ### changeWorkspace < a name = " changeWorkspace " ></ a >
90110#### parameter
911111 . path to a new workspace (relative to working directory)
92112#### example
@@ -95,7 +115,7 @@ will set the workspace directory to "[working directory]/devonfw/workspaces/proj
95115
96116Learn more about the workspace directory and working directory on [ Structure] ( https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Structure )
97117
98- ### executeCommand
118+ ### executeCommand < a name = " executeCommand " ></ a >
99119#### parameter
1001201 . The command that will be executed on Windows
1011212 . The command that will be executed on Linux
@@ -130,15 +150,15 @@ executeCommand("someServerScript.ps1","bash someServerScript.sh", {"asynchronous
130150Starting a server in a new terminal. You have to specify the port for testing, the other parameters are optional. The startupTime can specify how long the runner will wait for a response from the server process and with interval you can set the frequenzy for the server testing. The path is the subpath from your server that should be reached.
131151
132152
133- ### installCobiGen
153+ ### installCobiGen < a name = " installGobiGen " ></ a >
134154#### parameter
135155* No parameters
136156#### example
137157installCobiGen()
138158
139159***
140160
141- ### cobiGenJava
161+ ### cobiGenJava < a name = " cobiGenJava " ></ a >
142162#### parameter
1431631 . The path to the java file you want to generate code for: string
1441642 . The numbers that represent the templates that CobiGen uses to generate code: int array
@@ -155,7 +175,7 @@ cobiGenJava("path/to/java/file/MyEntity.java",[1,3,5,6,8])
155175
156176***
157177
158- ### createDevon4jProject
178+ ### createDevon4jProject < a name = " createDevon4jProject " ></ a >
159179#### parameter
1601801 . The base package name
161181#### example
@@ -164,7 +184,7 @@ createDevon4jProject("com.mycustomer.myapplication")
164184
165185***
166186
167- ### buildJava
187+ ### buildJava < a name = " buildJava " ></ a >
168188#### parameter
1691891 . The project directory
1701902 . (Optional) Indicator whether tests should be run. Default is false.
@@ -173,7 +193,7 @@ buildJava("cobigenexample", true)
173193
174194***
175195
176- ### createFile
196+ ### createFile < a name = " createFile " ></ a >
177197#### parameter
1781981 . Path of the file to be created (relative path to the workspace directory)
1791992 . (Optional) Path of the file to get the content from. Relative to the playbook directory
@@ -182,7 +202,7 @@ createFile("cobigenexample/core/src/main/java/com/example/application/cobigenexa
182202
183203***
184204
185- ### changeFile
205+ ### changeFile < a name = " changeFile " ></ a >
186206#### parameter
1872071 . Path of the file to be changed (relative path to the workspace directory)
1882082 .
@@ -223,15 +243,15 @@ The option to insert at a linenumber uses a placeholder inserted by a script and
223243
224244***
225245
226- ### createFolder
246+ ### createFolder < a name = " createFolder " ></ a >
227247#### parameter
2282481 . Path of the folder to be created, relative to the workspace directory. Subdirectories are also created.
229249#### example
230250createFolder("directoryPath/subDirectory")
231251
232252***
233253
234- ### cloneRepository
254+ ### cloneRepository < a name = " cloneRepository " ></ a >
235255#### parameter
2362561 . Path into which the repository is to be cloned, relative to workspace.
2372572 . Git repository URL
@@ -245,7 +265,7 @@ Repository will be cloned into a newly created subdirectory devonfw-tutorials.
245265***
246266
247267
248- ### runServerJava
268+ ### runServerJava < a name = " runServerJava " ></ a >
249269#### parameter
2502701 . Path to the server directory within the java project.
2512712 . Assertion information. Only needed for the console runner to check if the server was started properly.
@@ -260,7 +280,7 @@ path: The URL path on which is checked if the server is running
260280If the tutorial should be tested on the console environment, you have to specify a port.
261281***
262282
263- ### npmInstall
283+ ### npmInstall < a name = " npmInstall " ></ a >
264284#### parameter
2652851 . Path to the project where the dependencies from the package.json file are to be installed.
2662862 . Json-object: Name of a package, global or local installation, or array of npm arguments
@@ -276,7 +296,7 @@ will run 'npm install' in the directory 'my-thai-star/angular'
276296
277297***
278298
279- ### dockerCompose
299+ ### dockerCompose < a name = " dockerCompose " ></ a >
280300#### parameter
2813011 . Path to the directory where the docker-compose.yml file is located, relative to workspace.
2823022 . Assertion information. Only needed for the console runner to check if the server was started properly.
@@ -291,7 +311,7 @@ path: The URL path on which is checked if the server is running
291311If the tutorial should be tested on the console environment, you have to specify a port.
292312***
293313
294- ### downloadFile
314+ ### downloadFile < a name = " downloadFile " ></ a >
295315#### parameter
2963161 . URL of the file to be downloaded.
2973172 . Name of file.
@@ -301,7 +321,7 @@ downloadFile("https://bit.ly/2BCkFa9", "file", "downloads")
301321
302322***
303323
304- ### buildNg
324+ ### buildNg < a name = " buildNg " ></ a >
305325#### parameter
3063261 . Path to the angular project relative to workspace
3073272 . (Optional) Custom output directory.
@@ -314,7 +334,7 @@ Will build the angular project to output directory testOutput.
314334
315335***
316336
317- ### runClientNg
337+ ### runClientNg < a name = " runClientNg " ></ a >
318338#### parameter
3193391 . Path to the angular project from which the frontend server is to be started.
3203402 . Assertion information. Only needed for the console runner to check if the server was started properly.
@@ -329,7 +349,7 @@ path: The URL path on which is checked if the server is running
329349If the tutorial should be tested on the console environment, you have to specify a port.
330350***
331351
332- ### nextKatacodaStep
352+ ### nextKatacodaStep < a name = " nextKatacodaStep " ></ a >
333353#### parameter
3343541 . The title of the step.
3353552 . An array of json objects with files, content, or images to be rendered within the katacoda step.
@@ -346,15 +366,15 @@ image: Path to an image to be displayed in the katacoda step.
346366
347367***
348368
349- ### adaptTemplatesCobiGen
369+ ### adaptTemplatesCobiGen < a name = " adaptTemplatesCobiGen " ></ a >
350370#### parameter
351371* No parameters
352372#### example
353373adaptTemplatesCobiGen()
354374
355375***
356376
357- ### createDevon4ngProject
377+ ### createDevon4ngProject < a name = " createDevon4ngProject " ></ a >
358378#### parameter
3593791 . Name of the Project.
3603802 . Path to where the Project should be created (relative to workspace). Folder should exist.
@@ -371,7 +391,7 @@ This command also works if the devonfw IDE is not installed, but then you have t
371391
372392***
373393
374- ### addSetupScript
394+ ### addSetupScript < a name = " addSetupScript " ></ a >
375395#### parameter
3763961 . Path of the script (Linux). Relative to the playbook directory
3773972 . Path of the script (Windows). Relative to the playbook directory
@@ -381,7 +401,7 @@ addSetupScript("assets/createProjectScript.sh", "assets/createProjectScript.ps1"
381401
382402***
383403
384- ### openFile
404+ ### openFile < a name = " openFile " ></ a >
385405#### parameter
3864061 . Path of the file to be opened (relative path to the workspace directory)
387407
0 commit comments