-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
99 lines (84 loc) · 2.76 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
92
93
94
95
96
97
98
99
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
plugins {
`java-gradle-plugin`
jacoco
id("net.researchgate.release") version "3.0.2"
id("se.bjurr.gitchangelog.git-changelog-gradle-plugin") version "1.77.2"
kotlin("jvm") version "1.8.21"
id("org.sonarqube") version "3.5.0.2730"
id("com.gradle.plugin-publish") version "1.2.0"
}
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.avast.gradle:gradle-docker-compose-plugin:${property("dockerComposePluginVersion")}")
testImplementation(gradleTestKit())
testImplementation("org.junit.jupiter:junit-jupiter:${property("junitJupiterVersion")}")
}
tasks {
withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
withType<Test> {
useJUnitPlatform()
// Tests summary (displayed at the end)
addTestListener(object : TestListener {
override fun beforeSuite(suite: TestDescriptor) {}
override fun beforeTest(testDescriptor: TestDescriptor) {}
override fun afterTest(testDescriptor: TestDescriptor, result: TestResult) {}
override fun afterSuite(desc: TestDescriptor, result: TestResult) {
if (desc.parent == null) {
println("Tests result: ${result.resultType}")
println("Tests summary: ${result.testCount} tests, "+
"${result.successfulTestCount} succeeded, " +
"${result.failedTestCount} failed, " +
"${result.skippedTestCount} skipped")
}
}
})
}
register("printVersion") {
doLast {
println(project.version)
}
}
register("gitChangelogTask", GitChangelogTask::class) {
file("CHANGELOG.md")
templateContent = file("changelog.mustache").readText(Charsets.UTF_8)
}
}
val pluginName = "gradleDocker"
gradlePlugin {
plugins {
register(pluginName) {
id = "com.ekino.oss.gradle.plugin.docker"
implementationClass = "com.ekino.oss.gradle.plugin.docker.DockerPlugin"
}
}
}
pluginBundle {
website = "https://github.com/ekino/gradle-docker-plugin"
vcsUrl = "https://github.com/ekino/gradle-docker-plugin"
description = "Docker plugin applying some configuration for your builds"
tags = listOf("ekino", "docker")
}
tasks.jacocoTestReport {
reports {
xml.isEnabled = true
}
}
sonarqube {
properties {
property("sonar.projectKey", "ekino_gradle-docker-plugin")
property("sonar.java.coveragePlugin", "jacoco")
property("sonar.junit.reportPaths", "${buildDir}/test-results/test")
property("sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
}
}