forked from SleepyTrousers/EnderIO-1.5-1.12
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaddon.gradle
26 lines (24 loc) · 1.04 KB
/
addon.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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.vladsch.flexmark:flexmark:0.34.52'
classpath 'com.vladsch.flexmark:flexmark-pdf-converter:0.34.52'
}
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
processResources.doLast {
def resdir = new File(project.sourceSets.main.output.resourcesDir, "assets/enderio/config/recipes")
project.fileTree([dir: resdir, include: '*.xml']).files.each { file ->
def baseFilename = file.name.take(file.name.lastIndexOf('.'))
def inputFile = new File(resdir, "${baseFilename}.xml")
def outputFile = new File(resdir, "${baseFilename}.pdf")
com.vladsch.flexmark.pdf.converter.PdfConverterExtension.exportToPdf(outputFile.path,
"<html><head></head><body><div style='white-space:pre-wrap; font-family:monospace;'>" +
groovy.xml.XmlUtil.escapeXml(inputFile.text) +
"</div></body></html>", "", new com.vladsch.flexmark.util.options.MutableDataSet())
}
}