This repository has been archived by the owner on Apr 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
123 lines (107 loc) · 3.4 KB
/
build.gradle
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
buildscript {
ext {
// libraries
springBootVersion = '2.5.3'
lombokVersion = '1.18.20'
apacheCommonsVersion = '3.12.0'
hibernateValidatorVersion = '6.1.7.Final'
mockWebserverVersion = '4.9.1'
spotbugsAnnotationsVersion = '4.3.0'
httpComponentsVersion = '4.5.13'
reactorTestVersion = '3.4.8'
// plugins
spotlessPluginVersion = '5.14.2'
dependencyManagementPluginVersion = '1.0.11.RELEASE'
dependencyUpdatesPluginVersion = '0.39.0'
jacocoPluginVersion = '0.8.7'
libraryGradlePluginVersion = '2.1.0'
qualityPluginVersion = '4.6.0'
}
repositories {
mavenCentral()
google()
}
}
plugins {
id 'java-library'
id 'idea'
id 'jacoco'
id 'maven-publish'
id 'com.github.ben-manes.versions' version "${dependencyUpdatesPluginVersion}"
id 'com.diffplug.spotless' version "${spotlessPluginVersion}"
id 'io.spring.dependency-management' version "${dependencyManagementPluginVersion}"
id 'ru.vyarus.quality' version "${qualityPluginVersion}"
}
apply from: 'gradle/spotless.gradle'
subprojects {
group 'com.tgt.crm'
sourceCompatibility = 11
repositories {
mavenCentral()
google()
}
jar {
enabled = true
}
apply plugin: 'java-library'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'ru.vyarus.quality'
apply plugin: 'com.diffplug.spotless'
apply from: '../gradle/spotless.gradle'
apply from: '../gradle/checks.gradle'
publishing {
publications {
gpr(MavenPublication) {
from(components.java)
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/target/token-manager-for-salesforce"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
}
}
test {
// use junit5
useJUnitPlatform()
}
dependencies {
// used to copy & log headers on requests if debug enabled
implementation "org.apache.commons:commons-lang3:${apacheCommonsVersion}"
// used for bean validation
implementation "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
implementation "org.apache.httpcomponents:httpclient:${httpComponentsVersion}"
implementation 'io.micrometer:micrometer-core'
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "com.squareup.okhttp3:mockwebserver:${mockWebserverVersion}"
testImplementation "com.squareup.okhttp3:okhttp:${mockWebserverVersion}"
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}