11## Functions
22The following functions are already implemented:
3- * installDevonfwIde
4- * restoreDevonfwIde
5- * restoreWorkspace
6- * changeWorkspace
7- * executeCommand
8- * installCobiGen
9- * cobiGenJava
10- * createDevon4jProject
11- * buildJava
12- * createFile
13- * changeFile
14- * createFolder
15- * cloneRepository
16- * runServerJava
17- * buildNg
18- * npmInstall
19- * dockerCompose
20- * downloadFile
21- * nextKatacodaStep
22- * adaptTemplatesCobiGen
23- * createDevon4ngProject
24- * addSetupScript
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 )
2525
2626***
2727
28- ### installDevonfwIde
28+ ### installDevonfwIde < a name = " installDevonfwIde " ></ a >
2929#### parameter
30301 . The tools you want to install within the devonfw ide: string array
31312 . Optional: The version of the ide to install
@@ -34,7 +34,7 @@ installDevonfwIde(["java","mvn"], "2020.08.001")
3434
3535***
3636
37- ### restoreDevonfwIde
37+ ### restoreDevonfwIde < a name = " restoreDevonfwIde " ></ a >
3838#### parameter
39391 . The tools you want to install within the devonfw ide: string array
40402 . Optional: The version of the ide to install
@@ -44,7 +44,7 @@ restoreDevonfwIde(["java","mvn"], "2020.08.001")
4444In the Katacoda environment the installation of the devonfw IDE is executed in a startup script.
4545***
4646
47- ### restoreWorkspace
47+ ### restoreWorkspace < a name = " restoreWorkspace " ></ a >
4848#### parameter
49491 . (Optional) Name of the workspace repository {"workspace": string} (Default is the playbook-name)
5050
@@ -106,7 +106,7 @@ will run "git clone https://github.com/[GitHub-name]/[playbook-name]" and checko
106106Learn more about the workspace directory and working directory on [ Structure] ( https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Structure )
107107
108108
109- ### changeWorkspace
109+ ### changeWorkspace < a name = " changeWorkspace " ></ a >
110110#### parameter
1111111 . path to a new workspace (relative to working directory)
112112#### example
@@ -115,7 +115,7 @@ will set the workspace directory to "[working directory]/devonfw/workspaces/proj
115115
116116Learn more about the workspace directory and working directory on [ Structure] ( https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Structure )
117117
118- ### executeCommand
118+ ### executeCommand < a name = " executeCommand " ></ a >
119119#### parameter
1201201 . The command that will be executed on Windows
1211212 . The command that will be executed on Linux
@@ -150,15 +150,15 @@ executeCommand("someServerScript.ps1","bash someServerScript.sh", {"asynchronous
150150Starting 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.
151151
152152
153- ### installCobiGen
153+ ### installCobiGen < a name = " installGobiGen " ></ a >
154154#### parameter
155155* No parameters
156156#### example
157157installCobiGen()
158158
159159***
160160
161- ### cobiGenJava
161+ ### cobiGenJava < a name = " cobiGenJava " ></ a >
162162#### parameter
1631631 . The path to the java file you want to generate code for: string
1641642 . The numbers that represent the templates that CobiGen uses to generate code: int array
@@ -175,7 +175,7 @@ cobiGenJava("path/to/java/file/MyEntity.java",[1,3,5,6,8])
175175
176176***
177177
178- ### createDevon4jProject
178+ ### createDevon4jProject < a name = " createDevon4jProject " ></ a >
179179#### parameter
1801801 . The base package name
181181#### example
@@ -184,7 +184,7 @@ createDevon4jProject("com.mycustomer.myapplication")
184184
185185***
186186
187- ### buildJava
187+ ### buildJava < a name = " buildJava " ></ a >
188188#### parameter
1891891 . The project directory
1901902 . (Optional) Indicator whether tests should be run. Default is false.
@@ -193,7 +193,7 @@ buildJava("cobigenexample", true)
193193
194194***
195195
196- ### createFile
196+ ### createFile < a name = " createFile " ></ a >
197197#### parameter
1981981 . Path of the file to be created (relative path to the workspace directory)
1991992 . (Optional) Path of the file to get the content from. Relative to the playbook directory
@@ -202,7 +202,7 @@ createFile("cobigenexample/core/src/main/java/com/example/application/cobigenexa
202202
203203***
204204
205- ### changeFile
205+ ### changeFile < a name = " changeFile " ></ a >
206206#### parameter
2072071 . Path of the file to be changed (relative path to the workspace directory)
2082082 .
@@ -243,15 +243,15 @@ The option to insert at a linenumber uses a placeholder inserted by a script and
243243
244244***
245245
246- ### createFolder
246+ ### createFolder < a name = " createFolder " ></ a >
247247#### parameter
2482481 . Path of the folder to be created, relative to the workspace directory. Subdirectories are also created.
249249#### example
250250createFolder("directoryPath/subDirectory")
251251
252252***
253253
254- ### cloneRepository
254+ ### cloneRepository < a name = " cloneRepository " ></ a >
255255#### parameter
2562561 . Path into which the repository is to be cloned, relative to workspace.
2572572 . Git repository URL
@@ -265,7 +265,7 @@ Repository will be cloned into a newly created subdirectory devonfw-tutorials.
265265***
266266
267267
268- ### runServerJava
268+ ### runServerJava < a name = " runServerJava " ></ a >
269269#### parameter
2702701 . Path to the server directory within the java project.
2712712 . Assertion information. Only needed for the console runner to check if the server was started properly.
@@ -280,7 +280,7 @@ path: The URL path on which is checked if the server is running
280280If the tutorial should be tested on the console environment, you have to specify a port.
281281***
282282
283- ### npmInstall
283+ ### npmInstall < a name = " npmInstall " ></ a >
284284#### parameter
2852851 . Path to the project where the dependencies from the package.json file are to be installed.
2862862 . Json-object: Name of a package, global or local installation, or array of npm arguments
@@ -296,7 +296,7 @@ will run 'npm install' in the directory 'my-thai-star/angular'
296296
297297***
298298
299- ### dockerCompose
299+ ### dockerCompose < a name = " dockerCompose " ></ a >
300300#### parameter
3013011 . Path to the directory where the docker-compose.yml file is located, relative to workspace.
3023022 . Assertion information. Only needed for the console runner to check if the server was started properly.
@@ -311,7 +311,7 @@ path: The URL path on which is checked if the server is running
311311If the tutorial should be tested on the console environment, you have to specify a port.
312312***
313313
314- ### downloadFile
314+ ### downloadFile < a name = " downloadFile " ></ a >
315315#### parameter
3163161 . URL of the file to be downloaded.
3173172 . Name of file.
@@ -321,7 +321,7 @@ downloadFile("https://bit.ly/2BCkFa9", "file", "downloads")
321321
322322***
323323
324- ### buildNg
324+ ### buildNg < a name = " buildNg " ></ a >
325325#### parameter
3263261 . Path to the angular project relative to workspace
3273272 . (Optional) Custom output directory.
@@ -334,7 +334,7 @@ Will build the angular project to output directory testOutput.
334334
335335***
336336
337- ### runClientNg
337+ ### runClientNg < a name = " runClientNg " ></ a >
338338#### parameter
3393391 . Path to the angular project from which the frontend server is to be started.
3403402 . Assertion information. Only needed for the console runner to check if the server was started properly.
@@ -349,7 +349,7 @@ path: The URL path on which is checked if the server is running
349349If the tutorial should be tested on the console environment, you have to specify a port.
350350***
351351
352- ### nextKatacodaStep
352+ ### nextKatacodaStep < a name = " nextKatacodaStep " ></ a >
353353#### parameter
3543541 . The title of the step.
3553552 . An array of json objects with files, content, or images to be rendered within the katacoda step.
@@ -366,15 +366,15 @@ image: Path to an image to be displayed in the katacoda step.
366366
367367***
368368
369- ### adaptTemplatesCobiGen
369+ ### adaptTemplatesCobiGen < a name = " adaptTemplatesCobiGen " ></ a >
370370#### parameter
371371* No parameters
372372#### example
373373adaptTemplatesCobiGen()
374374
375375***
376376
377- ### createDevon4ngProject
377+ ### createDevon4ngProject < a name = " createDevon4ngProject " ></ a >
378378#### parameter
3793791 . Name of the Project.
3803802 . Path to where the Project should be created (relative to workspace). Folder should exist.
@@ -391,7 +391,7 @@ This command also works if the devonfw IDE is not installed, but then you have t
391391
392392***
393393
394- ### addSetupScript
394+ ### addSetupScript < a name = " addSetupScript " ></ a >
395395#### parameter
3963961 . Path of the script (Linux). Relative to the playbook directory
3973972 . Path of the script (Windows). Relative to the playbook directory
@@ -401,7 +401,7 @@ addSetupScript("assets/createProjectScript.sh", "assets/createProjectScript.ps1"
401401
402402***
403403
404- ### openFile
404+ ### openFile < a name = " openFile " ></ a >
405405#### parameter
4064061 . Path of the file to be opened (relative path to the workspace directory)
407407
0 commit comments