-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
134 lines (112 loc) · 3.15 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
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
125
126
127
128
129
130
131
132
133
134
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.2'
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:0.1.5'
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-beta1'
classpath 'commons-httpclient:commons-httpclient:3.1'
classpath 'com.bluepapa32:gradle-watch-plugin:0.1.4' // watch files and perform action
}
}
apply plugin: 'com.github.jruby-gradle.base'
apply plugin: 'org.ysb33r.vfs'
apply plugin: 'java'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'idea'
apply plugin: 'com.bluepapa32.watch'
ext {
revealjsVersion = 'master'
asciidoctorBackendVersion = 'title-slide'
downloadDir = new File(buildDir, 'download')
templateDir = new File(downloadDir, 'templates')
revealjsDir = new File(downloadDir, 'reveal.js')
}
repositories {
jcenter()
}
dependencies {
gems 'rubygems:asciidoctor-diagram:1.3.0.preview.3'
gems 'rubygems:slim:2.1.0'
gems 'rubygems:thread_safe:0.3.4'
}
task download << {
mkdir downloadDir
vfs {
cp "zip:https://github.com/danhyun/asciidoctor-reveal.js/archive/${asciidoctorBackendVersion}.zip!asciidoctor-reveal.js-${asciidoctorBackendVersion}",
templateDir, recursive: true, overwrite: true
cp "zip:https://github.com/hakimel/reveal.js/archive/${revealjsVersion}.zip!reveal.js-${revealjsVersion}",
revealjsDir, recursive: true, overwrite: true
}
}
download {
description "Download extra revealjs resources"
outputs.dir templateDir
outputs.dir revealjsDir
}
asciidoctor {
dependsOn jrubyPrepareGems
gemPath = jrubyPrepareGems.outputDir
requires = ['asciidoctor-diagram']
sources {
include 'index.adoc'
}
resources {
from(sourceDir) {
include 'images/**'
}
from(downloadDir) {
include 'reveal.js/**'
}
}
backends 'revealjs'
attributes 'sourcedir': project.sourceSets.main.java.srcDirs[0],
'source-highlighter': 'coderay',
'imagesdir': './images',
'toc': 'left',
'icons': 'font',
'setanchors': 'true',
'idprefix': '',
'idseparator': '-',
'docinfo1': 'true',
'revealjs_transition': 'linear',
'revealjs_history': 'true',
'revealjs_slideNumber': 'true',
'revealjs_theme': 'black',
'title-slide-background-image': 'lead.png',
'slide-background-image': 'bg.png',
'slide-background-position': 'bottom left',
'slide-background-size': 'cover',
'title-slide-background-size': 'contain',
'title-background-position': 'bottom left',
'title-slide-background-color': 'black'
options template_dirs: [new File(templateDir, 'templates/slim').absolutePath]
dependsOn download
}
idea {
project {
jdkName "1.8"
languageLevel "1.8"
ipr {
withXml { provider ->
def node = provider.asNode()
node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
}
}
}
}
watch {
asciidoc {
files fileTree(dir: 'src')
tasks 'asciidoctor'
}
}
task publish(type: GradleBuild) {
buildFile = 'publish.gradle'
tasks = ['publishGhPages']
System.setProperty('jna.nosys', "true")
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}