-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
58 lines (52 loc) · 2.19 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
import com.github.kongchen.swagger.docgen.mavenplugin.ApiSource
import com.github.zhurlik.SwaggerTask
import io.swagger.models.Contact
import io.swagger.models.Info
import io.swagger.models.License
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath fileTree(dir: '../build/libs',
includes: ['gradle-swagger-plugin-*.jar'])
// swagger
classpath group: 'io.swagger', name: 'swagger-core', version: '1.5.+'
classpath group: 'com.github.kongchen', name: 'swagger-maven-plugin', version: '3.1.+'
}
}
apply plugin: 'com.github.zhurlik.swagger'
task('swaggertest', type: SwaggerTask) {
// any dirs with classes
classesDirs = [
file('classes/main')
// project(':your-project').sourceSets['main'].output.classesDir
]
apiSources = [
new ApiSource(
springmvc: false,
locations: ['com/github/kongchen/swagger/sample/wordnik/resource'],
schemes: ['http', 'https'],
host: 'petstore.swagger.wordnik.com',
basePath: '/api',
info: new Info(
title: 'Swagger Maven Plugin Sample',
version: 'v1',
description: 'This is a sample for swagger-maven-plugin',
termsOfService: 'http://www.github.com/kongchen/swagger-maven-plugin',
contact: new Contact(
email: '[email protected]',
name: 'Kong Chen',
url: 'http://kongch.com'
),
license: new License(
url: 'http://www.apache.org/licenses/LICENSE-2.0.html',
name: 'Apache 2.0'
)
),
outputPath: file("${buildDir}/swagger/document.html").path,
swaggerDirectory: file("${buildDir}/swagger/swagger-ui").path,
templatePath: file("templates/strapdown.html.hbs")
)
]
}