forked from connectbot/sshlib
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
84 lines (73 loc) · 2.19 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
import com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.github.ben-manes.versions") version "0.21.0"
id("com.diffplug.gradle.spotless") version "3.21.1"
}
buildscript {
repositories {
jcenter()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
spotless {
java {
target(fileTree(".") {
include("**/*.java")
exclude("**/build", "**/out")
})
removeUnusedImports()
trimTrailingWhitespace()
indentWithTabs()
replaceRegex("class-level javadoc indentation fix", "^\\*", " *")
replaceRegex("method-level javadoc indentation fix", "\t\\*", "\t *")
}
kotlinGradle {
target(fileTree(".") {
include("**/*.gradle.kts")
exclude("**/build", "**/out")
})
ktlint()
}
format("xml") {
target(fileTree(".") {
include("config/**/*.xml", "sshlib/**/*.xml")
exclude("**/build", "**/out")
})
eclipseWtp(EclipseWtpFormatterStep.XML).configFile("spotless.xml.prefs")
}
format("misc") {
target("**/.gitignore")
indentWithTabs()
trimTrailingWhitespace()
endWithNewline()
}
}
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
resolutionStrategy {
componentSelection {
all {
val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea")
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-+]*") }
.any { it.matches(candidate.version) }
if (rejected) {
reject("Release candidate")
}
}
}
}
// optional parameters
checkForGradleUpdate = true
outputFormatter = "json"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
}