-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
204 lines (174 loc) · 4.47 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
plugins {
id 'java'
id 'org.graalvm.buildtools.native' version '0.9.20'
id("com.diffplug.spotless") version "6.17.0"
id("nebula.lint") version "18.0.3"
id("org.kordamp.gradle.reproducible") version "0.50.0"
id "org.sonarqube" version "3.5.0.2730"
id 'jacoco'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/pagopa/eng-http-signatures")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
gradlePluginPortal()
}
allprojects {
version = '1.0.0-RC7-hotfix'
group = 'it.pagopa.tech.lollipop-consumer-java-sdk'
sourceCompatibility = '11'
targetCompatibility = '11'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'nebula.lint'
gradleLint.rules = []
configurations {
spotless {
resolutionStrategy {
disableDependencyVerification()
}
}
gradleLint {
resolutionStrategy {
disableDependencyVerification()
}
}
gradleEnterprise {
resolutionStrategy {
disableDependencyVerification()
}
}
}
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/main'
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// don't need to set target, it is inferred from java
// apply a specific flavor of google-java-format
googleJavaFormat('1.15.0').aosp().reflowLongStrings()
// fix formatting of type annotations
formatAnnotations()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
licenseHeader '/* (C)$YEAR */'
}
}
}
dependencies {
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformats-text:2.14.1'
implementation 'com.fasterxml.jackson.module:jackson-modules-java8:2.14.1'
implementation 'com.fasterxml.jackson.module:jackson-module-parameter-names:2.14.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1'
}
// Settings for allowing reproducible build
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
subprojects {
apply plugin: 'java'
apply plugin: 'org.kordamp.gradle.reproducible'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'org.graalvm.buildtools.native'
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xlint:all')
}
config {
reproducible {
enabled
additionalProperties
additionalArtifacts
}
}
// Settings for allowing reproducible build
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
// Generate MD5 checksum on eng-lollipop-consumer-java-sdk jar file
jar.doLast { task ->
ant.checksum file: task.archivePath
}
publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.name
version project.version
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/pagopa/eng-lollipop-consumer-java-sdk"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
sonar {
properties {
property "sonar.sources", "src/main/java"
property "sonar.tests", "src/test/java"
}
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
jacoco {
excludes = ["**/config/*","**/*Mock*","**/model/**","**/entity/*","**/*Stub*","**/*Config*","**/*Exception*"]
}
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.enabled true
}
}
}
}
project(":test-coverage") {
sonar {
skipProject = true
}
sonarqube {
skipProject = true
}
}
project(":redis-storage") {
sonar {
skipProject = true
}
sonarqube {
skipProject = true
}
}
graalvmNative {
binaries {
main {
sharedLibrary=true
}
}
}