2021-04-29 20:27:40 +02:00
|
|
|
plugins {
|
|
|
|
id 'java'
|
|
|
|
id 'idea'
|
2021-06-04 20:30:29 +02:00
|
|
|
id "org.sonarqube" version "3.2.0"
|
2021-08-05 23:12:24 +02:00
|
|
|
id 'jacoco'
|
2021-04-29 20:27:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
|
2021-06-03 23:41:54 +02:00
|
|
|
maxParallelForks = 1
|
2021-04-29 20:27:40 +02:00
|
|
|
}
|
|
|
|
|
2021-08-06 18:22:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Fancy live test output (from https://stackoverflow.com/questions/3963708/gradle-how-to-display-test-results-in-the-console-in-real-time)
|
|
|
|
|
|
|
|
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|
|
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
|
|
|
|
|
|
tasks.withType(Test) {
|
|
|
|
testLogging {
|
|
|
|
// set options for log level LIFECYCLE
|
|
|
|
events TestLogEvent.FAILED,
|
|
|
|
TestLogEvent.PASSED,
|
|
|
|
TestLogEvent.SKIPPED
|
|
|
|
// TestLogEvent.STANDARD_OUT
|
|
|
|
exceptionFormat TestExceptionFormat.FULL
|
|
|
|
showExceptions true
|
|
|
|
showCauses true
|
|
|
|
showStackTraces true
|
|
|
|
|
|
|
|
// set options for log level DEBUG and INFO
|
|
|
|
debug {
|
|
|
|
events TestLogEvent.STARTED,
|
|
|
|
TestLogEvent.FAILED,
|
|
|
|
TestLogEvent.PASSED,
|
|
|
|
TestLogEvent.SKIPPED,
|
|
|
|
TestLogEvent.STANDARD_ERROR
|
|
|
|
TestLogEvent.STANDARD_OUT
|
|
|
|
exceptionFormat TestExceptionFormat.FULL
|
|
|
|
}
|
|
|
|
// info.events = debug.events
|
|
|
|
// info.exceptionFormat = debug.exceptionFormat
|
|
|
|
|
|
|
|
afterSuite { desc, result ->
|
|
|
|
if (!desc.parent) { // will match the outermost suite
|
|
|
|
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
|
|
|
|
def startItem = '| ', endItem = ' |'
|
|
|
|
def repeatLength = startItem.length() + output.length() + endItem.length()
|
|
|
|
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-05 23:12:24 +02:00
|
|
|
jacocoTestReport {
|
|
|
|
reports {
|
|
|
|
html.enabled true
|
|
|
|
xml.enabled true
|
|
|
|
xml.destination file("${buildDir}/reports/jacoco.xml")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
plugins.withType(JacocoPlugin) {
|
|
|
|
tasks["test"].finalizedBy 'jacocoTestReport'
|
|
|
|
}
|
|
|
|
|
|
|
|
sonarqube {
|
|
|
|
properties {
|
|
|
|
property "sonar.java.coveragePlugin", "jacoco"
|
|
|
|
property "sonar.host.url", "https://sonarqube.yandrik.dev"
|
|
|
|
property "sonar.coverage.jacoco.xmlReportPath", "${buildDir}/reports/jacoco.xml"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-04 14:58:19 +02:00
|
|
|
var mainClassName = "uulm.teamname.marvelous.server.Server"
|
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes "Main-Class": "$mainClassName"
|
|
|
|
}
|
|
|
|
|
|
|
|
from {
|
|
|
|
configurations.runtimeClasspath.collect {it.isDirectory() ? it : zipTree(it) }
|
|
|
|
}
|
|
|
|
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
|
|
}
|
|
|
|
|
2021-04-29 20:27:40 +02:00
|
|
|
dependencies {
|
2021-05-05 18:31:29 +02:00
|
|
|
implementation project(':Gamelib')
|
|
|
|
|
2021-04-29 20:27:40 +02:00
|
|
|
implementation "org.java-websocket:Java-WebSocket:1.5.1"
|
2021-06-01 14:28:20 +02:00
|
|
|
implementation "org.tinylog:tinylog-api:2.4.0-M1"
|
|
|
|
implementation "org.tinylog:tinylog-impl:2.4.0-M1"
|
2021-06-05 00:54:45 +02:00
|
|
|
implementation "org.tinylog:slf4j-tinylog:2.4.0-M1"
|
2021-06-04 18:06:13 +02:00
|
|
|
implementation "com.beust:jcommander:1.81"
|
|
|
|
|
2021-04-29 20:27:40 +02:00
|
|
|
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.0-M1"
|
2021-06-05 23:10:05 +02:00
|
|
|
testImplementation "org.mockito:mockito-core:3.+"
|
2021-06-05 23:27:15 +02:00
|
|
|
testImplementation "org.mockito:mockito-inline:3.+"
|
2021-04-29 20:27:40 +02:00
|
|
|
testImplementation "org.assertj:assertj-core:3.19.0"
|
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.0-M1"
|
2021-06-01 14:28:20 +02:00
|
|
|
}
|