-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
guide.gradle
78 lines (68 loc) · 2.49 KB
/
guide.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
apply plugin: 'org.asciidoctor.gradle.asciidoctor'
apply plugin: 'github-pages'
javadoc {
excludes = ['**/*.html', 'META-INF/**']
options.use = true
options.splitIndex = true
options.encoding = 'UTF-8'
options.author = true
options.version = true
options.windowTitle = "${project.name} ${project.version} API"
options.docTitle = "${project.name} ${project.version} API"
options.footer = javadocFooter
options.links = ['http://www.slf4j.org/apidocs/',
'http://junit.org/javadoc/latest/',
'http://docs.oracle.com/javase/7/docs/api/']
}
task jarApi(type: Jar, dependsOn: javadoc) {
archiveName = "${project.name}-${project.version}-javadoc.jar"
destinationDir = "$buildDir/assemble/jars" as File
from "$buildDir/api"
}
asciidoctor {
baseDir = project.file('guide/src/asciidoc')
sourceDir = project.file('guide/src/asciidoc')
options = [
attributes: [
toc : 'left',
doctype : 'book',
icons : 'font',
encoding : 'utf-8',
sectlink : true,
sectanchors : true,
numbered : true,
linkattrs : true,
imagesdir : 'images',
linkcss : true,
'source-highlighter' : 'coderay',
'coderay-linenums-mode' : 'inline',
'project-author' : 'Andres Almiray',
'project-url' : project.project_url,
'project-vcs' : project.project_scm,
'project-issue-tracker' : project.project_issues,
]
]
sourceDocumentNames = files('guide/src/asciidoc/index.adoc')
}
task guide(type: Copy, dependsOn: [javadoc, asciidoctor]) {
destinationDir = "$buildDir/guide" as File
from(javadoc.outputs) { into 'api' }
from("$buildDir/asciidoc")
}
task guideZip(type: Zip, dependsOn: guide) {
baseName = "${project.name}-guide"
from "$buildDir/guide"
}
if (!project.hasProperty('githubUsername')) ext.githubUsername = ''
if (!project.hasProperty('githubPassword')) ext.githubPassword = ''
githubPages {
repoUri = project.project_url
pages {
from guide.outputs.files
}
credentials {
username = githubUsername
password = githubPassword
}
}
publishGhPages.dependsOn(guide)