-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
111 lines (87 loc) · 2.46 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
100
101
102
103
104
105
106
107
108
109
110
111
import buildsrc.ext.excludeGeneratedGradleDsl
plugins {
buildsrc.convention.`kotlin-jvm`
`kotlin-dsl`
`java-gradle-plugin`
`jvm-test-suite`
id("me.qoomon.git-versioning")
id("com.gradle.plugin-publish")
buildsrc.convention.`maven-publish`
idea
dev.adamko.`vcs-mvn-publish`
}
group = "dev.adamko.vcsmvnpub"
version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
refs {
branch(".+") { version = "\${ref}-SNAPSHOT" }
tag("v(?<version>.*)") { version = "\${ref.version}" }
}
// optional fallback configuration in case of no matching ref configuration
rev { version = "\${commit}" }
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom:$embeddedKotlinVersion"))
implementation(libs.kotlin.utilIO)
}
@Suppress("UnstableApiUsage") // jvm test suites are incubating
testing.suites {
val test by getting(JvmTestSuite::class) {
useJUnitJupiter()
dependencies {
implementation("io.kotest:kotest-assertions-core:5.5.4")
implementation("io.kotest:kotest-runner-junit5:5.5.4")
implementation("io.mockk:mockk:1.13.3")
}
}
val functionalTest by registering(JvmTestSuite::class) {
useJUnitJupiter()
testType.set(TestSuiteType.FUNCTIONAL_TEST)
dependencies {
implementation("io.kotest:kotest-assertions-core:5.5.4")
implementation("io.kotest:kotest-runner-junit5:5.5.4")
implementation(project.dependencies.gradleTestKit())
}
targets.configureEach {
testTask.configure {
shouldRunAfter(test)
dependsOn(tasks.matching { it.name == "publishAllPublicationsToProjectLocalRepository" })
systemProperties(
"projectLocalMavenRepo" to rootProject.layout.buildDirectory.dir("maven-project-local")
.map { it.asFile.invariantSeparatorsPath }.get(),
)
}
}
sources {
java {
resources {
srcDir(tasks.pluginUnderTestMetadata.flatMap { it.outputDirectory })
}
}
}
gradlePlugin.testSourceSet(sources)
}
tasks.check { dependsOn(functionalTest) }
}
gradlePlugin {
plugins {
register("VcsMvnPublish") {
id = "dev.adamko.vcs-mvn-publish"
implementationClass = "dev.adamko.vcsmvnpub.VcsMvnPublishPlugin"
}
}
}
vcsMvnPublish {
gitRepo("artifacts")
}
idea {
module {
isDownloadSources = true
isDownloadJavadoc = false
excludeGeneratedGradleDsl(layout)
excludeDirs = excludeDirs + layout.files(
".idea",
"gradle/wrapper",
)
}
}