-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
47 lines (38 loc) · 1.43 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
import buildsrc.utils.excludeProjectConfigurationDirs
import buildsrc.utils.initIdeProjectLogo
import org.gradle.language.base.plugins.LifecycleBasePlugin.VERIFICATION_GROUP
plugins {
buildsrc.conventions.base
idea
}
group = "dev.adamko.dokkatoo"
version = "2.5.0-SNAPSHOT"
excludeProjectConfigurationDirs(idea)
tasks.prepareKotlinBuildScriptModel {
initIdeProjectLogo("documentation/media/kayray-logo.svg")
}
val dokkatooVersion by tasks.registering {
description = "prints the Dokkatoo project version (used during release to verify the version)"
group = "help"
val version = providers.provider { project.version.toString() }
doLast {
logger.quiet("${version.orNull}")
}
}
val verifyVersionCatalogKotlinVersion by tasks.registering {
description = "Verify the Version Catalog Kotlin version matches Gradle's embedded Kotlin version"
// https://docs.gradle.org/current/userguide/compatibility.html#kotlin
group = VERIFICATION_GROUP
val kotlinVersion = libs.versions.kotlin.asProvider()
inputs.property("kotlinVersion", kotlinVersion)
val embeddedKotlinVersion = embeddedKotlinVersion
inputs.property("embeddedKotlinVersion", embeddedKotlinVersion)
doLast {
require(kotlinVersion.get() == embeddedKotlinVersion) {
"Version Catalog Kotlin version (${kotlinVersion.get()}) did not match embeddedKotlinVersion ($embeddedKotlinVersion)"
}
}
}
tasks.check {
dependsOn(verifyVersionCatalogKotlinVersion)
}