forked from ePages-de/restdocs-raml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
78 lines (64 loc) · 2.44 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
import com.bmuschko.gradle.docker.tasks.container.DockerCreateContainer
import com.bmuschko.gradle.docker.tasks.container.DockerStartContainer
import com.bmuschko.gradle.docker.tasks.image.DockerPullImage
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.5.9.RELEASE'
classpath 'com.epages:restdocs-raml-gradle-plugin:0.2.10'
classpath 'com.bmuschko:gradle-docker-plugin:3.2.0'
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'eclipse'
apply plugin: 'com.epages.restdocs-raml'
apply plugin: 'com.bmuschko.docker-remote-api'
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/epages/maven/' }
mavenLocal()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.epages'
dependencies {
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'org.springframework.boot:spring-boot-starter-hateoas'
runtime 'com.h2database:h2'
runtime 'org.atteo:evo-inflector:1.2.2'
testCompile 'com.epages:restdocs-raml:0.2.10'
testCompile 'org.json:json:20170516'
testCompile 'com.jayway.jsonpath:json-path'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'
testCompile 'org.raml:raml-parser-2:1.0.15'
}
ramldoc {
apiTitle = 'Notes'
apiBaseUri = 'http://localhost:8080/'
ramlVersion = "1.0"
}
//use mattjtodd/raml2html to generate html out of api.raml
task('pullRaml2Html', type:DockerPullImage, dependsOn: 'ramldoc') {
description = 'Pulls docker pull mattjtodd/raml2html'
repository = 'mattjtodd/raml2html'
tag = '6.3.0'
}
task('createRaml2HtmlContainer', type:DockerCreateContainer, dependsOn: 'pullRaml2Html') {
description = 'Creates container to generate HTML out of the RAML file'
targetImageId { tasks.pullRaml2Html.repository + ':' + tasks.pullRaml2Html.tag }
binds = ["${project.file('build/ramldoc').path}":'/raml']
cmd = ['--rm', '-i', '/raml/api.raml', '-o', '/raml/api.raml.html']
}
task('raml2html', type:DockerStartContainer, dependsOn: 'createRaml2HtmlContainer') {
description = 'Starts container to generate HTML out of the RAML file'
targetContainerId { tasks.createRaml2HtmlContainer.containerId }
}
task wrapper(type: Wrapper) {
gradleVersion = '4.3'
}