allprojects { group = 'org.logstash' apply plugin: 'java' apply plugin: 'idea' project.sourceCompatibility = JavaVersion.VERSION_1_8 project.targetCompatibility = JavaVersion.VERSION_1_8 tasks.withType(JavaCompile).all { def env = System.getenv() boolean ci = env['CI'] //don't lint when running CI builds if(!ci){ options.compilerArgs.add("-Xlint:all") } } clean { delete "${projectDir}/out/" } //https://stackoverflow.com/questions/3963708/gradle-how-to-display-test-results-in-the-console-in-real-time tasks.withType(Test) { testLogging { // set options for log level LIFECYCLE events "passed", "skipped", "failed", "standardOut" showExceptions true exceptionFormat "full" showCauses true showStackTraces true // set options for log level DEBUG and INFO debug { events "started", "passed", "skipped", "failed", "standardOut", "standardError" exceptionFormat "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} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" def startItem = '| ', endItem = ' |' def repeatLength = startItem.length() + output.length() + endItem.length() println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) } } } } }