-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
67 lines (52 loc) · 2.01 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
// Run at command line using 'gradle -q'
defaultTasks 'build'
class ConfigGroups {
static TEST = [ name: "ExtJS", version: "4.2.1", jsonDocPath: "./jsondocs_ExtJS_4.2.1", customNamespace: null ]
static EXTJS_4_2_0 = [ name: "ExtJS", version: "4.2.0", jsonDocPath: "./jsondocs_ExtJS_4.2.0", customNamespace: null ]
static EXTJS_4_2_1 = [ name: "ExtJS", version: "4.2.1", jsonDocPath: "./jsondocs_ExtJS_4.2.1", customNamespace: null ]
static TOUCH_2_2_1 = [ name: "Touch", version: "2.2.1", jsonDocPath: "./jsondocs_Touch_2.2.1", customNamespace: null ]
static TOUCH_2_3_1 = [ name: "Touch", version: "2.3.1", jsonDocPath: "./jsondocs_Touch_2.3.1", customNamespace: null ]
static DEFTJS_0_9 = [ name: "DeftJS", version: "0.9", jsonDocPath: "./jsondocs_DeftJS_0.9", customNamespace: "Deft" ]
}
// Project-level extra properties
project.ext {
def currentConfigGroup = ConfigGroups.TOUCH_2_3_1
config = new Config(
libraryName: currentConfigGroup.name,
libraryVersion: currentConfigGroup.version,
jsonDocPath: currentConfigGroup.jsonDocPath,
singleDefinition: true,
useFullTyping: true,
interfaceOnly: true,
includePrivate: false,
forceAllParamsToOptional: true,
outputPath: "./target",
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 " "
}