Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ scmVersion {
allprojects {
// Apply common project setup
apply from: "${project.rootDir}/project.gradle"
version = scmVersion.version
version = rootProject.scmVersion.version
}

subprojects {
Expand Down
32 changes: 32 additions & 0 deletions buildSrc/src/main/groovy/TestSummaryListener.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import org.gradle.api.tasks.testing.TestDescriptor
import org.gradle.api.tasks.testing.TestListener
import org.gradle.api.tasks.testing.TestResult

class TestSummaryListener implements TestListener, Serializable {

@Override
void beforeSuite(TestDescriptor suite) {}

@Override
void afterSuite(TestDescriptor desc, TestResult result) {
if (desc.parent == null) {
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| '
def endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()

println '\n' +
('-' * repeatLength) + '\n' +
startItem + output + endItem + '\n' +
('-' * repeatLength)
}
}

@Override
void beforeTest(TestDescriptor desc) {}

@Override
void afterTest(TestDescriptor desc, TestResult result) {
println "${desc.className} > ${desc.name} took: ${(result.endTime - result.startTime)}ms"
}
}
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.configuration-cache=true
org.gradle.jvmargs=-Xmx3g
org.gradle.parallel=false

Expand All @@ -15,5 +16,8 @@ projectName = openremote-extensions

openremoteVersion = 1.27.0-SNAPSHOT

axionReleasePluginVersion = 1.21.2
gradleNexusPublishPluginVersion = 2.0.0
ideaExtPluginVersion = 1.2
testLoggerVersion = 4.0.0

15 changes: 2 additions & 13 deletions project.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,9 @@ plugins.withType(JavaPlugin).whenPluginAdded {
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat

afterTest { desc, result ->
logger.quiet "${desc.className} > ${desc.name} took: ${(result.endTime - result.startTime)}ms"
}

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))
}
}
}

addTestListener(new TestSummaryListener())
}
}

Expand Down
31 changes: 24 additions & 7 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
plugins {
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' apply false
id "org.jetbrains.gradle.plugin.idea-ext" version "1.3" apply false
id 'pl.allegro.tech.build.axion-release' version '1.21.1' apply false
id 'io.github.gradle-nexus.publish-plugin' version "$gradleNexusPublishPluginVersion" apply false
id 'org.jetbrains.gradle.plugin.idea-ext' version "$ideaExtPluginVersion" apply false
id 'pl.allegro.tech.build.axion-release' version "$axionReleasePluginVersion" apply false
}

rootProject.name = "$projectName"

// Include sub-projects dynamically, every directory with a build.gradle (and no .buildignore)
fileTree(dir: rootDir, include: "**/build.gradle", excludes: ["**/node_modules/**", "**/generic_app/**"])
.filter { it.parent != rootDir }
.filter { !file("${it.parent}/.buildignore").exists() }
fileTree(
dir: rootDir,
include: "**/build.gradle",
excludes: [
".git/**",
"**/.git/**",
".gradle/**",
"**/.gradle/**",
"**/build/**",
"**/node_modules/**",
"**/generic_app/**",
"**/dist/**",
"**/lib/**"
]
)
.filter { it.parentFile != rootDir }
.filter { !new File(it.parentFile, ".buildignore").exists() }
.each {
include it.parent.replace(rootDir.canonicalPath, "").replace("\\", ":").replace("/", ":")
include it.parentFile.canonicalPath
.replace(rootDir.canonicalPath, "")
.replace("\\", ":")
.replace("/", ":")
}