-
Notifications
You must be signed in to change notification settings - Fork 37
Functions
- installDevonfwIde
- restoreDevonfwIde
- restoreWorkspace
- changeWorkspace
- installCobiGen
- cobiGenJava
- details
- createDevon4jProject
- buildJava
- createFile
- changeFile
- createFolder
- cloneRepository
- runServerJava
- npmInstall
- dockerCompose
- downloadFile
- buildNg
- runClientNg
- nextKatacodaStep
- adaptTemplatesCobiGen
- createDevon4ngProject
-
The tools you want to install within the devonfw ide: string array
-
Optional: The version of the ide to install
-
The tools you want to install within the devonfw ide: string array
-
Optional: The version of the ide to install
-
(Optional):
-
Name of the workspace repository {"workspace": string} (Default is the playbook-name)
-
local workspace {"local": boolean} (Default is false)
-
User(Optional)
flag: --user value: GitHub-username (Default is 'devonfw-tutorials')
You can use a forked workspace-repository, if you add the username as argument. If the runner cannot find the workspace repository in the your repositories, it will use devonfw-tutorials instead.
Branch(Optional)
flag: --branch value: the working branch (Default is its default-branch)
You can use a different branch, if you add the working branch as argument. If the runner cannot find the branch in the cloned repository, it will use the default branch instead.
buildRun.sh --user [username] --branch [branch]
restoreWorkspace()
will clone "playbook-name" into the workspace directory.
restoreWorkspace({"workspace": [name]})
will clone "name" into the workspace directory.
buildRun.sh --user [GitHub-name] --branch [branch]
restoreWorkspace()
will run git clone GitHub-name/[playbook-name]
and checkout in branch [branch]
workspace The default name of the workspace repository is a concatenation of "workspace-" and the name of your playbook-folder. If you want to use another repository as workspace, you can specify the ending with {"workspace": [name]}. example "workspace-devon4ng" → {"workspace" : "devon4ng"}
local You can use a local repository as workspace in your tutorial. Clone the forked repository next to the tutorials folder. The console runner will always search for local folder first, before cloning a repository. If it doesn’t find a folder named 'workspace-devon4ng' next to the folders 'tutorials' and 'tutorial-compiler', it will clone depending on the given arguments the original or the forked repository instead.
|--tutorial-compiler |--tutorials |--workspace-devon4ng
-
path to a new workspace (relative to working directory) ## example changeWorkspace("devonfw/workspaces/project") will set the workspace directory to "[working directory]/devonfw/workspaces/project"
Learn more about the workspace directory and working direktory on [Structure](https://github.com/devonfw-forge/tutorial-compiler/wiki/Structure)
-
The path to the java file you want to generate code for: string
-
The numbers that represent the templates that CobiGen uses to generate code: int array
Number | Description | |
---|---|---|
1 |
CRUD logic: Generates the logic layer and implementations for some use cases. |
|
3 |
CRUD REST services: Generates the service layer with CRUD operations for using in REST services. |
|
5 |
TO’s: Generates the related Transfer Objects. |
|
6 |
Entity infrastructure: Creates the entity main interface and edits (by a merge) the current entity to extend the newly generated classes. |
-
Path of the file to be created (relative path to the workspace directory)
-
(Optional) Path of the file to get the content from. Relative to the playbook directory
-
Path of the file to be changed (relative path to the workspace directory) 2.
-
Path of the file to get the content from or a string, that should be inserted.
-
(Optional) Name of a placeholder
-
changeFile("cobigenexample/core/src/main/java/com/example/application/cobigenexample/customermanagement/dataaccess/api/CustomerEntity.java", { "file": "files/Placeholder.java", "placeholder": "private static final long serialVersionUID = 1L;" })
If you want to add content from a file:
{"file": "[path]"}
If you want to add a string to a file:
{"content": "[string]"}
If you want to add different contents for the katacoda and console runner, then use the properties fileConsole
and fileKatacoda
or contentConsole
and contentKatacoda
:
{"fileConsole": "[pathToConsoleFile]", "fileKatacoda": "[pathToKatacodaFile]"}
{…,"placeholder": "private int age;"}
Before | Content or File | After |
---|---|---|
private int age; public String getFirstname() { return firstname; } |
private int age; private String company; public String getCompany() { return firstname; } public void setCompany(String company) { this.company = company; } |
private int age; private String company; public String getCompany() { return firstname; } public void setCompany(String company) { this.company = company; } public String getFirstname() { return firstname; } |
A placeholder is optional. If you do not define a placeholder, the content in the existing file will be simply replaced by the new content.
Please try not to use custom placeholders. Keep in mind that you might want to build the project before changing them. Custom placeholders with a comment-syntax (e.g. "//PLACEHOLDER") will be removed by the console-environment and others might cause errors.
-
Path of the folder to be created, relative to the workspace directory. Sub directories are also created.
cloneRepository("", "https://github.com/devonfw-forge/tutorial-compiler.git")
Repository will be cloned directly into the workspace directory.
cloneRepository("devonfw-forge", "https://github.com/devonfw-forge/tutorial-compiler.git")
Repository will be cloned into a newly created subdirectory devonfw-forge.
-
Path to the server directory within the java project.
-
Assertion information. Only needed for the console runner to check if the server was started properly.
runServerJava("devonfw/workspaces/main/jump-the-queue/java/jtqj/server", { "startupTime": 40, "port": 8081, "path": "jumpthequeue" })
-
Path to the project where the dependencies from the package.json file are to be installed.
-
Json-object: Name of a package, global or local installation, or array of npm arguments
-
(Optional) name of a package
{"name": string }
-
(Optional) global or local installation. Default is local, therefore false
{"global" : boolean }
-
(Optional) array of npm arguments as json-object
{"args": string[]}
-
-
Path to the directory where the docker-compose.yml file is located, relative to workspace.
-
Assertion information. Only needed for the console runner to check if the server was started properly.
-
URL of the file to be downloaded.
-
Name of file.
-
(Optional) Downloads file to a given directory relative to workspace. Directory is created, if its not existing.
-
Path to the angular project from which the frontend server is to be started.
-
Assertion information. Only needed for the console runner to check if the server was started properly.
runClientNg("jump-the-queue/angular", { "startupTime": 200, "port": 4200, "path": "" })
-
The title of the step.
-
An array of json objects with files, content, or images to be rendered within the katacoda step.
-
(Optional) Path to the current directory where the user is located (relative to the workspace directory). Only needed if the directory is changed within this step.
nextKatacodaStep("Step title", [{ "file": "files/description.md" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
-
Name of the Project.
-
Path to where the Project should be created (relative to workspace). Folder should exist.
-
(Optional) String array of parameters, according to https://angular.io/cli/new.
createDevon4ngProject("exampleAngularProject", "")
Will create the angular project to the current workspace with the name exampleAngularProject.
createDevon4ngProject("exampleAngularProject", "projects", ["--verbose"])
Will create the angular project to the directory projects within the current workspace and adds more details to output logging.