diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 71687b0..74f5fe8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,13 +1,13 @@ /* * This file was generated by the Gradle 'init' task. - * - * This generated file contains a sample Java application project to get you started. * For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.7/userguide/building_java_projects.html in the Gradle documentation. */ plugins { // Apply the application plugin to add support for building a CLI application in Java. application + // JMH Gradle Plugin + id("me.champeau.jmh") version "0.7.2" } repositories { @@ -22,7 +22,7 @@ dependencies { testRuntimeOnly("org.junit.platform:junit-platform-launcher") // This dependency is used by the application. - implementation(libs.guava) + //implementation(libs.guava) } // Apply a specific Java toolchain to ease working on different environments. @@ -32,12 +32,29 @@ java { } } -application { - // Define the main class for the application. - mainClass = "de.uni_marburg.powersort.App" +// The `application` plugin provides the `JavaExec` task. +// It automatically creates one task of that type called `run`. +// It is not possible to rename it. +// Thus, we remove it and add two custom named `JavaExec` tasks instead. +tasks.getByName("run") { + enabled = false + description = "This task has been disabled. It does nothing o.O" +} + +tasks.register("runCustomBenchmark") { + group = "application" + classpath = sourceSets["main"].runtimeClasspath + mainClass = "de.uni_marburg.powersort.benchmark.Main" } tasks.named("test") { // Use JUnit Platform for unit tests. useJUnitPlatform() -} + + reports { + // XML reports for GitLab CI. + junitXml.required.set(true) + // HTML reports to view with a webbrowser. + html.required.set(true) + } +} \ No newline at end of file diff --git a/app/src/main/java/de/uni_marburg/powersort/App.java b/app/src/main/java/de/uni_marburg/powersort/App.java deleted file mode 100644 index 23e9332..0000000 --- a/app/src/main/java/de/uni_marburg/powersort/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package de.uni_marburg.powersort; - -public class App { - public String getGreeting() { - return "Let's bring Powersort to Java!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/app/src/test/java/de/uni_marburg/powersort/AppTest.java b/app/src/test/java/de/uni_marburg/powersort/AppTest.java deleted file mode 100644 index e8227bc..0000000 --- a/app/src/test/java/de/uni_marburg/powersort/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package de.uni_marburg.powersort; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -}