forked from alextkachman/GPars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs.gradle
90 lines (79 loc) · 2.83 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
/*
* Copyright 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Andres Almiray, Jan Novotny, Marcel Matula, Michal Bernhard
*/
buildscript {
repositories {
mavenCentral()
mavenRepo name: 'SpringSource', urls: 'http://repository.springsource.com/maven/bundles/release'
mavenRepo name: 'JavaNet', urls: 'http://download.java.net/maven/2/'
}
dependencies {
classpath("org.grails:grails-docs:1.3.6") { transitive = false }
classpath("org.xhtmlrenderer:core-renderer:R8") { transitive = false }
classpath("com.lowagie:itext:2.0.8") { transitive = false }
classpath("radeox:radeox:1.0-b2") { transitive = false }
}
}
task buildGuide(type: Copy) {
def manualSrc = 'grails-doc/src' as File
destinationDir = "$buildDir/manual" as File
from(manualSrc) {
include '*.properties'
}
doLast {
ant.taskdef(name: 'docs', classname: 'grails.doc.ant.DocPublisherTask', classpath: configurations.docs.asPath);
ant.docs(src: 'grails-doc/src',
dest: "$buildDir/manual",
properties: "grails-doc/src/doc.properties",
styleDir: new File('grails-doc/resources/style'),
cssDir: new File('grails-doc/resources/css'),
imagesDir: new File('grails-doc/resources/img')
)
}
}
task pdfGuide(type: Copy) {
dependsOn { buildGuide }
inputs.dir("$buildDir/manual" as File)
outputs.files "$buildDir/manual/guide.pdf"
doFirst {
try {
grails.doc.PdfBuilder.build(
basedir: buildDir.absolutePath,
home: project.file('grails-doc').absolutePath,
tool: 'pdf/gpars'
)
} catch (x) {
// it's very likely that the stream is closed before
// the renderer 'finishes' but it actually does
// ignore for now
}
}
destinationDir = "$buildDir/manual" as File
from "$buildDir/manual/guide/"
include '*.pdf'
rename 'single.pdf', "gpars-guide-${version}.pdf"
doLast {
delete "$buildDir/manual/doc.properties"
delete "$buildDir/manual/guide/single.pdf"
}
}
task zipGuide(type: Zip) {
dependsOn { [pdfGuide] }
appendix = 'guide'
from "$buildDir/manual"
}