-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
91 lines (79 loc) · 2.88 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
plugins {
id("sudoscan.kotlin-base")
id("net.researchgate.release")
id("org.sonarqube")
}
allprojects {
group = "com.github.pintowar"
// javacppPlatform = "linux-x86_64,macosx-x86_64,windows-x86_64"
}
tasks {
register<JacocoReport>("codeCoverageReport") {
group = "verification"
description = "Run tests and merge all jacoco reports"
val codeCoverageTask = this
// If a subproject applies the 'jacoco' plugin, add the result it to the report
subprojects {
val subproject = this
subproject.plugins.withType<JacocoPlugin>().configureEach {
val extensions = subproject.tasks.matching {
val hasJacoco = it.extensions.findByType<JacocoTaskExtension>() != null
hasJacoco && !it.name.contains("native", ignoreCase = true)
}
extensions.forEach { codeCoverageTask.dependsOn(it) }
extensions.configureEach {
val testTask = this
sourceSets(subproject.sourceSets.main.get())
executionData(testTask)
}
}
}
reports {
xml.required.set(true)
html.required.set(true)
csv.required.set(true)
}
}
register("assembleCliApp") {
dependsOn(":sudoscan-cli:shadowJar")
group = "build"
description = "Build cli app"
doLast {
copy {
from(files("${project(":sudoscan-cli").buildDir}/libs/")) {
include("*-all.jar")
}
into("$rootDir/build/")
}
logger.quiet("JAR generated at $rootDir/build/.")
}
}
}
sonarqube {
properties {
val jacocoReportPath = "${project.buildDir.absolutePath}/reports/jacoco/codeCoverageReport"
val sonarToken = project.findProperty("sonar.token")?.toString() ?: System.getenv("SONAR_TOKEN")
property("sonar.sourceEncoding", "UTF-8")
property("sonar.organization", "pintowar")
property("sonar.projectName", "sudoscan")
property("sonar.projectKey", "pintowar_sudoscan")
property("sonar.projectVersion", project.version.toString())
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.login", sonarToken)
property("sonar.verbose", true)
property("sonar.github.repository", "pintowar/sudoscan")
property("sonar.coverage.jacoco.xmlReportPaths", "$jacocoReportPath/codeCoverageReport.xml")
}
}
release {
tagTemplate = "v\$version"
git {
requireBranch = "master"
}
}
tasks.afterReleaseBuild {
dependsOn(
":sudoscan-api:publish", ":sudoscan-solver-choco:publish", ":sudoscan-solver-ojalgo:publish",
":sudoscan-recognizer-dl4j:publish", ":sudoscan-recognizer-djl:publish", ":sudoscan-cli:publish"
)
}