This repository has been archived by the owner on Apr 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
102 lines (91 loc) · 2.38 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
import com.gradle.publish.PublishPlugin
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.BintrayPlugin
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
import ru.itbasis.gradle.common.ide.idea.gradleRunConfiguration
plugins {
`kotlin-dsl`
`maven-publish`
id("ru.itbasis.gradle.root-module-plugin")
}
allprojects {
configurations.all {
resolutionStrategy {
eachDependency {
when (requested.group) {
"org.jetbrains.kotlin" -> useVersion(embeddedKotlinVersion)
}
}
}
}
}
val kotestVersion = extra["kotest.version"] as String
subprojects {
apply<KotlinDslPlugin>()
configure<KotlinDslPluginOptions> {
experimentalWarning.set(false)
}
repositories {
gradlePluginPortal()
}
if (name == "common" || name == "backend-plugins") {
return@subprojects
}
apply<PublishPlugin>()
apply<MavenPublishPlugin>()
binTrayCredentials()?.let {
apply<BintrayPlugin>()
configure<BintrayExtension> {
user = it.first
key = it.second
override = true
publish = true
setPublications("pluginMaven")
pkg.apply {
repo = group as String
name = this@subprojects.name
}
}
}
tasks {
withType(Test::class) {
useJUnitPlatform()
testLogging {
showExceptions = true
showStandardStreams = true
events = setOf(FAILED, PASSED)
exceptionFormat = FULL
}
}
}
dependencies {
"testImplementation"(project(":root-module-plugin"))
if (name != "common-tests") {
"testImplementation"(project(":common:common-tests"))
}
}
configurations.all {
resolutionStrategy {
eachDependency {
when (requested.group) {
"io.kotest" -> useVersion(kotestVersion)
}
}
}
}
}
gradleRunConfiguration(cfgSubName = "publish (local)", tasks = listOf("check", "publishToMavenLocal")) {
scriptParameters = "-x test --rerun-tasks"
}
gradleRunConfiguration(cfgSubName = "publish", tasks = listOf("check", "bintrayUpload"))
gradleRunConfiguration(cfgSubName = "publish (without tests)", tasks = listOf("check", "bintrayUpload")) {
scriptParameters = "-x test"
}
gradleRunConfiguration(
cfgSubName = "resources",
tasks = listOf("processResources", "generatePomFileForPluginMavenPublication", "generateMetadataFileForPluginMavenPublication")
) {
scriptParameters = "--rerun-tasks"
}