-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
52 lines (45 loc) · 1.63 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
buildscript {
repositories {
mavenCentral()
}
}
plugins {
/// Download task for FFMPEG binaries download
id 'de.undercouch.download' version '5.3.1'
/// OpenAPI Generator for Frontend internal api generation
id 'org.openapi.generator' version '5.2.0'
}
/// Variables used for Open API generation.
def fullOAS = 'http://localhost:8080/openapi.json'
def clientOAS = 'http://localhost:8080/clientapi.json'
def oasFile = "${project.projectDir}/doc/oas.json"
def clientOasFile = "${project.projectDir}/doc/oas-client.json"
/// Generates the openapi frontend bindings
openApiGenerate {
/// Source command:
/// openapi-generator generate -g typescript-angular -i http://localhost:8080/swagger-docs -o openapi --skip-validate-spec --additional-properties npmName=@dres-openapi/api,snapshot=true,ngVersion=9.1.0
generateApiTests = false // No tests please
generateModelTests = false // No tests please
validateSpec = false // No validation please (as in command above)
skipValidateSpec = true
generatorName = 'typescript-angular'
inputSpec = oasFile
outputDir = file("${project.projectDir}/frontend/openapi").toString()
configOptions = [
npmName: '@dres-openapi/api',
ngVersion: '15.2.9',
snapshot: 'true', /// I suggest to remove this, as soon as we automate this,
enumPropertyNaming: 'original'
]
}
tasks.register('generateOAS', Download) {
/* Requires DRES running on default port */
def f = new File(oasFile)
src fullOAS
dest f
}
tasks.register('generateClientOAS', Download) {
def f = new File(clientOasFile)
src clientOAS
dest f
}