This repository has been archived by the owner on Apr 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
70 lines (60 loc) · 2.43 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
plugins {
id 'java'
id 'org.hidetake.swagger.generator' version '2.18.1'
id 'maven'
}
group = "pl.edu.agh.papaya"
version = "1.1.0-SNAPSHOT"
repositories {
mavenLocal()
mavenCentral()
}
sourceCompatibility = '8'
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web:2.1.3.RELEASE'
compile 'org.threeten:threetenbp:1.3.8'
compile 'io.swagger.core.v3:swagger-annotations:2.0.7'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.4'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.4'
compile 'com.github.joschi.jackson:jackson-datatype-threetenbp:2.6.4'
compile 'javax.xml.bind:jaxb-api:2.3.1'
compile 'io.springfox:springfox-swagger2:2.9.2'
// client dependencies
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
compile 'com.squareup.okio:okio:2.2.2'
compile 'com.google.code.gson:gson:2.8.5'
compile 'io.gsonfire:gson-fire:1.8.3'
swaggerCodegen 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.8'
}
swaggerSources {
papaya {
inputFile = file("$buildDir/resources/main/api.yaml")
code {
language = 'spring'
configFile = file("$buildDir/resources/main/config.json")
dependsOn validation
}
}
papayaClient {
inputFile = file("$buildDir/resources/main/api.yaml")
code {
language = 'java'
configFile = file("$buildDir/resources/main/config-client.json")
dependsOn validation
}
}
}
/* The swagger validation step is skipped due to an issue with enum references - despite them being utilized correctly
by the swagger code generation task */
validateSwaggerPapaya.enabled = false
validateSwaggerPapayaClient.enabled = false
sourceSets.main.java.srcDirs += "${swaggerSources.papaya.code.outputDir}/src/main/java"
sourceSets.main.resources.srcDirs += "${swaggerSources.papaya.code.outputDir}/src/main/resources"
sourceSets.main.java.srcDirs += "${swaggerSources.papayaClient.code.outputDir}/src/main/java"
sourceSets.main.resources.srcDirs += "${swaggerSources.papayaClient.code.outputDir}/src/main/resources"
compileJava.dependsOn(generateSwaggerCode)
validateSwaggerPapaya.dependsOn(processResources)
generateSwaggerCodePapaya.dependsOn(processResources)
validateSwaggerPapayaClient.dependsOn(processResources)
generateSwaggerCodePapayaClient.dependsOn(processResources)