Added gradle build for testing

This commit is contained in:
Erik C. Thauvin 2023-05-01 22:45:10 -07:00
parent 164bc50089
commit 2eb6bac66b
11 changed files with 431 additions and 12 deletions

View file

@ -1,15 +1,13 @@
package com.example;
import rife.bld.BaseProject;
import rife.bld.BuildCommand;
import rife.bld.Project;
import rife.bld.extension.JacocoReportOperation;
import java.io.IOException;
import java.util.List;
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
import static rife.bld.dependencies.Repository.RIFE2_RELEASES;
import static rife.bld.dependencies.Scope.compile;
import static rife.bld.dependencies.Scope.test;
public class ExamplesBuild extends Project {
@ -23,8 +21,6 @@ public class ExamplesBuild extends Project {
scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 9, 2)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 9, 2)));
testOperation().mainClass("com.example.ExamplesTest");
}
public static void main(String[] args) {
@ -32,8 +28,14 @@ public class ExamplesBuild extends Project {
}
@Override
public void test() throws Exception {
super.test();
jacoco();
}
@BuildCommand(summary = "Generates Jacoco Reports")
public void jacoco() throws Exception {
public void jacoco() throws IOException {
new JacocoReportOperation()
.fromProject(this)
.execute();