Skip to content

Commit 4e35ecc

Browse files
committed
buildJava for Katacoda
1 parent c2339b0 commit 4e35ecc

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

build - Shortcut.lnk

1.26 KB
Binary file not shown.

runners/katacoda/index.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,26 @@ export class Katacoda extends Runner {
113113
}
114114

115115
runCreateDevon4jProject(step: Step, command: Command): RunResult{
116-
let cdCommand = "/root/devonfw";
117-
this.steps.push({
118-
"title": "CobiGen Java",
119-
"text": "step" + this.stepsCount + ".md"
120-
});
121-
this.renderTemplate("buildJava.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, skipTest: command.parameters[1]});
122116
return null;
123117
}
124118

125119
runBuildJava(step: Step, command: Command): RunResult{
126-
let cdCommand = "/root/devonfw/workspace/" + command.parameters[0];
120+
121+
//cdCommand needs to be added
122+
let cdCommand = "";
127123

124+
let skipTestDescr = "";
125+
let skipTest = "";
126+
127+
if(command.parameters[1] == true){
128+
skipTest = '-Dmaven.test.skip=' + command.parameters[1];
129+
skipTestDescr = "We do not need to execute the test cases, so we can skip them by using the option '-Dmaven.test.skip=true'."
130+
}
128131
this.steps.push({
129-
"title": "Build Java",
132+
"title": "Build the java project",
130133
"text": "step" + this.stepsCount + ".md"
131134
});
132-
this.renderTemplate("buildJava.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, skipTest: command.parameters[1]});
135+
this.renderTemplate("buildJava.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, skipTest: skipTest, skipTestDescr: skipTestDescr});
133136
return null;
134137

135138
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<%= text; %>
22

3-
## Build the java project
4-
53
<%= cdCommand; %>
64

75
Use the following devon command to build the java project.
86

9-
`devon mvn clean install -Dmaven.test.skip=<%= skipTest; %>`{{execute}}
7+
`devon mvn clean install <%= skipTest; %>`{{execute}}
108

119
The maven command 'clean' will clear the target directory beforehand.
1210

13-
We do not need to execute the test cases, so we can skip them by using the option '-Dmaven.test.skip=<%= skipTest; %>'.
11+
<%= skipTestDescr; %>
1412

1513
<%= textAfter; %>

0 commit comments

Comments
 (0)