-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
141 lines (118 loc) · 4.75 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
plugins {
id "com.github.johnrengelman.shadow" version "8.1.1"
id 'io.micronaut.application' version '4.4.4'
id 'java'
id 'groovy'
id 'jacoco'
id 'org.sonarqube' version '6.0.1.5171'
id 'com.github.kt3k.coveralls' version '2.12.2'
id 'com.diffplug.spotless' version '6.25.0'
id 'io.gatling.gradle' version '3.13.1.2'
}
version "3.0.0"
group "io.github.devatherock"
sourceCompatibility = '17'
targetCompatibility = '17'
repositories {
mavenCentral()
}
micronaut {
runtime("netty")
testRuntime("junit5")
processing {
incremental(true)
annotations("io.github.devatherock.*")
}
}
configurations {
// Force dependency versions to use dependencies without vulnerabilities
all {
resolutionStrategy {
force 'org.jsoup:jsoup:1.18.3'
}
}
}
dependencies {
def lombokVersion = '1.18.36'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
annotationProcessor("io.micronaut.openapi:micronaut-openapi")
annotationProcessor "io.micronaut:micronaut-inject-java"
annotationProcessor 'io.micronaut.validation:micronaut-validation-processor'
annotationProcessor "io.micronaut:micronaut-graal"
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion
compileOnly group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'
compileOnly "org.graalvm.nativeimage:svm"
implementation "io.micronaut:micronaut-inject"
implementation "io.micronaut.validation:micronaut-validation"
implementation "io.micronaut:micronaut-runtime"
implementation "io.micronaut.micrometer:micronaut-micrometer-core"
implementation "io.micronaut:micronaut-management"
implementation "io.swagger.core.v3:swagger-annotations"
implementation "io.micronaut:micronaut-http-server-netty"
implementation "io.micronaut:micronaut-http-client"
implementation "io.micronaut.cache:micronaut-cache-core"
implementation "io.micronaut.cache:micronaut-cache-caffeine"
// Micronaut 4.x: To fix 'No bean of type [io.micronaut.json.JsonMapper] exists' error
implementation "io.micronaut:micronaut-jackson-databind"
implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '8.0'
implementation group: 'org.codehaus.janino', name: 'janino', version: '3.1.12'
implementation "ch.qos.logback:logback-classic:1.5.15"
runtimeOnly group: 'org.yaml', name: 'snakeyaml'
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut.test:micronaut-test-spock"
testImplementation group: 'org.spockframework', name: 'spock-core', version: '2.3-groovy-4.0'
testImplementation group: 'cglib', name: 'cglib-nodep', version: '3.3.0'
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.4'
testImplementation group: 'org.wiremock', name: 'wiremock', version: '3.10.0'
}
test.classpath += configurations.developmentOnly
mainClassName = "io.github.devatherock.Application"
test {
useJUnitPlatform()
systemProperty 'micronaut.env.deduction', 'false'
}
gatlingRun {
systemProperties(System.properties)
}
// Generates resource-config.json file for graalvm
build.dependsOn(generateResourcesConfigFile)
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
options.compilerArgs.add('-parameters')
}
shadowJar {
mergeServiceFiles()
}
run {
classpath += configurations.developmentOnly
jvmArgs('-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
systemProperties(System.properties)
}
ext.jacoco = [
exclusions: [
'io/github/devatherock/Application.class',
'io/github/devatherock/artifactory/config/GraalConfig.class',
],
coverageThresholds: [
'io.github.devatherock.logback.LogbackConfigInitializer': [
'BRANCH': 0.75,
'COMPLEXITY': 0.62,
'INSTRUCTION': 0.89,
'LINE': 0.88
]
]
]
apply from: "${getPropertyValue('gradle.includes.location', 'https://raw.githubusercontent.com/devatherock/gradle-includes/master')}/native.gradle"
apply from: "${getPropertyValue('gradle.includes.location', 'https://raw.githubusercontent.com/devatherock/gradle-includes/master')}/integration.gradle"
apply from: "${getPropertyValue('gradle.includes.location', 'https://raw.githubusercontent.com/devatherock/gradle-includes/master')}/checks.gradle"
/**
* Fetches the value of a gradle property
*
* @param propertyName
* @param propertyValueDefault
* @return the property value
*/
String getPropertyValue(String propertyName, String propertyValueDefault = null) {
return project.hasProperty(propertyName) ? project[propertyName] : propertyValueDefault
}