Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added build - Shortcut.lnk
Binary file not shown.
9 changes: 9 additions & 0 deletions documentation/Functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@ cobiGenJava("path/to/java/file/MyEntity.java",[1,3,5,6,8])
createDevon4jProject("cobigenexample")

***

### buildJava
#### parameter
1. The project directory
2. Indicator whether tests should be run
#### example
buildJava("cobigenexample", true)

***
9 changes: 9 additions & 0 deletions runners/console/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export class Console extends Runner {
return null;
}

runBuildJava(step: Step, command: Command): RunResult {
return null;
}

async assertInstallDevonfwIde(step: Step, command: Command, result: RunResult) {
let installedTools = command.parameters[0];

Expand Down Expand Up @@ -120,6 +124,11 @@ export class Console extends Runner {
.fileExits(path.join(workspaceDir, command.parameters[0], "core", "src", "main", "java", "com", "example", "application", command.parameters[0], "SpringBootApp.java"));
}

async assertbuildJava(step: Step, command: Command, result: RunResult) {
console.log("assertbuildJava exceptions");
}


private executeCommandSync(command: string, directory: string, result: RunResult, input?: string) {
if(result.returnCode != 0) return;

Expand Down
25 changes: 25 additions & 0 deletions runners/katacoda/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,31 @@ export class Katacoda extends Runner {
return null;
}

runCreateDevon4jProject(step: Step, command: Command): RunResult{
return null;
}

runBuildJava(step: Step, command: Command): RunResult{

//cdCommand needs to be added
let cdCommand = "";

let skipTestDescr = "";
let skipTest = "";

if(command.parameters[1] == true){
skipTest = '-Dmaven.test.skip=' + command.parameters[1];
skipTestDescr = "We do not need to execute the test cases, so we can skip them by using the option '-Dmaven.test.skip=true'."
}
this.steps.push({
"title": "Build the java project",
"text": "step" + this.stepsCount + ".md"
});
this.renderTemplate("buildJava.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, skipTest: skipTest, skipTestDescr: skipTestDescr});
return null;

}

private renderTemplate(name: string, targetPath: string, variables) {
let template = fs.readFileSync(path.join(this.getRunnerDirectory(),"templates", name), 'utf8');
let result = ejs.render(template, variables);
Expand Down
13 changes: 13 additions & 0 deletions runners/katacoda/templates/buildJava.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<%= text; %>

<%= cdCommand; %>

Use the following devon command to build the java project.

`devon mvn clean install <%= skipTest; %>`{{execute}}

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

<%= skipTestDescr; %>

<%= textAfter; %>