generated from michaelruocco/library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
117 lines (101 loc) · 3.23 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
plugins {
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id "com.diffplug.spotless" version "6.25.0"
id "com.github.ben-manes.versions" version "0.51.0"
id "pl.allegro.tech.build.axion-release" version "1.17.0"
id "org.sonarqube" version "5.0.0.4638"
id "nebula.lint" version "19.0.1"
id "com.bmuschko.docker-remote-api" version "9.4.0"
}
scmVersion {
versionCreator "versionWithBranch"
tag {
prefix = "${name}-"
}
}
project.version = scmVersion.version
subprojects {
group "com.github.michaelruocco"
tasks.withType(Javadoc).configureEach {
options.addStringOption('Xdoclint:none', '-quiet')
}
ext {
slf4jVersion = "2.0.12"
lombokVersion = "1.18.32"
postgresqlVersion = "42.7.3"
flywayVersion = "10.11.0"
jsonAdapterVersion = "1.0.4"
springKafkaVersion = "3.1.0"
springVersion = "6.1.6"
jacksonVersion = "2.17.0"
junitVersion = "5.10.2"
gitUrl = "https://github.com/michaelruocco/naughts-and-crosses-api"
pomConfig = {
licenses {
license {
name "MIT License"
url "https://opensource.org/licenses/MIT"
distribution "repo"
}
}
developers {
developer {
id "mruoc"
name "Michael Ruocco"
email "michael.ruocco@hotmail.com"
}
}
scm {
url project.ext.gitUrl
}
}
}
}
gradleLint {
rules = ['all-dependency']
alwaysRun = false
}
sonarqube {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "michaelruocco"
property "sonar.projectKey", "michaelruocco_${name}"
property "sonar.coverage.jacoco.xmlReportPaths", "${project.rootDir}/code-coverage-report/build/reports/jacoco/unitCoverage/unitCoverage.xml,${project.rootDir}/code-coverage-report/build/reports/jacoco/integrationCoverage/integrationCoverage.xml"
}
}
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ["alpha", "beta", "rc", "cr", "m", "preview"].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject("Release candidate")
}
}
}
}
nexusPublishing {
packageGroup = "com.github.michaelruocco"
repositories {
sonatype {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
docker {
registryCredentials {
username.set(System.getenv("DOCKER_USERNAME"))
password.set(System.getenv("DOCKER_PASSWORD"))
}
}
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
import com.bmuschko.gradle.docker.tasks.image.DockerPushImage
task buildImage(type: DockerBuildImage) {
inputDir.set(file("."))
images.add("michaelruocco/${project.name}:${version}")
}
task pushImage(type: DockerPushImage) {
images.set(buildImage.images)
}