-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
88 lines (78 loc) · 3.11 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
plugins {
id 'org.springframework.boot' version '2.5.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'groovy'
id "com.github.johnrengelman.processes" version "0.5.0"
id "org.springdoc.openapi-gradle-plugin" version "1.3.2"
id "org.openapi.generator" version "5.1.1"
}
apply plugin: "com.github.johnrengelman.processes"
apply plugin: "org.springdoc.openapi-gradle-plugin"
apply plugin: 'org.openapi.generator'
group = 'me.spring'
version = '0.1'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
implementation("org.openapitools:openapi-generator-gradle-plugin:5.1.1") {
exclude module: "slf4j-simple"
}
implementation('org.springdoc:springdoc-openapi-groovy:1.5.2')
implementation('org.springdoc:springdoc-openapi-ui:1.5.2')
implementation('org.springframework.data:spring-data-elasticsearch')
implementation('org.elasticsearch:elasticsearch')
implementation('org.elasticsearch.client:elasticsearch-rest-high-level-client')
implementation('org.springframework:spring-webflux')
implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.codehaus.groovy:groovy')
implementation('org.springframework.kafka:spring-kafka')
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation('org.springframework.kafka:spring-kafka-test')
testImplementation('org.codehaus.groovy:groovy')
testImplementation('org.spockframework:spock-core:2.0-groovy-3.0')
testImplementation(group: 'org.spockframework', name: 'spock-spring', version: '2.0-groovy-3.0')
testImplementation(group: 'org.codehaus.groovy', name: 'groovy-json', version: '3.0.8')
testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test')
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
exclude "**/Kafka**"
}
openApi {
outputDir.set(file("$buildDir/generated/docs"))
outputFileName.set("api-definition.yaml")
waitTimeInSeconds.set(15)
}
openApiGenerate {
generatorName = "asciidoc"
inputSpec = "$buildDir/generated/docs/api-definition.yaml".toString()
outputDir = "$buildDir/generated/docs".toString()
configOptions = [
dateLibrary : "java8",
appDescription : "This is a demo for OpenApi with Groovy",
appName : project.name,
useIntroduction: "true"
]
}
task openApiGroovy(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
generatorName = "python"
inputSpec = "$buildDir/generated/docs/api-definition.yaml".toString()
outputDir = "$buildDir/generated/sources-py".toString()
}
bootRun.dependsOn(['openApiGenerate', 'openApiGroovy'])
build.dependsOn(['openApiGenerate', 'openApiGroovy'])
tasks.openApiGenerate.dependsOn('generateOpenApiDocs')
tasks.openApiGroovy.dependsOn('generateOpenApiDocs')