-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
115 lines (98 loc) · 2.82 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.0'
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-beta1'
classpath 'commons-httpclient:commons-httpclient:3.1'
}
}
plugins {
id 'org.asciidoctor.convert' version '1.5.2'
id 'com.github.jruby-gradle.base' version '0.1.5'
}
apply plugin: 'com.github.jruby-gradle.base'
apply plugin: 'org.ysb33r.vfs'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
ext {
revealjsVersion = '3.2.0'
asciidoctorBackendVersion = 'master'
downloadDir = new File(buildDir,'download')
templateDir = new File(downloadDir,'templates')
revealjsDir = new File(downloadDir,'reveal.js')
highlightjs = new File(downloadDir, 'highlight.js')
}
dependencies {
repositories {
jcenter()
mavenCentral()
}
gems 'rubygems:slim:2.1.0'
gems 'rubygems:thread_safe:0.3.4'
// java
compile('org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final')
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task download << {
mkdir downloadDir
vfs {
cp "zip:https://github.com/asciidoctor/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
cp "http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/highlight.min.js",
highlightjs, recursive:true, overwrite:true
}
copy {
from highlightjs
into "${revealjsDir}/plugin/highlight"
}
}
download {
description "Download extra revealjs resources"
outputs.dir templateDir
outputs.dir revealjsDir
}
asciidoctor {
dependsOn jrubyPrepareGems
sources {
include '*.adoc'
}
sourceDir 'src/docs'
resources {
from (sourceDir) {
include 'images/**'
}
from (downloadDir) {
include 'reveal.js/**'
}
}
backends 'revealjs'
attributes 'build-gradle': file('build.gradle'),
'sourcedir': project.sourceSets.main.java.srcDirs[0],
'endpoint-url': 'http://localhost',
'source-highlighter' : 'highlightjs',
'imagesdir':'./images',
'toc':'left',
'icons': 'font',
'setanchors':'true',
'idprefix':'',
'idseparator':'-',
'docinfo1':'true',
'revealjs_theme':'night',
'revealjs_transition':'default',
'revealjs_history':'true',
'revealjs_slideNumber':'true'
options template_dirs: [new File(templateDir, 'templates/slim').absolutePath]
dependsOn download
}
defaultTasks 'asciidoctor'