-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
81 lines (70 loc) · 1.74 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
/*
* Copyright 2024 Broadcom. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven { url = uri("https://repo.spring.io/plugins-release") }
}
}
plugins {
id("idea")
id("eclipse")
id("java")
id("commercial-repositories")
alias(libs.plugins.versions)
alias(libs.plugins.version.catalog.update)
}
subprojects {
group = "com.vmware.gemfire"
repositories {
mavenLocal()
mavenCentral()
}
}
versionCatalogUpdate {
// These options will be set as default for all version catalogs
sortByKey = true
// Referenced that are pinned are not automatically updated.
// They are also not automatically kept however (use keep for that).
pin {
}
keep {
keepUnusedVersions = true
// keep all libraries that aren't used in the project
keepUnusedLibraries = true
// keep all plugins that aren't used in the project
keepUnusedPlugins = true
}
versionCatalogs {
create("publishCatalog"){
catalogFile = file("gradle/publishing.versions.toml")
}
}
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
!isPatch(candidate.version, currentVersion)
}
}
fun isPatch(candidateVersion: String, currentVersion: String): Boolean {
val candidateSplit = candidateVersion.split(".")
val currentSplit = currentVersion.split(".")
if (currentSplit.size == 3) {
if (candidateSplit.size == currentSplit.size) {
if (candidateSplit[0] != currentSplit[0]) {
return false
}
if (candidateSplit[1] != currentSplit[1]) {
return false
}
return true
}
} else {
return false
}
return false
}