forked from spring-attic/spring-social-facebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs.gradle
124 lines (103 loc) · 3.66 KB
/
docs.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Docbook and Javadoc building and uploading tasks
apply plugin: 'base'
description = "Spring Social Facebook - Documentation"
task docs {
dependsOn 'manual:asciidoctor', 'apidocs'
}
project('manual') {
description = "Spring Social Facebook - Manual"
apply plugin: 'base'
apply plugin: 'asciidoctor'
ext.expandPlaceholders = ""
asciidoctor {
options = [
eruby: 'erubis',
attributes: [
copycss : '',
icons : 'font',
'source-highlighter': 'prettify',
sectanchors : '',
toc2: '',
idprefix: '',
idseparator: '-',
doctype: 'book',
numbered: '',
'spring-social-facebook-version' : project.version,
'spring-social-version' : springSocialVersion,
'spring-version' : springVersion,
'spring-security-version' : springSecurityCryptoVersion,
'jacksonVersion' : jacksonVersion,
revnumber : project.version
]
]
}
ext.spec = copySpec {
into ('reference/htmlsingle') {
from(asciidoctor.outputDir)
exclude 'build', 'Guardfile'
}
}
}
task apidocs(type: Javadoc) {
destinationDir = new File(buildDir, 'apidocs')
title = "Spring Social Facebook $version API"
source coreModuleProjects.collect { project ->
project.sourceSets.main.allJava
}
classpath = files(coreModuleProjects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
apidocs.options.outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
apidocs.options.links = [
"http://static.springframework.org/spring/docs/3.2.x/javadoc-api",
"http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
"http://download.oracle.com/javase/6/docs/api/"
]
apidocs.options.groups = [
'API Binding':['org.springframework.social.facebook.api*'],
'Connection Framework Support':['org.springframework.social.facebook.connect'],
'Configuration Support':['org.springframework.social.facebook.config*'],
'Spring Security Integration':['org.springframework.social.facebook.security'],
'Web Support':['org.springframework.social.facebook.web']
]
ext.apiSpec = copySpec {
into('apidocs') {
from(apidocs.destinationDir)
}
}
assemble.dependsOn = [apidocs, 'manual:asciidoctor']
task docsZip(type: Zip) {
dependsOn docs
group = 'Distribution'
baseName = rootProject.name
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-social/site/docs."
with(project(':docs').apiSpec)
with(project(':docs:manual').spec)
}
task schemaZip(type: Zip) {
group = 'Distribution'
baseName = rootProject.name
classifier = 'schema'
description = "Builds -${classifier} archive containing all " +
"XSDs for deployment at static.springframework.org/schema."
coreModuleProjects.each { module ->
def Properties schemas = new Properties();
module.sourceSets.main.resources.find {
it.path.endsWith('META-INF/spring.schemas')
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
assert shortName != key
File xsdFile = module.sourceSets.main.resources.find {
it.path.endsWith(schemas.get(key))
}
assert xsdFile != null
into (shortName) {
from xsdFile.path
}
}
}
}