forked from ministryofjustice/hmpps-gradle-spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
94 lines (80 loc) · 3.06 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
94 lines (80 loc) · 3.06 KB
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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.4.10"
id("com.gradle.plugin-publish") version "0.12.0"
id("java-gradle-plugin")
id("maven-publish")
id("com.github.ben-manes.versions") version "0.36.0"
id("se.patrikerdes.use-latest-versions") version "0.2.15"
id("org.owasp.dependencycheck") version "6.0.3"
id("com.adarshr.test-logger") version "2.1.1"
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
group = "uk.gov.justice.hmpps.gradle"
version = "2.0.0"
gradlePlugin {
plugins {
create("dpsSpringBootPlugin") {
id = "uk.gov.justice.hmpps.gradle-spring-boot"
implementationClass = "uk.gov.justice.digital.hmpps.gradle.DpsSpringBootPlugin"
displayName = "HMPPS Spring Boot Plugin"
description = "Plugin for HMPPS Spring Boot microservice configuration"
}
}
}
pluginBundle {
website = "https://github.com/ministryofjustice/dps-gradle-spring-boot"
vcsUrl = "https://github.com/ministryofjustice/dps-gradle-spring-boot"
tags = listOf("hmpps", "spring-boot")
}
dependencies {
implementation(kotlin("reflect"))
implementation("org.springframework.boot:spring-boot-gradle-plugin:2.4.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
implementation("io.spring.dependency-management:io.spring.dependency-management.gradle.plugin:1.0.10.RELEASE")
implementation("org.owasp:dependency-check-gradle:6.0.3")
implementation("com.github.ben-manes:gradle-versions-plugin:0.36.0")
implementation("com.gorylenko.gradle-git-properties:com.gorylenko.gradle-git-properties.gradle.plugin:2.2.4")
implementation("com.adarshr.test-logger:com.adarshr.test-logger.gradle.plugin:2.1.1")
implementation("se.patrikerdes.use-latest-versions:se.patrikerdes.use-latest-versions.gradle.plugin:0.2.15")
implementation("org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:9.4.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
testImplementation("org.mockito:mockito-junit-jupiter:3.6.0")
testImplementation("org.assertj:assertj-core:3.18.1")
testImplementation("net.javacrumbs.json-unit:json-unit-assertj:2.21.0")
testImplementation("com.google.code.gson:gson:2.8.6")
testImplementation("org.eclipse.jgit:org.eclipse.jgit:5.9.0.202009080501-r")
}
tasks {
test {
useJUnitPlatform()
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}
withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
}
tasks.named("check") {
dependsOn(":ktlintCheck")
}