-
Notifications
You must be signed in to change notification settings - Fork 16
/
documentation.gradle
48 lines (45 loc) · 1.42 KB
/
documentation.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
import org.apache.tools.ant.filters.ReplaceTokens
def ramlToCopy = copySpec {
from('src/main/resources') {
include 'api-definition.yaml'
into 'static/referencedata/docs'
rename { 'api-definition.raml' }
filter(ReplaceTokens, tokens: [
baseUrl: "http://localhost",
version: 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: version])
}
from('src/main/resources/schemas') {
include '*.json'
into 'schemas'
}
// those files are needed by Api Console
from('src/main/resources/schemas') {
include '*.json'
into 'static/referencedata/docs/schemas'
}
from('src/main/resources/schemas/fhir') {
include '*.json'
into 'static/referencedata/docs/schemas/fhir'
}
// those files are needed by IT
from('src/main/resources/schemas/fhir') {
include '*.json'
into 'schemas/fhir'
rename '([A-Z][a-z]+).schema.json', '$1'
}
}
task copyRamlToBuild(type:Copy) {
with ramlToCopy
into 'build/resources/main'
}
project.tasks['npm_run_runApiHtmlConverter'].dependsOn copyRamlToBuild