Added support for JaCoCo extension. Closes #2
This commit is contained in:
parent
63635f408b
commit
4d4479bf23
6 changed files with 36 additions and 36 deletions
|
@ -2,8 +2,11 @@ package com.example;
|
|||
|
||||
import rife.bld.BaseProject;
|
||||
import rife.bld.BuildCommand;
|
||||
import rife.bld.extension.JacocoReportOperation;
|
||||
import rife.bld.extension.TestNgOperation;
|
||||
import rife.bld.operations.TestOperation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
|
||||
|
@ -13,20 +16,29 @@ import static rife.bld.dependencies.Scope.test;
|
|||
* Example build.
|
||||
*
|
||||
* <ul style="list-style-type:none">
|
||||
* <li>./bld compile test</li>
|
||||
* <li>{@code ./bld compile test}</li>
|
||||
* <li>{@code ./bld compile jacoco}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class ExamplesBuild extends BaseProject {
|
||||
@Override
|
||||
public TestOperation<?, ?> testOperation() {
|
||||
return new TestNgOperation()
|
||||
.fromProject(this)
|
||||
.packages("com.example");
|
||||
}
|
||||
|
||||
public ExamplesBuild() {
|
||||
pkg = "com.example";
|
||||
name = "Examples";
|
||||
version = version(0, 1, 0);
|
||||
|
||||
javaRelease = 17;
|
||||
downloadSources = true;
|
||||
autoDownloadPurge = true;
|
||||
|
||||
repositories = List.of(MAVEN_CENTRAL);
|
||||
|
||||
|
||||
scope(test).include(dependency("org.testng", "testng", version(7, 9, 0)));
|
||||
}
|
||||
|
||||
|
@ -34,11 +46,10 @@ public class ExamplesBuild extends BaseProject {
|
|||
new ExamplesBuild().start(args);
|
||||
}
|
||||
|
||||
@BuildCommand(summary = "Tests the project with TestNG")
|
||||
public void test() throws Exception {
|
||||
new TestNgOperation()
|
||||
@BuildCommand(summary = "Generates Jacoco Reports")
|
||||
public void jacoco() throws IOException {
|
||||
new JacocoReportOperation()
|
||||
.fromProject(this)
|
||||
.packages("com.example")
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue