-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocumentation.gradle
More file actions
55 lines (49 loc) · 1.46 KB
/
documentation.gradle
File metadata and controls
55 lines (49 loc) · 1.46 KB
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
import org.apache.tools.ant.filters.ReplaceTokens
def ramlToCopy = copySpec {
from('src/main/resources') {
include 'api-definition.yaml'
into 'static/hapifhir/docs'
rename { 'api-definition.raml' }
filter(ReplaceTokens, tokens: [
baseUrl: "http://localhost",
version: project.version
])
filter { line ->
line.replaceAll("\"schemas(.*).json\"", "\"#/schemas\$1\"")
}
}
from('src/main/resources') {
include 'api-definition.yaml'
rename { 'api-definition-raml.yaml' }
filter(ReplaceTokens, tokens: [
baseUrl: "http://localhost",
version: project.version
])
}
from('src/main/resources/schemas') {
include '*.json'
into 'schemas'
}
from('src/main/resources/schemas') {
include '*.json'
into 'static/hapifhir/docs/schemas'
}
}
tasks.register('copyRamlToBuild', Copy) {
group = 'documentation'
with ramlToCopy
into 'build/resources/main'
}
tasks.register('ramlToHtml', Exec) {
group = 'documentation'
description = 'Convert RAML to HTML document'
dependsOn 'npmInstall', 'copyRamlToBuild'
commandLine 'npm', 'run', 'runApiHtmlConverter'
}
tasks.register('copyRamlHtmlToBuild', Copy) {
group = 'documentation'
dependsOn 'ramlToHtml'
from 'build/resources/main'
include 'api-definition.html'
into 'build/resources/main'
}