forked from turbet/ext-typescript-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
62 lines (47 loc) · 1.43 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
// Run at command line using 'gradle -q'
defaultTasks 'build'
class ConfigGroups {
static EXTJS_5_1_1 = [ name: "ExtJS", version: "5.1.1", jsonDocPath: "../generated-jsondoc/", customNamespace: null ]
}
// Project-level extra properties
project.ext {
def currentConfigGroup = ConfigGroups.EXTJS_5_1_1
config = new Config(
libraryName: currentConfigGroup.name,
libraryVersion: currentConfigGroup.version,
jsonDocPath: currentConfigGroup.jsonDocPath,
singleDefinition: true,
useFullTyping: true,
interfaceOnly: true,
includePrivate: false,
forceAllParamsToOptional: true,
outputPath: "../d.ts",
omitOverrideComments: true,
customNamespace: currentConfigGroup.customNamespace
)
}
// TASKS
task wrapper( type: Wrapper ) {
gradleVersion = '1.4'
}
task initialize() << {
Config config = project.config
println " "
println "Creating ${ config.libraryName } ${ config.libraryVersion } Definition File..."
println "Using JSON docs from: ${ config.jsonDocPath }"
println " "
}
task readFiles( dependsOn: initialize ) << {
Config config = project.config
LibraryProcessor processor = new LibraryProcessor( config: config )
processor.init()
def jsonDocPath = file( config.jsonDocPath )
def jsonDocCollection = files { jsonDocPath.listFiles() }
def jsonDocFiles = jsonDocCollection.getFiles()
processor.iterateFiles( jsonDocFiles )
}
task build( dependsOn: readFiles ) << {
println " "
println "Build complete"
println " "
}