-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
170 lines (149 loc) · 5.28 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
plugins {
id 'io.micronaut.application' version '4.4.2'
// id 'io.micronaut.aot' version '4.4.2'
id 'io.micronaut.openapi' version '4.4.2'
// id 'org.openapi.generator' version '7.7.0'
}
ext {
ver = [
micronaut: '4.6.2',
core : '4.6.4!!',
openapi : '6.12.3!!',
serde : '2.11.0!!'
]
jreImage = 'bellsoft/liberica-openjre-alpine:17.0.10'
jreImageNative = 'debian:stable-slim'
}
mainClassName = "com.micronaut.bug.Application"
micronaut {
version ver.micronaut
runtime "netty"
testRuntime "junit5"
enableNativeImage false
processing {
group project.group
incremental true
annotations "com.micronaut.bug.*"
}
// aot {
// optimizeServiceLoading = true
// convertYamlToJava = true
// precomputeOperations = true
// cacheEnvironment = true
// optimizeClassLoading = true
// deduceEnvironment = true
// optimizeNetty = true
// }
// openapi {
// version = ver.openapi
// server(file("swagger.yml")) {
// apiPackageName = "com.api.openapi.generated.api"
// modelPackageName = "com.api.openapi.generated.model"
// useReactive = false
// useAuth = true
// }
// }
}
wrapper.gradleVersion = '8.10'
java {
sourceCompatibility = JavaVersion.VERSION_17
}
dockerfile {
baseImage(jreImage)
args "-Dfile.encoding=UTF-8"
}
graalvmNative {
binaries {
toolchainDetection = false
main {
verbose = true
}
}
}
dockerfileNative {
baseImage(jreImageNative)
}
dependencies {
annotationProcessor "org.projectlombok:lombok"
annotationProcessor "io.micronaut.validation:micronaut-validation"
annotationProcessor "io.micronaut:micronaut-core-processor"
annotationProcessor "io.micronaut.serde:micronaut-serde-processor"
annotationProcessor "io.micronaut.security:micronaut-security-annotations"
annotationProcessor "io.micronaut.openapi:micronaut-openapi:$ver.openapi"
compileOnly "org.projectlombok:lombok"
compileOnly "io.micronaut:micronaut-inject-java"
compileOnly "io.micronaut.openapi:micronaut-openapi-annotations:$ver.openapi"
compileOnly "com.fasterxml.jackson.core:jackson-annotations"
implementation "io.micronaut.validation:micronaut-validation"
implementation "io.micronaut:micronaut-http-server-netty"
implementation "io.micronaut:micronaut-http-client"
implementation "io.micronaut:micronaut-runtime"
implementation "io.micronaut:micronaut-jackson-core"
implementation "io.micronaut.reactor:micronaut-reactor"
implementation "io.micronaut.serde:micronaut-serde-api"
implementation "io.micronaut.security:micronaut-security-jwt"
runtimeOnly "ch.qos.logback:logback-classic"
runtimeOnly "org.yaml:snakeyaml"
runtimeOnly "io.micronaut.serde:micronaut-serde-jackson"
// runtimeOnly "io.micronaut:micronaut-jackson-databind"
testAnnotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "io.micronaut:micronaut-core-processor"
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
testCompileOnly "org.projectlombok:lombok"
testCompileOnly "io.micronaut:micronaut-inject-java"
testImplementation "io.micronaut.test:micronaut-test-junit5"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs = [
'-parameters',
'-Xlint:unchecked',
'-Xlint:deprecation'
]
options.fork = true
// options.forkOptions.jvmArgs += "-Dmicronaut.openapi.views.spec=swagger-ui.enabled=true,swagger-ui.js.url=/openapi/res/"
}
configurations.configureEach {
resolutionStrategy {
// dependencySubstitution {
// substitute(module("io.micronaut:micronaut-jackson-databind"))
// .using(module("io.micronaut.serde:micronaut-serde-jackson:1.3.2"))
// }
cacheDynamicVersionsFor 0, 'minutes'
cacheChangingModulesFor 0, 'minutes'
}
}
//compileJava {
// dependsOn("generateClientOpenApiApis", "generateClientOpenApiModels")
//}
/*
tasks.register("generateApi", org.openapitools.generator.gradle.plugin.tasks.GenerateTask.class) {
generatorName.set("spring")
library.set("spring-boot")
inputSpec.set("$rootDir/multiple/swagger.yml")
apiPackage.set("com.example.openapi.api")
modelPackage.set("com.example.openapi.api")
outputDir.set(layout.buildDirectory.dir("generated/openapi").get().toString())
// enablePostProcessFile.set(true)
skipOverwrite.set(false)
generateModelTests.set(false)
generateModelDocumentation.set(false)
generateApiTests.set(false)
generateApiDocumentation.set(false)
// skipValidateSpec.set(true)
configOptions.set([
"interfaceOnly" : "true",
"skipDefaultInterface" : "true",
"serializationLibrary" : "jackson",
"openApiNullable" : "false",
"serializableModel" : "true",
"useSpringBoot3" : "false",
"generateOneOfAnyOfWrappers" : "true",
// "useOneOfInterfaces" : "true",
"useBeanValidation" : "true",
"performBeanValidation" : "true",
])
group = "openapi tools"
}
*/