30 changed files with 865 additions and 325 deletions
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
|
||||
dependencies { |
||||
compile project(':spring-security-core'), |
||||
"org.springframework:spring-beans:$springVersion" |
||||
} |
||||
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
apply id: 'groovy' |
||||
|
||||
repositories { |
||||
mavenRepo name:'localRepo', urls: "file://" + System.properties['user.home'] + "/.m2/repository" |
||||
mavenCentral() |
||||
mavenRepo name:'Shibboleth Repo', urls:'http://shibboleth.internet2.edu/downloads/maven2' |
||||
} |
||||
|
||||
dependencies { |
||||
def fopDeps = [ 'org.apache.xmlgraphics:fop:0.95-1@jar', |
||||
'org.apache.xmlgraphics:xmlgraphics-commons:1.3', |
||||
'org.apache.xmlgraphics:batik-bridge:1.7@jar', |
||||
'org.apache.xmlgraphics:batik-util:1.7@jar', |
||||
'org.apache.xmlgraphics:batik-css:1.7@jar', |
||||
'org.apache.xmlgraphics:batik-dom:1.7', |
||||
'org.apache.xmlgraphics:batik-svg-dom:1.7@jar', |
||||
'org.apache.avalon.framework:avalon-framework-api:4.3.1'] |
||||
groovy localGroovy() |
||||
compile gradleApi(), |
||||
'org.apache.xerces:resolver:2.9.1', |
||||
'saxon:saxon:6.5.3', |
||||
'org.apache.xerces:xercesImpl:2.9.1', |
||||
fopDeps |
||||
|
||||
runtime 'net.sf.xslthl:xslthl:2.0.1', |
||||
'net.sf.docbook:docbook-xsl:1.75.2:resources@zip' |
||||
} |
||||
|
||||
task ide(type: Copy) { |
||||
from configurations.runtime |
||||
into 'ide' |
||||
} |
||||
@ -0,0 +1,266 @@
@@ -0,0 +1,266 @@
|
||||
package docbook; |
||||
|
||||
import org.gradle.api.Plugin; |
||||
import org.gradle.api.GradleException; |
||||
import org.gradle.api.DefaultTask; |
||||
import org.gradle.api.Task; |
||||
import org.gradle.api.Project; |
||||
import org.gradle.api.Action; |
||||
import org.gradle.api.tasks.*; |
||||
import org.gradle.api.file.FileCollection; |
||||
|
||||
import org.xml.sax.XMLReader; |
||||
import org.xml.sax.InputSource; |
||||
import org.apache.xml.resolver.CatalogManager; |
||||
import org.apache.xml.resolver.tools.CatalogResolver; |
||||
|
||||
import javax.xml.parsers.SAXParserFactory; |
||||
import javax.xml.transform.*; |
||||
import javax.xml.transform.sax.SAXSource; |
||||
import javax.xml.transform.sax.SAXResult; |
||||
import javax.xml.transform.stream.StreamResult; |
||||
import javax.xml.transform.stream.StreamSource; |
||||
import java.io.*; |
||||
import java.util.*; |
||||
import java.util.zip.*; |
||||
import java.net.*; |
||||
|
||||
import org.apache.fop.apps.*; |
||||
|
||||
import com.icl.saxon.TransformerFactoryImpl; |
||||
|
||||
/** |
||||
* Gradle Docbook plugin implementation. |
||||
* <p> |
||||
* Creates three tasks: docbookHtml, docbookHtmlSingle and docbookPdf. Each task takes a single File on |
||||
* which it operates. |
||||
*/ |
||||
class DocbookPlugin implements Plugin<Project> { |
||||
public void use(Project project) { |
||||
// Add the plugin tasks to the project |
||||
Task docbookHtml = project.tasks.add('docbookHtml', DocbookHtml.class); |
||||
docbookHtml.setDescription('Generates chunked docbook html output'); |
||||
|
||||
Task docbookHtmlSingle = project.tasks.add('docbookHtmlSingle', Docbook.class); |
||||
docbookHtmlSingle.setDescription('Generates single page docbook html output') |
||||
docbookHtmlSingle.suffix = '-single' |
||||
|
||||
Task docbookFoPdf = project.tasks.add("docbookFoPdf", DocbookFoPdf.class); |
||||
docbookFoPdf.setDescription('Generates PDF output'); |
||||
docbookFoPdf.extension = 'fo' |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public class Docbook extends DefaultTask { |
||||
|
||||
@Input |
||||
String extension = 'html'; |
||||
|
||||
@Input |
||||
String suffix = ''; |
||||
|
||||
@Input |
||||
boolean XIncludeAware = true; |
||||
|
||||
@Input |
||||
boolean highlightingEnabled = true; |
||||
|
||||
String admonGraphicsPath; |
||||
|
||||
@InputDirectory |
||||
File sourceDirectory = new File(project.getProjectDir(), "src/docbook"); |
||||
|
||||
@Input |
||||
String sourceFileName; |
||||
|
||||
@InputFile |
||||
File stylesheet; |
||||
|
||||
@OutputDirectory |
||||
File docsDir = new File(project.getBuildDir(), "docs"); |
||||
|
||||
@TaskAction |
||||
public final void transform() { |
||||
SAXParserFactory factory = new org.apache.xerces.jaxp.SAXParserFactoryImpl(); |
||||
factory.setXIncludeAware(XIncludeAware); |
||||
docsDir.mkdirs(); |
||||
|
||||
File srcFile = new File(sourceDirectory, sourceFileName); |
||||
String outputFilename = srcFile.getName().substring(0, srcFile.getName().length() - 4) + suffix + '.' + extension; |
||||
|
||||
File outputFile = new File(getDocsDir(), outputFilename); |
||||
|
||||
Result result = new StreamResult(outputFile.getAbsolutePath()); |
||||
CatalogResolver resolver = new CatalogResolver(createCatalogManager()); |
||||
InputSource inputSource = new InputSource(srcFile.getAbsolutePath()); |
||||
|
||||
XMLReader reader = factory.newSAXParser().getXMLReader(); |
||||
reader.setEntityResolver(resolver); |
||||
TransformerFactory transformerFactory = new TransformerFactoryImpl(); |
||||
transformerFactory.setURIResolver(resolver); |
||||
URL url = stylesheet.toURL(); |
||||
Source source = new StreamSource(url.openStream(), url.toExternalForm()); |
||||
Transformer transformer = transformerFactory.newTransformer(source); |
||||
|
||||
if (highlightingEnabled) { |
||||
File highlightingDir = new File(getProject().getBuildDir(), "highlighting"); |
||||
if (!highlightingDir.exists()) { |
||||
highlightingDir.mkdirs(); |
||||
extractHighlightFiles(highlightingDir); |
||||
} |
||||
|
||||
transformer.setParameter("highlight.xslthl.config", new File(highlightingDir, "xslthl-config.xml").toURI().toURL()); |
||||
|
||||
if (admonGraphicsPath != null) { |
||||
transformer.setParameter("admon.graphics", "1"); |
||||
transformer.setParameter("admon.graphics.path", admonGraphicsPath); |
||||
} |
||||
} |
||||
|
||||
preTransform(transformer, srcFile, outputFile); |
||||
|
||||
transformer.transform(new SAXSource(reader, inputSource), result); |
||||
|
||||
postTransform(outputFile); |
||||
} |
||||
|
||||
private void extractHighlightFiles(File toDir) { |
||||
URLClassLoader cl = (URLClassLoader) getClass().getClassLoader(); |
||||
URL[] urls = cl.getURLs(); |
||||
URL docbookZip = null; |
||||
|
||||
for (URL url : urls) { |
||||
if (url.toString().contains("docbook-xsl-")) { |
||||
docbookZip = url; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
if (docbookZip == null) { |
||||
throw new GradleException("Docbook zip file not found"); |
||||
} |
||||
|
||||
ZipFile zipFile = new ZipFile(new File(docbookZip.toURI())); |
||||
|
||||
Enumeration e = zipFile.entries(); |
||||
while (e.hasMoreElements()) { |
||||
ZipEntry ze = (ZipEntry) e.nextElement(); |
||||
if (ze.getName().matches(".*/highlighting/.*\\.xml")) { |
||||
String filename = ze.getName().substring(ze.getName().lastIndexOf("/highlighting/") + 14); |
||||
copyFile(zipFile.getInputStream(ze), new File(toDir, filename)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private void copyFile(InputStream source, File destFile) { |
||||
destFile.createNewFile(); |
||||
FileOutputStream to = null; |
||||
try { |
||||
to = new FileOutputStream(destFile); |
||||
byte[] buffer = new byte[4096]; |
||||
int bytesRead; |
||||
|
||||
while ((bytesRead = source.read(buffer)) > 0) { |
||||
to.write(buffer, 0, bytesRead); |
||||
} |
||||
} finally { |
||||
if (source != null) { |
||||
source.close(); |
||||
} |
||||
if (to != null) { |
||||
to.close(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
protected void preTransform(Transformer transformer, File sourceFile, File outputFile) { |
||||
} |
||||
|
||||
protected void postTransform(File outputFile) { |
||||
} |
||||
|
||||
private CatalogManager createCatalogManager() { |
||||
CatalogManager manager = new CatalogManager(); |
||||
manager.setIgnoreMissingProperties(true); |
||||
ClassLoader classLoader = this.getClass().getClassLoader(); |
||||
StringBuilder builder = new StringBuilder(); |
||||
String docbookCatalogName = "docbook/catalog.xml"; |
||||
URL docbookCatalog = classLoader.getResource(docbookCatalogName); |
||||
|
||||
if (docbookCatalog == null) { |
||||
throw new IllegalStateException("Docbook catalog " + docbookCatalogName + " could not be found in " + classLoader); |
||||
} |
||||
|
||||
builder.append(docbookCatalog.toExternalForm()); |
||||
|
||||
Enumeration enumeration = classLoader.getResources("/catalog.xml"); |
||||
while (enumeration.hasMoreElements()) { |
||||
builder.append(';'); |
||||
URL resource = (URL) enumeration.nextElement(); |
||||
builder.append(resource.toExternalForm()); |
||||
} |
||||
String catalogFiles = builder.toString(); |
||||
manager.setCatalogFiles(catalogFiles); |
||||
return manager; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
class DocbookHtml extends Docbook { |
||||
|
||||
@Override |
||||
protected void preTransform(Transformer transformer, File sourceFile, File outputFile) { |
||||
String rootFilename = outputFile.getName(); |
||||
rootFilename = rootFilename.substring(0, rootFilename.lastIndexOf('.')); |
||||
transformer.setParameter("root.filename", rootFilename); |
||||
transformer.setParameter("base.dir", outputFile.getParent() + File.separator); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
class DocbookFoPdf extends Docbook { |
||||
|
||||
/** |
||||
* <a href="http://xmlgraphics.apache.org/fop/0.95/embedding.html#render">From the FOP usage guide</a> |
||||
*/ |
||||
@Override |
||||
protected void postTransform(File foFile) { |
||||
FopFactory fopFactory = FopFactory.newInstance(); |
||||
|
||||
OutputStream out = null; |
||||
final File pdfFile = getPdfOutputFile(foFile); |
||||
logger.debug("Transforming 'fo' file "+ foFile + " to PDF: " + pdfFile); |
||||
|
||||
try { |
||||
out = new BufferedOutputStream(new FileOutputStream(pdfFile)); |
||||
|
||||
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out); |
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance(); |
||||
Transformer transformer = factory.newTransformer(); |
||||
|
||||
Source src = new StreamSource(foFile); |
||||
|
||||
Result res = new SAXResult(fop.getDefaultHandler()); |
||||
|
||||
transformer.transform(src, res); |
||||
} finally { |
||||
if (out != null) { |
||||
out.close(); |
||||
} |
||||
} |
||||
|
||||
if (!foFile.delete()) { |
||||
logger.warn("Failed to delete 'fo' file " + foFile); |
||||
} |
||||
} |
||||
|
||||
private File getPdfOutputFile(File foFile) { |
||||
String name = foFile.getAbsolutePath(); |
||||
return new File(name.substring(0, name.length() - 2) + "pdf"); |
||||
} |
||||
} |
||||
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
implementation-class=docbook.DocbookPlugin |
||||
@ -1,101 +1,101 @@
@@ -1,101 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
xmlns:xslthl="http://xslthl.sf.net" |
||||
exclude-result-prefixes="xslthl" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> |
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/highlight.xsl"/> |
||||
|
||||
<!--xsl:param name="use.id.as.filename">'1'</xsl:param--> |
||||
|
||||
<!-- Use code syntax highlighting --> |
||||
<xsl:param name="highlight.source">1</xsl:param> |
||||
|
||||
<!-- Extensions |
||||
<xsl:param name="use.extensions">1</xsl:param> |
||||
<xsl:param name="tablecolumns.extension">0</xsl:param> |
||||
<xsl:param name="callout.extensions">1</xsl:param> |
||||
xmlns:xslthl="http://xslthl.sf.net" |
||||
exclude-result-prefixes="xslthl" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> |
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/highlight.xsl"/> |
||||
|
||||
<!--xsl:param name="use.id.as.filename">'1'</xsl:param--> |
||||
|
||||
<!-- Use code syntax highlighting --> |
||||
<xsl:param name="highlight.source">1</xsl:param> |
||||
|
||||
<!-- Extensions |
||||
<xsl:param name="use.extensions">1</xsl:param> |
||||
<xsl:param name="tablecolumns.extension">0</xsl:param> |
||||
<xsl:param name="callout.extensions">1</xsl:param> |
||||
--> |
||||
<!-- Activate Graphics |
||||
<xsl:param name="admon.graphics" select="1"/> |
||||
<xsl:param name="admon.graphics.path">images/</xsl:param> |
||||
<xsl:param name="admon.graphics.extension">.gif</xsl:param> |
||||
<xsl:param name="callout.graphics" select="1" /> |
||||
<xsl:param name="callout.defaultcolumn">120</xsl:param> |
||||
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param> |
||||
<xsl:param name="callout.graphics.extension">.gif</xsl:param> |
||||
--> |
||||
<xsl:param name="table.borders.with.css" select="1"/> |
||||
<xsl:param name="html.stylesheet">css/faq.css</xsl:param> |
||||
<xsl:param name="html.stylesheet.type">text/css</xsl:param> |
||||
|
||||
<!--xsl:param name="generate.toc">book toc,title</xsl:param--> |
||||
<!-- Activate Graphics |
||||
<xsl:param name="admon.graphics" select="1"/> |
||||
<xsl:param name="admon.graphics.path">images/</xsl:param> |
||||
<xsl:param name="admon.graphics.extension">.gif</xsl:param> |
||||
<xsl:param name="callout.graphics" select="1" /> |
||||
<xsl:param name="callout.defaultcolumn">120</xsl:param> |
||||
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param> |
||||
<xsl:param name="callout.graphics.extension">.gif</xsl:param> |
||||
--> |
||||
<xsl:param name="table.borders.with.css" select="1"/> |
||||
<xsl:param name="html.stylesheet">css/faq.css</xsl:param> |
||||
<xsl:param name="html.stylesheet.type">text/css</xsl:param> |
||||
|
||||
<!--xsl:param name="generate.toc">book toc,title</xsl:param--> |
||||
<!-- |
||||
<xsl:param name="admonition.title.properties">text-align: left</xsl:param> |
||||
<xsl:param name="admonition.title.properties">text-align: left</xsl:param> |
||||
|
||||
<xsl:param name="section.label.includes.component.label" select="1"/> |
||||
<xsl:param name="table.footnote.number.format" select="'1'"/> |
||||
<xsl:param name="section.label.includes.component.label" select="1"/> |
||||
<xsl:param name="table.footnote.number.format" select="'1'"/> |
||||
--> |
||||
<xsl:template match='xslthl:keyword' mode="xslthl"> |
||||
<span class="hl-keyword"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:oneline-comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:multiline-comment' mode="xslthl"> |
||||
<span class="hl-multiline-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:tag' mode="xslthl"> |
||||
<span class="hl-tag"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:attribute' mode="xslthl"> |
||||
<span class="hl-attribute"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:value' mode="xslthl"> |
||||
<span class="hl-value"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:string' mode="xslthl"> |
||||
<span class="hl-string"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<!-- Google Analytics --> |
||||
<xsl:template name="user.head.content"> |
||||
<xsl:comment>Begin Google Analytics code</xsl:comment> |
||||
<script type="text/javascript"> |
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
||||
</script> |
||||
<script type="text/javascript"> |
||||
var pageTracker = _gat._getTracker("UA-2728886-3"); |
||||
pageTracker._setDomainName("none"); |
||||
pageTracker._setAllowLinker(true); |
||||
pageTracker._trackPageview(); |
||||
</script> |
||||
<xsl:comment>End Google Analytics code</xsl:comment> |
||||
</xsl:template> |
||||
|
||||
<!-- Loopfuse --> |
||||
<xsl:template name="user.footer.content"> |
||||
<xsl:comment>Begin LoopFuse code</xsl:comment> |
||||
<script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"> |
||||
</script> |
||||
<script type="text/javascript"> |
||||
_lf_cid = "LF_48be82fa"; |
||||
_lf_remora(); |
||||
</script> |
||||
<xsl:comment>End LoopFuse code</xsl:comment> |
||||
</xsl:template> |
||||
<xsl:template match='xslthl:keyword' mode="xslthl"> |
||||
<span class="hl-keyword"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:oneline-comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:multiline-comment' mode="xslthl"> |
||||
<span class="hl-multiline-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:tag' mode="xslthl"> |
||||
<span class="hl-tag"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:attribute' mode="xslthl"> |
||||
<span class="hl-attribute"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:value' mode="xslthl"> |
||||
<span class="hl-value"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:string' mode="xslthl"> |
||||
<span class="hl-string"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<!-- Google Analytics --> |
||||
<xsl:template name="user.head.content"> |
||||
<xsl:comment>Begin Google Analytics code</xsl:comment> |
||||
<script type="text/javascript"> |
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
||||
</script> |
||||
<script type="text/javascript"> |
||||
var pageTracker = _gat._getTracker("UA-2728886-3"); |
||||
pageTracker._setDomainName("none"); |
||||
pageTracker._setAllowLinker(true); |
||||
pageTracker._trackPageview(); |
||||
</script> |
||||
<xsl:comment>End Google Analytics code</xsl:comment> |
||||
</xsl:template> |
||||
|
||||
<!-- Loopfuse --> |
||||
<xsl:template name="user.footer.content"> |
||||
<xsl:comment>Begin LoopFuse code</xsl:comment> |
||||
<script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"> |
||||
</script> |
||||
<script type="text/javascript"> |
||||
_lf_cid = "LF_48be82fa"; |
||||
_lf_remora(); |
||||
</script> |
||||
<xsl:comment>End LoopFuse code</xsl:comment> |
||||
</xsl:template> |
||||
|
||||
</xsl:stylesheet> |
||||
@ -0,0 +1,142 @@
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<!-- |
||||
Licensed to the Apache Software Foundation (ASF) under one |
||||
or more contributor license agreements. See the NOTICE file |
||||
distributed with this work for additional information |
||||
regarding copyright ownership. The ASF licenses this file |
||||
to you 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. |
||||
--> |
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||
xmlns:xslthl="http://xslthl.sf.net" |
||||
exclude-result-prefixes="xslthl" |
||||
version='1.0'> |
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> |
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/highlight.xsl"/> |
||||
|
||||
<!-- Only use scaling in FO --> |
||||
<xsl:param name="ignore.image.scaling">1</xsl:param> |
||||
|
||||
<!-- Use code syntax highlighting --> |
||||
<xsl:param name="highlight.source">1</xsl:param> |
||||
|
||||
<!-- Extensions --> |
||||
<xsl:param name="use.extensions">1</xsl:param> |
||||
<xsl:param name="tablecolumns.extension">0</xsl:param> |
||||
<xsl:param name="callout.extensions">1</xsl:param> |
||||
|
||||
<!-- Activate Graphics --> |
||||
<xsl:param name="admon.graphics" select="1"/> |
||||
<xsl:param name="admon.graphics.path">images/</xsl:param> |
||||
<xsl:param name="admon.graphics.extension">.png</xsl:param> |
||||
<xsl:param name="callout.graphics" select="1" /> |
||||
<xsl:param name="callout.defaultcolumn">120</xsl:param> |
||||
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param> |
||||
<xsl:param name="callout.graphics.extension">.png</xsl:param> |
||||
|
||||
<xsl:param name="table.borders.with.css" select="1"/> |
||||
<xsl:param name="html.stylesheet">css/manual.css</xsl:param> |
||||
<xsl:param name="html.stylesheet.type">text/css</xsl:param> |
||||
<xsl:param name="generate.toc">book toc,title</xsl:param> |
||||
|
||||
<xsl:param name="admonition.title.properties">text-align: left</xsl:param> |
||||
|
||||
<!-- Leave image paths as relative when navigating XInclude --> |
||||
<xsl:param name="keep.relative.image.uris" select="1"/> |
||||
|
||||
<!-- Label Chapters and Sections (numbering) --> |
||||
<xsl:param name="chapter.autolabel" select="1"/> |
||||
<xsl:param name="section.autolabel" select="1"/> |
||||
<xsl:param name="section.autolabel.max.depth" select="2"/> |
||||
|
||||
<xsl:param name="section.label.includes.component.label" select="1"/> |
||||
<xsl:param name="table.footnote.number.format" select="'1'"/> |
||||
|
||||
<!-- Show only Sections up to level 2 in the TOCs --> |
||||
<xsl:param name="toc.section.depth">2</xsl:param> |
||||
|
||||
<!-- Remove "Chapter" from the Chapter titles... --> |
||||
<xsl:param name="local.l10n.xml" select="document('')"/> |
||||
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> |
||||
<l:l10n language="en"> |
||||
<l:context name="title-numbered"> |
||||
<l:template name="chapter" text="%n. %t"/> |
||||
<l:template name="section" text="%n %t"/> |
||||
</l:context> |
||||
</l:l10n> |
||||
</l:i18n> |
||||
|
||||
<xsl:template match='xslthl:keyword' mode="xslthl"> |
||||
<span class="hl-keyword"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:oneline-comment' mode="xslthl"> |
||||
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:multiline-comment' mode="xslthl"> |
||||
<span class="hl-multiline-comment"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:tag' mode="xslthl"> |
||||
<span class="hl-tag"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:attribute' mode="xslthl"> |
||||
<span class="hl-attribute"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:value' mode="xslthl"> |
||||
<span class="hl-value"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<xsl:template match='xslthl:string' mode="xslthl"> |
||||
<span class="hl-string"><xsl:apply-templates mode="xslthl"/></span> |
||||
</xsl:template> |
||||
|
||||
<!-- Google Analytics --> |
||||
<xsl:template name="user.head.content"> |
||||
<xsl:comment>Begin Google Analytics code</xsl:comment> |
||||
<script type="text/javascript"> |
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
||||
</script> |
||||
<script type="text/javascript"> |
||||
var pageTracker = _gat._getTracker("UA-2728886-3"); |
||||
pageTracker._setDomainName("none"); |
||||
pageTracker._setAllowLinker(true); |
||||
pageTracker._trackPageview(); |
||||
</script> |
||||
<xsl:comment>End Google Analytics code</xsl:comment> |
||||
</xsl:template> |
||||
|
||||
<!-- Loopfuse --> |
||||
<xsl:template name="user.footer.content"> |
||||
<xsl:comment>Begin LoopFuse code</xsl:comment> |
||||
<script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"> |
||||
</script> |
||||
<script type="text/javascript"> |
||||
_lf_cid = "LF_48be82fa"; |
||||
_lf_remora(); |
||||
</script> |
||||
<xsl:comment>End LoopFuse code</xsl:comment> |
||||
</xsl:template> |
||||
|
||||
</xsl:stylesheet> |
||||
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
apply id: 'java' |
||||
|
||||
configurations { |
||||
ajtools |
||||
aspectpath |
||||
} |
||||
|
||||
dependencies { |
||||
ajtools "org.aspectj:aspectjtools:$aspectjVersion" |
||||
compile "org.aspectj:aspectjrt:$aspectjVersion" |
||||
} |
||||
|
||||
task compileJava(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME, overwrite: true, description: 'Compiles AspectJ Source') << { |
||||
println "Running ajc ..." |
||||
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties", classpath: configurations.ajtools.asPath) |
||||
ant.iajc(classpath: configurations.compile.asPath, fork: 'true', destDir: sourceSets.main.classesDir.absolutePath, source: sourceCompatibility, target: targetCompatibility, |
||||
aspectPath: configurations.aspectpath.asPath, sourceRootCopyFilter: '**/*.java') { |
||||
sourceroots { |
||||
sourceSets.main.java.srcDirs.each { |
||||
pathelement(location: it.absolutePath) |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
import java.util.jar.Manifest |
||||
import org.gradle.api.tasks.bundling.GradleManifest |
||||
|
||||
apply id: 'java' |
||||
|
||||
configurations { |
||||
bundlor |
||||
} |
||||
|
||||
dependencies { |
||||
bundlor 'com.springsource.bundlor:com.springsource.bundlor.ant:1.0.0.RELEASE', |
||||
'com.springsource.bundlor:com.springsource.bundlor:1.0.0.RELEASE', |
||||
'com.springsource.bundlor:com.springsource.bundlor.blint:1.0.0.RELEASE' |
||||
} |
||||
|
||||
task bundlor(dependsOn: compileJava) { |
||||
onlyIf { |
||||
dependsOnTaskDidWork() |
||||
} |
||||
doFirst { |
||||
ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath) |
||||
File template = new File(projectDir, 'template.mf') |
||||
mkdir(buildDir, 'bundlor') |
||||
if (template.exists()) { |
||||
ant.bundlor(inputPath: sourceSets.main.classesDir, outputPath: "$buildDir/bundlor", manifestTemplatePath: template) { |
||||
property(name: 'version', value: "$version") |
||||
property(name: 'spring.version', value: "$springVersion") |
||||
} |
||||
// See GRADLE-395 for support for using an existing manifest |
||||
jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/bundlor/META-INF/MANIFEST.MF").newInputStream())) |
||||
} |
||||
} |
||||
} |
||||
|
||||
jar.dependsOn bundlor |
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
apply id: 'java' |
||||
|
||||
springVersion = '3.0.1.RELEASE' |
||||
springLdapVersion = '1.3.0.RELEASE' |
||||
ehcacheVersion = '1.6.2' |
||||
aspectjVersion = '1.6.8' |
||||
apacheDsVersion = '1.5.5' |
||||
jstlVersion = '1.1.2' |
||||
jettyVersion = '6.1.22' |
||||
hsqlVersion = '1.8.0.10' |
||||
|
||||
configurations { |
||||
provided |
||||
compile.extendsFrom provided |
||||
} |
||||
|
||||
dependencies { |
||||
compile 'commons-logging:commons-logging:1.1.1' |
||||
|
||||
compile ("org.springframework:spring-core:$springVersion") { |
||||
exclude(group: 'commons-logging', module: 'commons-logging') |
||||
} |
||||
|
||||
testCompile 'junit:junit:4.7', |
||||
'org.mockito:mockito-core:1.7', |
||||
'org.jmock:jmock:2.5.1', |
||||
'org.jmock:jmock-junit4:2.5.1', |
||||
'org.hamcrest:hamcrest-core:1.1', |
||||
'org.hamcrest:hamcrest-library:1.1', |
||||
"org.springframework:spring-test:$springVersion" |
||||
} |
||||
|
||||
test { |
||||
onlyIf { |
||||
!project.hasProperty('skipTests') |
||||
} |
||||
jvmArgs = ['-ea', '-Xms128m', '-Xmx500m', '-XX:MaxPermSize=128m'] |
||||
} |
||||
|
||||
@ -0,0 +1,72 @@
@@ -0,0 +1,72 @@
|
||||
apply id: 'maven' |
||||
|
||||
// Create a source jar for uploading |
||||
task sourceJar(type: Jar) { |
||||
classifier = 'sources' |
||||
from sourceSets.main.java |
||||
} |
||||
|
||||
configurations { |
||||
deployerJars |
||||
} |
||||
|
||||
artifacts { |
||||
archives sourceJar |
||||
} |
||||
|
||||
dependencies { |
||||
deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE" |
||||
} |
||||
|
||||
gradle.taskGraph.whenReady {graph -> |
||||
if (graph.hasTask(uploadArchives)) { |
||||
// check properties defined and fail early |
||||
s3AccessKey |
||||
s3SecretAccessKey |
||||
} |
||||
} |
||||
|
||||
def deployer = null |
||||
|
||||
uploadArchives { |
||||
deployer = repositories.mavenDeployer { |
||||
configuration = configurations.deployerJars |
||||
} |
||||
doFirst { |
||||
if (releaseBuild) { |
||||
// "mavenSyncRepoDir" should be set in properties |
||||
repository(url: mavenSyncRepoDir) |
||||
} else { |
||||
s3credentials = [userName: s3AccessKey, passphrase: s3SecretAccessKey] |
||||
repository(url: "s3://maven.springframework.org/milestone") { |
||||
authentication(s3credentials) |
||||
} |
||||
snapshotRepository(url: "s3://maven.springframework.org/snapshot") { |
||||
authentication(s3credentials) |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Pom Customization |
||||
|
||||
installer = install.repositories.mavenInstaller |
||||
|
||||
def optionalDeps = ['commons-logging', 'ehcache', 'log4j', 'apacheds-core', 'jsp-api', 'jsr250-api', 'ldapsdk'] |
||||
|
||||
[installer, deployer]*.pom.collect { pom -> |
||||
pom.scopeMappings.addMapping(10, configurations.provided, 'provided') |
||||
} |
||||
|
||||
[installer, deployer]*.pom*.whenConfigured { pom -> |
||||
pom.dependencies.findAll { dep -> |
||||
optionalDeps.contains(dep.artifactId) || |
||||
dep.groupId.startsWith('org.apache.directory') || |
||||
dep.groupId.startsWith('org.slf4j') |
||||
}*.optional = true |
||||
|
||||
if (pom.artifactId == 'spring-security-config') { |
||||
pom.dependencies.find { dep -> dep.artifactId == 'spring-security-web'}.optional = true |
||||
pom.dependencies.find { dep -> dep.artifactId == 'spring-web'}.optional = true |
||||
} |
||||
} |
||||
Loading…
Reference in new issue