-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
72 lines (57 loc) · 1.58 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
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
}
plugins {
id "org.openapi.generator" version "4.3.1"
id "com.moowork.node" version "1.3.1"
}
Collection<File> generatedFiles = [
file("$project.projectDir/client-ts/api"),
file("$project.projectDir/client-ts/model"),
file("$project.projectDir/client-ts/api.module.ts"),
file("$project.projectDir/client-ts/configuration.ts"),
file("$project.projectDir/client-ts/encoder.ts"),
file("$project.projectDir/client-ts/variables.ts"),
]
File distDirectory = file("$project.projectDir/dist")
task cleanGenerated(type: Delete) {
delete(generatedFiles)
}
task cleanCompiled(type: Delete) {
delete(distDirectory)
}
task clean {
dependsOn(cleanGenerated, cleanCompiled)
}
task publish {
dependsOn(npm_publish)
}
ext {
specFile = file("$projectDir/api.spec.yaml")
}
task generateApi(type: GenerateTask, group: 'build') {
inputs.file(specFile)
outputs.files(generatedFiles)
generatorName = "typescript-angular"
inputSpec = specFile.toString()
skipValidateSpec = true
additionalProperties = [
modelPropertyNaming: "original",
]
outputDir = 'client-ts/'
}
node {
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/nodejs")
// Set the work directory for NPM
npmWorkDir = file("${project.buildDir}/npm")
// Set the work directory for Yarn
yarnWorkDir = file("${project.buildDir}/yarn")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}/client-ts")
}