1
- apply plugin : ' org.jetbrains.dokka'
2
-
3
1
buildscript {
4
2
apply from : " $rootDir /gradle/dependencies.gradle"
5
3
@@ -13,6 +11,7 @@ buildscript {
13
11
classpath plugin. kotlin. dokka
14
12
classpath plugin. kotlin. gradle
15
13
classpath plugin. mavenPublish
14
+ classpath plugin. gradleVersions
16
15
}
17
16
}
18
17
@@ -28,6 +27,53 @@ allprojects {
28
27
}
29
28
}
30
29
30
+ task clean (type : Delete ) {
31
+ delete rootProject. buildDir
32
+ }
33
+
34
+ // //////////////////////////////////////////////////////////////////////////
35
+ // / Gradle Versions: https://github.com/ben-manes/gradle-versions-plugin ///
36
+ // //////////////////////////////////////////////////////////////////////////
37
+
38
+ apply plugin : ' com.github.ben-manes.versions'
39
+
40
+ def isNonStable = { String version ->
41
+ def stableKeyword = [' RELEASE' , ' FINAL' , ' GA' ]. any { it -> version. toUpperCase(). contains(it) }
42
+ def regex = / ^[0-9,.v-]+(-r)?$/
43
+ return ! stableKeyword && ! (version ==~ regex)
44
+ }
45
+
46
+ tasks. named(" dependencyUpdates" ). configure {
47
+ checkForGradleUpdate = true
48
+
49
+ // Example 1: reject all non stable versions
50
+ rejectVersionIf {
51
+ isNonStable(candidate. version)
52
+ }
53
+
54
+ // Example 2: disallow release candidates as upgradable versions from stable versions
55
+ rejectVersionIf {
56
+ isNonStable(candidate. version) && ! isNonStable(currentVersion)
57
+ }
58
+
59
+ // Example 3: using the full syntax
60
+ resolutionStrategy {
61
+ componentSelection {
62
+ all {
63
+ if (isNonStable(candidate. version) && ! isNonStable(currentVersion)) {
64
+ reject(' Release candidate' )
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ // ////////////////////////////////////////////
72
+ // / Dokka: https://github.com/Kotlin/dokka ///
73
+ // ////////////////////////////////////////////
74
+
75
+ apply plugin : ' org.jetbrains.dokka'
76
+
31
77
// Dokka's configuration.externalDocumentationLink.url setting for connecting methods/variables
32
78
// in each module is quarky, especially when relying on Mkdocs to generate a website using the
33
79
// Markdown files that are created. the `externalDocumentationLink.url` setting requires a
@@ -38,7 +84,3 @@ task fixDokkaDocLinks(type: Exec) {
38
84
workingDir " $rootDir "
39
85
commandLine " scripts/fix_dokka_doc_external_links.sh"
40
86
}
41
-
42
- task clean (type : Delete ) {
43
- delete rootProject. buildDir
44
- }
0 commit comments