mirror of
https://gitlab.uni-marburg.de/langbeid/powersort.git
synced 2025-01-21 19:50:35 +01:00
gradle: JMH plugin, XML test results, add benchmark target
This commit is contained in:
parent
9d67b48215
commit
9a99716a0a
@ -1,13 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* This file was generated by the Gradle 'init' task.
|
* 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.
|
* 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 {
|
plugins {
|
||||||
// Apply the application plugin to add support for building a CLI application in Java.
|
// Apply the application plugin to add support for building a CLI application in Java.
|
||||||
application
|
application
|
||||||
|
// JMH Gradle Plugin
|
||||||
|
id("me.champeau.jmh") version "0.7.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@ -22,7 +22,7 @@ dependencies {
|
|||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||||
|
|
||||||
// This dependency is used by the application.
|
// This dependency is used by the application.
|
||||||
implementation(libs.guava)
|
//implementation(libs.guava)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply a specific Java toolchain to ease working on different environments.
|
// Apply a specific Java toolchain to ease working on different environments.
|
||||||
@ -32,12 +32,29 @@ java {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
// The `application` plugin provides the `JavaExec` task.
|
||||||
// Define the main class for the application.
|
// It automatically creates one task of that type called `run`.
|
||||||
mainClass = "de.uni_marburg.powersort.App"
|
// 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<JavaExec>("runCustomBenchmark") {
|
||||||
|
group = "application"
|
||||||
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
|
mainClass = "de.uni_marburg.powersort.benchmark.Main"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<Test>("test") {
|
tasks.named<Test>("test") {
|
||||||
// Use JUnit Platform for unit tests.
|
// Use JUnit Platform for unit tests.
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
|
||||||
|
reports {
|
||||||
|
// XML reports for GitLab CI.
|
||||||
|
junitXml.required.set(true)
|
||||||
|
// HTML reports to view with a webbrowser.
|
||||||
|
html.required.set(true)
|
||||||
|
}
|
||||||
|
}
|
@ -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());
|
|
||||||
}
|
|
||||||
}
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user