Skip to content

Commit b17b2b2

Browse files
author
dixyushi
committed
Merge remote-tracking branch 'upstream/main' into main
2 parents a1605c2 + 5f5f67c commit b17b2b2

10 files changed

Lines changed: 236 additions & 219 deletions

.github/workflows/buildPullRequest.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ jobs:
1919
- name: Setup matrix combinations
2020
id: setup-matrix-combinations
2121
run: |
22+
dirs=()
2223
for changed_file in ${{ steps.changedfiles.outputs.all }}; do
2324
dir="$(echo $changed_file | cut -d/ -f1)"
24-
MATRIX_PARAMS_COMBINATIONS=$MATRIX_PARAMS_COMBINATIONS'{"tutorial": "'$dir'"},'
25+
if [[ ! " ${dirs[@]} " =~ " ${dir} " ]]; then
26+
MATRIX_PARAMS_COMBINATIONS=$MATRIX_PARAMS_COMBINATIONS'{"tutorial": "'$dir'"},'
27+
fi
28+
dirs+=($dir)
2529
done
2630
echo ::set-output name=matrix-combinations::{\"include\":[$MATRIX_PARAMS_COMBINATIONS]}
2731
outputs:
Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,46 @@
1-
name: Check PR Katacoda Syntax
2-
3-
on:
4-
pull_request:
5-
branches: [ main ]
6-
7-
workflow_dispatch:
8-
jobs:
9-
build_pullRequest:
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- name: Checkout tutorial-compiler
14-
uses: actions/checkout@v2
15-
with:
16-
repository: devonfw-tutorials/tutorial-compiler
17-
18-
- name: Checkout playbooks
19-
uses: actions/checkout@v2
20-
with:
21-
repository: devonfw-tutorials/tutorials
22-
path: playbooks
23-
24-
- uses: actions/setup-node@v2-beta
25-
26-
- name: install TS
27-
run: npm install typescript
28-
29-
- name: npm install
30-
run: npm install
31-
32-
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }}
33-
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }} -e katacoda
1+
name: Check PR Katacoda Syntax
2+
3+
on:
4+
pull_request_target:
5+
branches: [ main ]
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout tutorial-compiler
12+
uses: actions/checkout@v2
13+
with:
14+
repository: devonfw-tutorials/tutorial-compiler
15+
16+
- name: Checkout playbooks
17+
uses: actions/checkout@v2
18+
with:
19+
repository: devonfw-tutorials/tutorials
20+
path: playbooks
21+
22+
- uses: actions/setup-node@v2-beta
23+
24+
- name: install TS
25+
run: npm install typescript
26+
27+
- name: npm install
28+
run: npm install
29+
30+
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax
31+
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax -e katacoda
32+
33+
- name: Get message
34+
id: get_message
35+
run: |
36+
message=`cat ./build/errors/syntaxErrors.md`
37+
echo ${message}
38+
echo "::set-output name=message::$message"
39+
40+
- name: Request changes
41+
if: ${{ steps.get_message.outputs.message != '' }}
42+
uses: andrewmusgrave/automatic-pull-request-review@0.0.2
43+
with:
44+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
45+
event: REQUEST_CHANGES
46+
body: ${{ steps.get_message.outputs.message }}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
If there are multiple input elements selected, e.g., Java files, CobiGen will be started in batch mode. The generation preview will be constrained to the first selected input element. It does not preview the generation for each element of the selection or of a complex input. The selection of the files to be generated will be generated for each input element analogously afterwards.
2-
3-
Thus the color encoding differs also a little bit:
4-
5-
- yellow: files, which are configured to be merged.
6-
7-
- red: files, which are not configured with any merge strategy and thus will be created if the file does not exist or overwritten if the file already exists
8-
1+
If there are multiple input elements selected, e.g., Java files, CobiGen will be started in batch mode. The generation preview will be constrained to the first selected input element. It does not preview the generation for each element of the selection or of a complex input. The selection of the files to be generated will be generated for each input element analogously afterwards.
2+
3+
Thus the color encoding differs also a little bit:
4+
5+
- yellow: files, which are configured to be merged.
6+
7+
- red: files, which are not configured with any merge strategy and thus will be created if the file does not exist or overwritten if the file already exists
8+
99
- no color: files, which will be ignored during generation
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
CobiGen CLI is installed inside your devonfw distribution. In order to execute it follow the next steps:
2-
3-
* Execute the below command to navigate to devonfw installation directory repository.
4-
5-
`cd devonfw`{{execute T1}}
6-
7-
* Execute below command to install CobiGen.
8-
9-
`devon cobigen`{{execute T1}}
10-
11-
* Execute below command to setup devon environment.
12-
13-
`devon`{{execute T1}}
14-
15-
You have successfully setup CobiGen.
16-
Execute the below command to verify the installation.
17-
1+
CobiGen CLI is installed inside your devonfw distribution. In order to execute it follow the next steps:
2+
3+
* Execute the below command to navigate to devonfw installation directory repository.
4+
5+
`cd devonfw`{{execute T1}}
6+
7+
* Execute below command to install CobiGen.
8+
9+
`devon cobigen`{{execute T1}}
10+
11+
* Execute below command to setup devon environment.
12+
13+
`devon`{{execute T1}}
14+
15+
You have successfully setup CobiGen.
16+
Execute the below command to verify the installation.
17+
1818
`cobigen -V`{{execute T1}}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
* Execute the below command to know available CobiGen Commands
2-
3-
`cobigen `{{execute T1}}
4-
5-
* [generate, g]: Command used for code generation.
6-
To know more about implementation of this command you can follow https://katacoda.com/devonfw/scenarios/cobigen.
7-
8-
* [adapt-templates, a]: Generates a new templates folder next to the Cobigen CLI and stores its location inside a configuration file. After executing this command, the CLI will attempt to use the specified Templates folder.
9-
10-
`cobigen a`{{execute T1}}
11-
1+
* Execute the below command to know available CobiGen Commands
2+
3+
`cobigen `{{execute T1}}
4+
5+
* [generate, g]: Command used for code generation.
6+
To know more about implementation of this command you can follow https://katacoda.com/devonfw/scenarios/cobigen.
7+
8+
* [adapt-templates, a]: Generates a new templates folder next to the Cobigen CLI and stores its location inside a configuration file. After executing this command, the CLI will attempt to use the specified Templates folder.
9+
10+
`cobigen a`{{execute T1}}
11+
1212
To get more information about rest of all the command visit on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc_cobigen-cli.html
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Insert the update site of your interest into the filed Work with and press Add
2-
Stable releases: https://dl.bintray.com/devonfw/cobigen.p2/
3-
4-
* Follow the installation wizard
5-
Select CobiGen Eclipse Plug-in → Next → Next → accept the license → Finish → OK → Yes
6-
7-
* Once installed, a new menu entry named "CobiGen" will show up in the Package Explorer’s context menu. In the sub menu there will the Generate​ command, which may ask you to update the templates, and then you can start the generation wizard of CobiGen.
8-
1+
Insert the update site of your interest into the filed Work with and press Add
2+
Stable releases: https://dl.bintray.com/devonfw/cobigen.p2/
3+
4+
* Follow the installation wizard
5+
Select CobiGen Eclipse Plug-in → Next → Next → accept the license → Finish → OK → Yes
6+
7+
* Once installed, a new menu entry named "CobiGen" will show up in the Package Explorer’s context menu. In the sub menu there will the Generate​ command, which may ask you to update the templates, and then you can start the generation wizard of CobiGen.
8+
99
* You can adapt the templates by clicking on Adapt Templates which will give you the possibility to import the CobiGen_Templates automatically so that you can modified them.
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
## Health Check
2-
However, you might face some errors while using CobiGen. So, we recommend to perform a Health Check for CobiGen Templates for better experience.
3-
4-
To get more information on Health Check for CobiGen Templates visit on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc_eclipse-integration.html#cobigen-eclipse_usage.asciidoc_health-check
5-
6-
## Troubleshooting CLI
7-
When generating code from a Java file, CobiGen makes use of Java reflection for generating templates. In order to do that, the CLI needs to find the compiled source code of your project.
8-
9-
If you find an error like Compiled class foo\bar\EmployeeEntity.java has not been found, it means you need to run "mvn clean install" on the input project so that a new target folder gets created with the needed compiled sources.
10-
11-
## Conclusion
12-
From this tutorial you have learned the following:
13-
* You can do CobiGen set up in your system.
14-
* You can use the CobiGen CLI commands to generate the code.
15-
* You can now integrate CobiGen with Eclipse and generate your crud services.
16-
* Now you know how to use CobiGen in a particular project with Eclipse as well as CLI.
17-
1+
## Health Check
2+
However, you might face some errors while using CobiGen. So, we recommend to perform a Health Check for CobiGen Templates for better experience.
3+
4+
To get more information on Health Check for CobiGen Templates visit on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc_eclipse-integration.html#cobigen-eclipse_usage.asciidoc_health-check
5+
6+
## Troubleshooting CLI
7+
When generating code from a Java file, CobiGen makes use of Java reflection for generating templates. In order to do that, the CLI needs to find the compiled source code of your project.
8+
9+
If you find an error like Compiled class foo\bar\EmployeeEntity.java has not been found, it means you need to run "mvn clean install" on the input project so that a new target folder gets created with the needed compiled sources.
10+
11+
## Conclusion
12+
From this tutorial you have learned the following:
13+
* You can do CobiGen set up in your system.
14+
* You can use the CobiGen CLI commands to generate the code.
15+
* You can now integrate CobiGen with Eclipse and generate your crud services.
16+
* Now you know how to use CobiGen in a particular project with Eclipse as well as CLI.
17+
1818
More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Selecting the menu entry Generate​ the generation wizard will be opened.
2-
3-
The left side of the wizard shows all available increments, which can be selected to be generated. Increments are a container like concept encompassing multiple files to be generated, which should result in a semantically closed generation output. The type of modification of each file will be encoded into following color scheme if the files are selected for generation:
4-
5-
- green: files, which are currently non-existent in the file system. These files will be created during generation
6-
7-
- yellow: files, which are currently existent in the file system and which are configured to be merged with generated contents.
8-
9-
- red: files, which are currently existent in the file system. These files will be overwritten if manually selected.
10-
1+
Selecting the menu entry Generate​ the generation wizard will be opened.
2+
3+
The left side of the wizard shows all available increments, which can be selected to be generated. Increments are a container like concept encompassing multiple files to be generated, which should result in a semantically closed generation output. The type of modification of each file will be encoded into following color scheme if the files are selected for generation:
4+
5+
- green: files, which are currently non-existent in the file system. These files will be created during generation
6+
7+
- yellow: files, which are currently existent in the file system and which are configured to be merged with generated contents.
8+
9+
- red: files, which are currently existent in the file system. These files will be overwritten if manually selected.
10+
1111
- no color: files, which are currently existent in the file system. Additionally files, which were unselected and thus will be ignored during generation.

0 commit comments

Comments
 (0)