Skip to content

Commit f7014d4

Browse files
Feature/wikirunnerCreateDevon4jProject (devonfw-tutorials#237)
added createDevon4jProject operation for wikirunner
1 parent 046e88e commit f7014d4

File tree

9 files changed

+104
-6
lines changed

9 files changed

+104
-6
lines changed

.github/workflows/linuxPullRequest.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: run checkout.sh
2121
run: bash checkout.sh
2222

23-
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }} ${{ github.event.inputs.logLevel }}
23+
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }}
2424
uses: GabrielBB/[email protected]
2525
with:
26-
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }} ${{ github.event.inputs.logLevel }}
26+
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }}

.github/workflows/windowsPullRequest.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ jobs:
2020
- name: run checkout.ps1
2121
run: .\checkout.ps1
2222

23-
- name: run buildRun.ps1 --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }} ${{ github.event.inputs.logLevel }}
24-
run: .\buildRun.ps1 --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }} ${{ github.event.inputs.logLevel }}
23+
- name: run buildRun.ps1 --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }}
24+
run: .\buildRun.ps1 --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }}
25+

engine/run.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Parser } from "./parser";
22
import { Playbook } from "./playbook";
33
import { Environment } from "./environment";
44
import { Engine } from "./engine";
5-
import { isObject } from "util";
65
const fs = require('fs');
76
const yargs = require('yargs/yargs');
87

@@ -21,6 +20,7 @@ class Run {
2120
this.parsePlaybooks();
2221
this.parseEnvironments();
2322
let entries = this.filterEnv(Array.from(this.environments.entries()));
23+
2424
for (let entry of entries) {
2525
let key = entry[0];
2626
let value = entry[1];

localBuildRun.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Copy-Item -Force -Recurse -Path $PSScriptRoot\environments\ -Destination $PSScri
55
Copy-Item -Force -Recurse -Path $PSScriptRoot\runners\ -Destination $PSScriptRoot\build
66
npm test
77
if(-not $?) { throw 'tests failed' }
8-
node $PSScriptRoot\build\engine\run.js $args
8+
node $PSScriptRoot\build\engine\run.js $args

runners/console/consoleUtils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class ConsoleUtils {
2727
if(result.returnCode != 0) return;
2828

2929
let process = child_process.spawn(command, [], { shell: true, cwd: directory, env: env });
30+
3031
let output = "";
3132
process.stdout.on('data', function(data) {
3233
output += data.toString();

runners/wikiConsole/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,10 @@ export class WikiConsole extends WikiRunner {
116116
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "buildJava.asciidoc"), { directoryPath: directoryPath, skipTest: skipTest });
117117
return null;
118118
}
119+
120+
runCreateDevon4jProject(runCommand: RunCommand): RunResult {
121+
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "createDevon4jProject.asciidoc"), { name: runCommand.command.parameters[0] });
122+
return null;
123+
}
119124
}
120125

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
== Create a new devon4j project
2+
3+
=== Create a new devon4j project from command prompt
4+
5+
==== Prerequisites
6+
7+
In order to create a new application you must use the archetype provided by devon4j which uses the https://maven.apache.org/guides/introduction/introduction-to-archetypes.html[maven archetype functionality].
8+
9+
To create a new application, you should have installed devonfw-ide. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw-ide] documentation to install the same.
10+
11+
==== Create the project
12+
13+
Now you can use devonfw to setup a java project for you by executing the following devon command in terminal.
14+
15+
`devon java create <%= name; %>`
16+
17+
There is also is also an alternative way, where you can customize the project setup with optional parameters. More informations you will find https://devonfw.com/website/pages/docs/devon4j.asciidoc_tutorials.html[here].
18+
19+
==== What is generated?
20+
21+
The application template (archetype) generates a Maven multi-module project. It has the following modules:
22+
23+
- *api*: module with the API (REST service interfaces, transfer-objects, datatypes, etc.) to be imported by other apps as a maven dependency in order to invoke and consume the offered (micro)services.
24+
25+
- *core*: maven module containing the core of the application.
26+
27+
- *batch*: optional module for batch(es)
28+
29+
- *server*: module that bundles the entire app (core with optional batch) as a WAR file.
30+
31+
- *ear*: optional maven module is responsible to packaging the application as a EAR file.
32+
33+
The toplevel pom.xml of the generated project has the following features:
34+
35+
- Properties definition: Spring-boot version, Java version, etc.
36+
37+
- Modules definition for the modules (described above)
38+
39+
- Dependency management: define versions for dependencies of the technology stack that are recommended and work together in a compatible way.
40+
41+
- Maven plugins with desired versions and configuration
42+
43+
- Profiles for https://devonfw.com/website/pages/docs/devon4j.asciidoc_guides.html#guide-testing.asciidoc[test stages]
44+

runners/wikiEclipse/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,9 @@ export class WikiEclipse extends WikiRunner {
4040
contentFile: contentFile, fileName: fileName});
4141
return null;
4242
}
43+
44+
runCreateDevon4jProject(runCommand: RunCommand): RunResult {
45+
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "createDevon4jProject.asciidoc"), { name: runCommand.command.parameters[0]});
46+
return null;
47+
}
4348
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
== Create a new devon4j project
2+
3+
=== Create a new devon4j project in the Eclipse IDE
4+
5+
==== Prerequisites
6+
7+
In order to create a new application you must use the archetype provided by devon4j which uses the https://maven.apache.org/guides/introduction/introduction-to-archetypes.html[maven archetype functionality].
8+
9+
To create a new application, you should have installed devonfw-ide. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw-ide] documentation to install the same.
10+
11+
==== Create the project
12+
13+
Firstly, create a new maven project.
14+
Then, choose the 'devon4j-template-server' archetype.
15+
Fill the _Group Id_, _Artifact Id_, _version_ and _package_ for your project. The _package_ name should be <%= name; %>. If you want to add an EAR generation mechanism to your project, you should fill the property _earProjectName_ with the value _Artifact Id_ + "-ear". For example, "sampleapp-ear".
16+
17+
==== What is generated?
18+
19+
The application template (archetype) generates a maven multi-module project. It has the following modules:
20+
21+
- *api*: module with the API (REST service interfaces, transfer-objects, datatypes, etc.) to be imported by other apps as a maven dependency in order to invoke and consume the offered (micro)services.
22+
23+
- *core*: maven module containing the core of the application.
24+
25+
- *batch*: optional module for batch(es)
26+
27+
- *server*: module that bundles the entire app (core with optional batch) as a WAR file.
28+
29+
- *ear*: optional maven module is responsible to packaging the application as a EAR file.
30+
31+
The toplevel pom.xml of the generated project has the following features:
32+
33+
- Properties definition: Spring-boot version, Java version, etc.
34+
35+
- Modules definition for the modules (described above)
36+
37+
- Dependency management: define versions for dependencies of the technology stack that are recommended and work together in a compatible way.
38+
39+
- Maven plugins with desired versions and configuration
40+
41+
- Profiles for https://devonfw.com/website/pages/docs/devon4j.asciidoc_guides.html#guide-testing.asciidoc[test stages]
42+

0 commit comments

Comments
 (0)