Skip to content

Commit 041d8b3

Browse files
authored
Merge pull request #41 from denise-khuu/feature/katacodabuildJava
Feature/katacodabuild java
2 parents 8c80418 + 4e35ecc commit 041d8b3

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

build - Shortcut.lnk

1.26 KB
Binary file not shown.

runners/console/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ export class Console extends Runner {
9393
return null;
9494
}
9595

96+
runBuildJava(step: Step, command: Command): RunResult {
97+
return null;
98+
}
99+
96100
async assertInstallDevonfwIde(step: Step, command: Command, result: RunResult) {
97101
let installedTools = command.parameters[0];
98102

@@ -145,6 +149,11 @@ export class Console extends Runner {
145149
.fileExits(path.join(workspaceDir, command.parameters[0], "core", "src", "main", "java", "com", "example", "application", command.parameters[0], "SpringBootApp.java"));
146150
}
147151

152+
async assertbuildJava(step: Step, command: Command, result: RunResult) {
153+
console.log("assertbuildJava exceptions");
154+
}
155+
156+
148157
private executeCommandSync(command: string, directory: string, result: RunResult, input?: string) {
149158
if(result.returnCode != 0) return;
150159

runners/katacoda/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,31 @@ export class Katacoda extends Runner {
112112
return null;
113113
}
114114

115+
runCreateDevon4jProject(step: Step, command: Command): RunResult{
116+
return null;
117+
}
118+
119+
runBuildJava(step: Step, command: Command): RunResult{
120+
121+
//cdCommand needs to be added
122+
let cdCommand = "";
123+
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+
}
131+
this.steps.push({
132+
"title": "Build the java project",
133+
"text": "step" + this.stepsCount + ".md"
134+
});
135+
this.renderTemplate("buildJava.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, skipTest: skipTest, skipTestDescr: skipTestDescr});
136+
return null;
137+
138+
}
139+
115140
private renderTemplate(name: string, targetPath: string, variables) {
116141
let template = fs.readFileSync(path.join(this.getRunnerDirectory(),"templates", name), 'utf8');
117142
let result = ejs.render(template, variables);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<%= text; %>
2+
3+
<%= cdCommand; %>
4+
5+
Use the following devon command to build the java project.
6+
7+
`devon mvn clean install <%= skipTest; %>`{{execute}}
8+
9+
The maven command 'clean' will clear the target directory beforehand.
10+
11+
<%= skipTestDescr; %>
12+
13+
<%= textAfter; %>

0 commit comments

Comments
 (0)