This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
build.gradle
72 lines (61 loc) · 2.25 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
apply plugin: 'application'
group = 'org.asciidoctor'
version = '1.0.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal() // snags valid artifacts from local Maven repository
}
configurations {
dist
}
dependencies {
// xml-resolver needed to fix buggy resolver in JDK
runtime 'xml-resolver:xml-resolver:1.2'
// avalon dependencies need to be specified to align with version available
compile 'org.apache.avalon.framework:avalon-framework-api:4.3.1'
compile 'org.apache.avalon.framework:avalon-framework-impl:4.3.1'
compile 'org.apache.xmlgraphics:fop:2.1'
runtime 'net.sourceforge.jeuclid:jeuclid-fop:3.1.9'
runtime 'net.sf.xslthl:xslthl:2.1.0'
// To enable hyphenation, uncomment the next line, then run `./gradlew clean` then use `./fopub`
//runtime 'net.sf.offo:fop-hyph:2.0'
dist 'net.sf.docbook:docbook-xsl:1.79.1:ns-resources@zip'
dist 'org.neo4j.build.plugins:neo4j-docbook-xml:4.5'
}
mainClassName = 'org.apache.fop.cli.Main'
applicationDefaultJvmArgs = ['-Dxml.catalog.files=APP_DIR/catalog.xml']
//applicationDefaultJvmArgs = ['-Dxml.catalog.files=/etc/xml/catalog']
installDist {
destinationDir = file("$buildDir/${project.name}")
}
task extractDocbookXsl(type: Copy) {
def archive = configurations.dist.find { it.name.endsWith('docbook-xsl-1.79.1-ns-resources.zip') }
def outputDir = file("$buildDir/unpacked/docbook")
from(zipTree(archive)) {
// strip root docbook/ directory
eachFile { it.path = it.path.substring(it.relativePath.segments[0].length()) }
}
into outputDir
includeEmptyDirs = false
}
task extractDocbookXml(type: Copy) {
def archive = configurations.dist.find { it.name.endsWith('docbook-xml-4.5.jar') }
def outputDir = file("$buildDir/unpacked/docbook-dtds")
from(zipTree(archive))
into outputDir
}
// put the official DocBook resources (XSL, images, etc) into the dist
applicationDistribution.from(extractDocbookXsl) {
into "docbook"
}
// put the DocBook DTDs into the dist
applicationDistribution.from(extractDocbookXml) {
into "docbook/xml-dtd-4.5"
}
CreateStartScripts startScripts = project.startScripts
startScripts.with {
doLast {
unixScript.text = unixScript.text.replaceFirst('APP_DIR', '\\$APP_DIR')
windowsScript.text = windowsScript.text.replaceFirst('APP_DIR', '%APP_DIR%')
}
}