Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added base for gaelyk shortcuts generator

  • Loading branch information...
commit 8fc6b315acf51681ff8f874e50a399ffe4aa535c 1 parent 4584df5
@musketyr musketyr authored
View
1  core/.gitignore
@@ -8,3 +8,4 @@ WEB-INF
*.iml
*.ipr
*.iws
+target
View
0  ...n/groovyx/gaelyk/extensions/MiscExtensions.groovy → ...ain/groovyx/gaelyk/extensions/MiscExtensions.java
File renamed without changes
View
8 gaelyk-docgenerator/build.gradle
@@ -0,0 +1,8 @@
+apply from: '../common.gradle'
+
+dependencies {
+ compile "org.codehaus.groovy:groovy-all:${ext.gaelykGroovyVersion}", {
+ force = true
+ }
+ compile "com.thoughtworks.qdox:qdox:1.12.1"
+}
View
463 gaelyk-docgenerator/src/main/groovy/groovyx/gaelyk/tools/docs/DocGenerator.groovy
@@ -0,0 +1,463 @@
+/*
+ * Copyright 2003-2012 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.
+ */
+package groovyx.gaelyk.tools.docs
+
+import groovy.json.JsonBuilder;
+
+import org.codehaus.groovy.runtime.DefaultGroovyMethods
+import com.thoughtworks.qdox.JavaDocBuilder
+
+import org.codehaus.groovy.tools.shell.util.Logger
+
+/**
+ * Generate documentation about the methods provided by Gaelyk
+ * that enhance the standard JDK classes, Java Servlet classes
+ * and Google App Engine clases.
+ *
+ * This classes is based on Groovy's GDK generator.
+ *
+ * @author Guillaume Laforge, John Wilson, Bernhard Huber, Paul King, Vladimir Orany
+ */
+class DocGenerator {
+ private static final String PRIMITIVE_TYPE_PSEUDO_PACKAGE = 'primitive-types'
+ private static final String GAELYK_SHORTCUTS_DOCS_ENV_VAR = 'GAELYK_SHORTCUTS_DOCS'
+
+ private static final Logger log = Logger.create(DocGenerator)
+
+ private final String TITLE = "Gaelyk Shortcuts"
+
+ def sourceFiles = []
+ File outputFolder
+ JavaDocBuilder builder
+ // categorize all groovy methods per core JDK class to which it applies
+ def jdkEnhancedClasses = [:]
+ def packages = [:]
+ def sortedPackages
+
+ DocGenerator(sourceFiles, File outputFolder) {
+ this.sourceFiles = sourceFiles
+ this.outputFolder = outputFolder
+ parse()
+ }
+
+ /**
+ * Parse the DefaultGroovyMethods class to build a graph representing the structure of the class,
+ * with its methods, javadoc comments and tags.
+ */
+ private void parse() {
+ builder = new JavaDocBuilder()
+ sourceFiles.each {
+ if (it.exists()) {
+ builder.addSource(it.newReader())
+ log.debug "adding reader for $it"
+ } else log.debug "not found, skipping: $it.path"
+ }
+
+ def sources = builder.getSources()
+
+ def methods = []
+ sources.each {source ->
+ def classes = source.getClasses()
+ classes.each {aClass ->
+ methods.addAll(aClass.methods.findAll { !it.annotations.any { it.type.fullQualifiedName == 'java.lang.Deprecated' } })
+ }
+ }
+
+ for (method in methods) {
+ if (method.isPublic() && method.isStatic()) {
+ def parameters = method.getParameters()
+ def jdkClass = parameters[0].getType().toString()
+ if (jdkEnhancedClasses.containsKey(jdkClass)) {
+ List l = jdkEnhancedClasses[jdkClass];
+ l.add(method)
+ } else {
+ jdkEnhancedClasses[jdkClass] = [method]
+ }
+ }
+ }
+
+ jdkEnhancedClasses.keySet().each {className ->
+ def thePackage = className.contains(".") ? className.replaceFirst(/\.[^\.]*$/, "") : ""
+ if (!packages.containsKey(thePackage)) {
+ packages[thePackage] = []
+ }
+ packages[thePackage] << className
+ }
+ sortedPackages = new TreeSet(packages.keySet())
+ }
+
+ /**
+ * Builds an HTML page from the structure of DefaultGroovyMethods.
+ */
+ def generateNew() {
+ def engine = new groovy.text.SimpleTemplateEngine()
+
+ new File(outputFolder, 'shortcuts.json').withWriter { Writer writer ->
+ def shortcuts = [:]
+
+ sortedPackages.each { String pkg ->
+ List<String> classes = packages[pkg]
+ pkg = pkg ?: 'primitive-types'
+ def infos = [:]
+ classes.each { String cls ->
+ infos[cls] = getClassInfo(pkg, cls)
+ }
+ shortcuts[pkg] = infos
+ }
+
+ JsonBuilder json = new JsonBuilder()
+ json shortcuts
+ json.writeTo(writer)
+ }
+
+ // the index
+ def templateIndex = createTemplate(engine, 'index.html')
+ def out = new File(outputFolder, 'index.html')
+ def binding = [packages: sortedPackages]
+ out.withWriter {
+ it << templateIndex.make(binding)
+ }
+ // the overview
+ def templateOverview = createTemplate(engine, 'overview-summary.html')
+ out = new File(outputFolder, 'overview-summary.html')
+ binding = [packages: sortedPackages]
+ out.withWriter {
+ it << templateOverview.make(binding)
+ }
+
+ def templateOverviewFrame = createTemplate(engine, 'template.overview-frame.html')
+ out = new File(outputFolder, 'overview-frame.html')
+ binding = [packages: sortedPackages, title: TITLE]
+ out.withWriter {
+ it << templateOverviewFrame.make(binding)
+ }
+
+ // the package list
+ out = new File(outputFolder, 'package-list')
+ out.withWriter { writer ->
+ packages.keySet().findAll{ it }.each{ writer.println it }
+ }
+
+ // the allclasses-frame.html
+ def templateAllClasses = createTemplate(engine, 'template.allclasses-frame.html')
+ out = new File(outputFolder, 'allclasses-frame.html')
+ def fixPrimitivePackage = {className -> className.contains('.') ? className : "${PRIMITIVE_TYPE_PSEUDO_PACKAGE}.$className"}
+ binding = [classes: jdkEnhancedClasses.keySet().collect(fixPrimitivePackage).sort {it.replaceAll('.*\\.', '')}]
+ out.withWriter {
+ it << templateAllClasses.make(binding)
+ }
+
+ // the package-frame.html for each package
+ def templatePackageFrame = createTemplate(engine, 'template.package-frame.html')
+ packages.each {curPackage, packageClasses ->
+ def packageName = curPackage ?: PRIMITIVE_TYPE_PSEUDO_PACKAGE
+ generatePackageFrame(templatePackageFrame, packageName, packageClasses)
+ }
+
+ // the class.html for each class
+ def templateClass = createTemplate(engine, 'template.class.html')
+ packages.each {curPackage, packageClasses ->
+ def packageName = curPackage ?: PRIMITIVE_TYPE_PSEUDO_PACKAGE
+ packageClasses.each {
+ generateClassDetails(templateClass, packageName, it)
+ }
+ }
+
+ // the index-all.html
+ def templateIndexAll = createTemplate(engine, 'template.index-all.html')
+ out = new File(outputFolder, 'index-all.html')
+ binding = ['indexMap': generateIndex(packages), title: TITLE]
+ out.withWriter {
+ it << templateIndexAll.make(binding)
+ }
+ }
+
+ /**
+ * Generate an index.
+ * <p>
+ * This method creates a index map indexed by the first letter of the
+ * method in upper case, the map value is a list of methods.
+ * <p>
+ * e.g.: 'A' : [ m1, m2, m3 .. ]
+ * The values m1, m2, m3 are sorted by the method name, and the parameter signature.
+ * The method names of m1, m2, m3 start either with 'a', or 'A'.
+ *
+ * @return index
+ */
+ private def generateIndex(def packages) {
+ def index = []
+ packages.each {curPackage, packageClasses ->
+ def packageName = curPackage ? curPackage : 'primitive-types'
+ packageClasses.each {className ->
+ def listOfMethods = jdkEnhancedClasses[className]
+ listOfMethods.each {method ->
+ def methodName = method.name
+ final String simpleClassName = className.replaceAll('.*\\.', '')
+ index.add([
+ 'index': methodName.getAt(0).toUpperCase(),
+ 'packageName': packageName,
+ 'simpleClassName': simpleClassName,
+ 'class': packageName + '.' + simpleClassName,
+ 'method': method,
+ 'parametersSignature': getParametersDecl(method),
+ 'shortComment': linkify(getFirstSentence(getComment(method)), curPackage),
+ ])
+ }
+ }
+ }
+ def indexMap = new TreeMap()
+ def methodNameComparator = [compare: {a, b ->
+ final String aMethodAndSignature = a.method.name + ' ' + getParametersDecl(a.method)
+ final String bMethodAndSignature = b.method.name + ' ' + getParametersDecl(b.method)
+
+ return aMethodAndSignature.compareTo(bMethodAndSignature)
+ }] as Comparator
+
+ for (indexEntry in index) {
+ final String key = indexEntry['index']
+ if (indexMap.containsKey(key)) {
+ def indexEntryList = indexMap.get(key)
+ indexEntryList.add(indexEntry)
+ } else {
+ final TreeSet indexEntryList = new TreeSet(methodNameComparator)
+ indexEntryList.add(indexEntry)
+ indexMap.put(key, indexEntryList)
+ }
+ }
+ return indexMap
+ }
+
+ private getFirstSentence(text) {
+ def boundary = java.text.BreakIterator.getSentenceInstance(Locale.getDefault()) // todo - allow locale to be passed in
+ boundary.setText(text)
+ int start = boundary.first()
+ int end = boundary.next()
+ if (start > -1 && end > -1) {
+ text = text.substring(start, end)
+ }
+ text
+ }
+
+ private generateClassDetails(template, curPackage, aClass) {
+ def packagePath = generatePackagePath(curPackage)
+ def dir = new File(outputFolder, packagePath)
+ dir.mkdirs()
+ def out = new File(dir, aClass.replaceAll('.*\\.', '') + '.html')
+ def binding = getClassInfo(curPackage, aClass)
+ out.withWriter {
+ it << template.make(binding)
+ }
+ }
+
+ private Map getClassInfo(String pkg, String clazz) {
+ def listOfMethods = jdkEnhancedClasses[clazz].sort {it.name}
+ def methods = []
+ listOfMethods.each {method ->
+ def parameters = method.getTagsByName("param").collect {
+ [name: it.value.replaceAll(' .*', ''), comment: linkify(it.value.replaceAll('^\\w*', ''), pkg)]
+ }
+ if (parameters)
+ parameters.remove(0) // method is static, first arg is the "real this"
+
+ def seeComments = method.getTagsByName("see").collect { [target: getDocUrl(it.value, pkg)]}
+
+ def returnType = getReturnType(method)
+ def comment = getComment(method)
+ def methodInfo = [
+ name: method.name,
+ comment: linkify(comment, pkg),
+ shortComment: linkify(getFirstSentence(comment), pkg),
+ returnComment: method.getTagByName("return")?.getValue() ?: '',
+ seeComments: seeComments,
+ returnTypeDocUrl: getDocUrl(returnType, pkg),
+ parametersSignature: getParametersDecl(method),
+ parametersDocUrl: getParametersDocUrl(method, pkg),
+ parameters: parameters,
+ isStatic: method.parentClass.name == 'DefaultGroovyStaticMethods',
+ since: method.getTagByName("since")?.getValue() ?: null
+ ]
+ methods << methodInfo
+ }
+
+ def binding = [
+ className: clazz.replaceAll(/.*\./, ''),
+ packageName: pkg,
+ methods: methods,
+ title: TITLE
+ ]
+ return binding
+ }
+
+ private String getParametersDocUrl(method, curPackage) {
+ getParameters(method).collect {"${getDocUrl(it.type.toString(), curPackage)} $it.name"}.join(", ")
+ }
+
+ private String getDocUrl(type, curPackage) {
+ def inGdk = false
+ if (type.startsWith('#')) {
+ def matchNameArgs = /#([^(]*)\(([^)]+)\)/
+ def m = type =~ matchNameArgs
+ def name = m[0][1]
+ def args = m[0][2].split(/,\s?/).toList()
+ def first = args.remove(0)
+ type = "$first#$name(${args.join(', ')})".toString()
+ inGdk = true
+ }
+ if (type in ['T', 'U', 'V', 'K', 'V']) {
+ type = "java.lang.Object"
+ } else if (type == 'T[]') {
+ type = "java.lang.Object[]"
+ }
+ if (!type.contains('.')) {
+ return type
+ }
+ def target = type.split('#')
+ def shortClassName = target[0].replaceAll(/.*\./, "")
+ def packageName = (shortClassName.size() == target[0].size()) ? "DefaultPackage" : target[0][0..(-shortClassName.size() - 2)]
+ shortClassName += (target.size() > 1 ? '#' + target[1].split('\\(')[0] : '')
+ def apiBaseUrl, title
+ if (inGdk) {
+ apiBaseUrl = ""
+ curPackage.split('\\.').size().times { apiBaseUrl += '../'}
+ title = "GDK enhancement for ${target[0]}"
+ } else if (type.startsWith("groovy") || type.startsWith("org.codehaus.groovy")) {
+ apiBaseUrl = "http://groovy.codehaus.org/api/"
+ title = "Groovy class in $packageName"
+ } else {
+ apiBaseUrl = "http://java.sun.com/j2se/1.5.0/docs/api/"
+ title = "JDK class in $packageName"
+ }
+
+ def url = apiBaseUrl + target[0].replace('.', '/') + '.html' + (target.size() > 1 ? '#' + target[1] : '')
+ return "<a href='$url' title='$title'>$shortClassName</a>"
+ }
+
+ private generatePackagePath(curPackage) {
+ def fileSep = File.separator
+ // need to escape separator on windows for regex's sake
+ if (fileSep == '\\') fileSep *= 2
+ return curPackage.replaceAll('\\.', fileSep)
+ }
+
+ private generatePackageFrame(templatePackageFrame, curPackage, packageClasses) {
+ def packagePath = generatePackagePath(curPackage)
+ def dir = new File(outputFolder, packagePath)
+ dir.mkdirs()
+ def out = new File(dir, 'package-frame.html')
+ def binding = [classes: packageClasses.sort().collect {it.replaceAll(/.*\./, '')},
+ packageName: curPackage]
+ out.withWriter {
+ it << templatePackageFrame.make(binding)
+ }
+ }
+
+ def createTemplate(templateEngine, resourceFile) {
+// def resourceUrl = getClass().getClassLoader().getResource(resourceFile)
+ def resourceUrl = getClass().getResource(resourceFile)
+ return templateEngine.createTemplate(resourceUrl.text)
+ }
+
+ /**
+ * Retrieves a String representing the return type
+ */
+ private getReturnType(method) {
+ def returnType = method.getReturns()
+
+ if (returnType != null) {
+ return returnType.toString()
+ } else {
+ return ""
+ }
+ }
+
+ /**
+ * Retrieve a String representing the declaration of the parameters of the method passed as parameter.
+ *
+ * @param method a method
+ * @return the declaration of the method (long version)
+ */
+ private getParametersDecl(method) {
+ getParameters(method).collect {"${it.getType()}"}.join(", ")
+ }
+
+ /**
+ * Retrieve the parameters of the method.
+ *
+ * @param method a method
+ * @return a list of parameters without the first one
+ */
+ private getParameters(method) {
+ if (method.getParameters().size() > 1)
+ return method.getParameters().toList()[1..-1]
+ else
+ return []
+ }
+
+ /**
+ * Retrieve the JavaDoc comment associated with the method passed as parameter.
+ *
+ * @param method a method
+ * @return the JavaDoc comment associated with this method
+ */
+ private getComment(method) {
+ def ans = method.getComment()
+ if (ans == null) return ""
+ return ans
+ }
+
+ private linkify(orig, curPackage) {
+ orig.replaceAll(/\{@link\s+([^}]*)\s*\}/) {all, link -> getDocUrl(link, curPackage) }
+ }
+
+ /**
+ * Main entry point.
+ */
+ static void main(args) {
+ def outFolder = new File(System.getenv(GAELYK_SHORTCUTS_DOCS_ENV_VAR) ?: "target/html/gaelyk-shortcuts")
+ outFolder.mkdirs()
+ def start = System.currentTimeMillis()
+ def srcFiles = args.collect {getSourceFile(it)}
+ def srcFileNames = args.collect {getSourceFile(it).canonicalPath}
+ try {
+ Class[] classes = DefaultGroovyMethods.additionals
+ classes.each {
+ def name = it.name
+ if (name.indexOf('$') > 0) {
+ name = name.tokenize('$')[0]
+ }
+ def newFile = getSourceFile(name)
+ def newFileName = newFile.canonicalPath
+ if (!srcFileNames.contains(newFileName)) {
+ srcFileNames << newFileName
+ srcFiles << newFile
+ }
+ }
+ } catch (MissingPropertyException mpe) {
+ log.error mpe.message, mpe
+ // no call site change available, so ignore it
+ }
+ def docGen = new DocGenerator(srcFiles, outFolder)
+ docGen.generateNew()
+ def end = System.currentTimeMillis()
+ log.debug "Done. Took ${end - start} millis."
+ }
+
+ private static File getSourceFile(String classname) {
+ // TODO don't hardcode like this
+ if (classname.contains("/")) return new File(classname)
+ new File("src/main/" + classname.replace('.', '/') + ".java")
+ }
+}
View
BIN  gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/groovy.ico
Binary file not shown
View
76 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/index.html
@@ -0,0 +1,76 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<TITLE>
+Groovy JDK
+</TITLE>
+<link href="groovy.ico" type="image/x-icon" rel="shortcut icon">
+<link href="groovy.ico" type="image/x-icon" rel="icon">
+
+<script type="text/javascript">
+ targetPage = "" + window.location.search;
+ if (targetPage != "" && targetPage != "undefined")
+ targetPage = targetPage.substring(1);
+ if (targetPage.indexOf(":") != -1)
+ targetPage = "undefined";
+ if (targetPage != "" && !validURL(targetPage))
+ targetPage = "undefined";
+ function validURL(url) {
+ var pos = url.indexOf(".html");
+ if (pos == -1 || pos != url.length - 5)
+ return false;
+ var allowNumber = false;
+ var allowSep = false;
+ var seenDot = false;
+ for (var i = 0; i < url.length - 5; i++) {
+ var ch = url.charAt(i);
+ if ('a' <= ch && ch <= 'z' ||
+ 'A' <= ch && ch <= 'Z' ||
+ ch == '\$' ||
+ ch == '_') {
+ allowNumber = true;
+ allowSep = true;
+ } else if ('0' <= ch && ch <= '9'
+ || ch == '-') {
+ if (!allowNumber)
+ return false;
+ } else if (ch == '/' || ch == '.') {
+ if (!allowSep)
+ return false;
+ allowNumber = false;
+ allowSep = false;
+ if (ch == '.')
+ seenDot = true;
+ if (ch == '/' && seenDot)
+ return false;
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+ function loadFrames() {
+ if (targetPage != "" && targetPage != "undefined")
+ top.classFrame.location = top.targetPage;
+ }
+</script>
+</HEAD>
+<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
+<FRAMESET rows="30%,70%" title="" onLoad="top.loadFrames()">
+ <FRAME src="overview-frame.html" name="packageListFrame" title="All Packages">
+ <FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
+</FRAMESET>
+
+<FRAME src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
+<NOFRAMES>
+<H2>
+Frame Alert</H2>
+<P>
+This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+<BR>
+Link to<A HREF="overview-summary.html">Non-frame version.</A>
+</P>
+</NOFRAMES>
+</FRAMESET>
+</HTML>
View
50 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/overview-summary.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+<TITLE>
+Overview (Groovy JDK)
+</TITLE>
+<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
+<SCRIPT type="text/javascript">
+function asd()
+{
+parent.document.title = document.title;
+}
+</SCRIPT>
+</HEAD>
+
+<BODY BGCOLOR="white" onload="asd();">
+
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+ <TR>
+ <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
+ <A NAME="navbar_top_firstrow"><!-- --></A>
+ <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <SPAN CLASS="NavBarFont1Rev"><B>Overview</B></SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Package</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Class</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Tree</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Deprecated</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><SPAN CLASS="NavBarFont1"><B>Index</B></SPAN></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Help</SPAN>&nbsp;</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+ <b>Groovy JDK</b></EM>
+ </TD>
+ </TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+<HR>
+<H2 style="text-align: center;">
+Groovy JDK<br>API Specification<br></H2>
+
+<H3 style="text-align: center;"><small>Version ${GroovySystem.version}</small></H3>
+
+This document describes the methods added to the JDK to make it more groovy.
+
+</BODY>
+</HTML>
View
29 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/stylesheet.css
@@ -0,0 +1,29 @@
+/* Javadoc style sheet */
+
+/* Define colors, fonts and other style attributes here to override the defaults */
+
+/* Page background color */
+body { background-color: #FFFFFF; }
+
+/* Table colors */
+.TableHeadingColor { background: #CCCCFF } /* Dark mauve */
+.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */
+.TableRowColor { background: #FFFFFF } /* White */
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif;font-weight: bold; }
+.FrameHeadingFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif;font-weight: bold; }
+.FrameItemFont { font-size: 10pts; font-family: Helvetica, Arial, san-serif }
+
+/* Example of smaller, sans-serif font in frames */
+/* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */
+
+/* Navigation bar fonts and colors */
+.NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */
+.NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */
+.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
+
+.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+
View
36 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/template.allclasses-frame.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<TITLE>
+All Classes (Groovy GDK)
+</TITLE>
+
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
+
+
+</HEAD>
+
+<BODY BGCOLOR="white">
+<SPAN CLASS="FrameHeadingFont">
+All Classes
+</SPAN>
+
+<BR>
+
+<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
+<TR>
+<TD NOWRAP>
+
+<SPAN CLASS="FrameItemFont">
+<% classes.each { %>
+<A HREF="${it.replaceAll('\\.', '/')}.html" target="classFrame">${it.replaceAll('.*\\.', '')}</A>
+<BR>
+<% } %>
+</SPAN></TD>
+</TR>
+</TABLE>
+
+</BODY>
+</HTML>
View
161 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/template.class.html
@@ -0,0 +1,161 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<HTML>
+<HEAD>
+<TITLE>${className} (Groovy JDK)</TITLE>
+
+<%
+int dotCount = packageName.count('.')
+String pathPref = '../' * (dotCount+1)
+%>
+<LINK REL ="stylesheet" TYPE="text/css" HREF="${pathPref}stylesheet.css" TITLE="Style">
+
+<SCRIPT type="text/javascript">
+function windowTitle()
+{
+ parent.document.title = document.title;
+}
+</SCRIPT>
+
+</HEAD>
+
+<BODY BGCOLOR="white" onload="windowTitle();">
+
+<!-- ========== START OF NAVBAR ========== -->
+<A NAME="navbar_top"><!-- --></A>
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+ <TR>
+ <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
+ <A NAME="navbar_top_firstrow"><!-- --></A>
+ <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pathPref}overview-summary.html"><SPAN CLASS="NavBarFont1"><B>Overview</B></SPAN></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Package</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Class</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Tree</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Deprecated</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pathPref}index-all.html"><SPAN CLASS="NavBarFont1"><B>Index</B></SPAN></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Help</SPAN>&nbsp;</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+ <b>${title}</b></EM>
+ </TD>
+ </TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+<!-- ======== START OF CLASS DATA ======== -->
+<H2>
+<SPAN style="font-size:12px;">
+${packageName}</SPAN>
+<BR>
+Class ${className}</H2>
+
+<!-- ========== METHOD SUMMARY =========== -->
+
+<A NAME="method_summary"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TH ALIGN="left" COLSPAN="2"><SPAN style="font-size:24px;">
+<B>Method Summary</B></SPAN></TH>
+</TR>
+
+<% methods.each { method -> %>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%">
+
+<SPAN>
+<CODE>${method.isStatic ? 'static ' : ''}${method.returnTypeDocUrl}</CODE></SPAN>
+</TD>
+<TD><CODE><B><A HREF="#${method.name}(${method.parametersSignature})">${method.name}</A></B>(${method.parametersDocUrl})</CODE>
+<BR>
+${method.shortComment}
+</TD>
+</TR>
+<% } %>
+</TABLE>
+&nbsp;
+
+
+<!-- ============ METHOD DETAIL ========== -->
+
+<A NAME="method_detail"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TH ALIGN="left" COLSPAN="1"><SPAN style="font-size:24px;">
+<B>Method Detail</B></SPAN></TH>
+</TR>
+</TABLE>
+
+<% methods.each { method -> %>
+
+<A name="${method.name}(${method.parametersSignature})"><!-- --></A><H3>${method.name}</H3>
+<PRE>public ${method.isStatic ? 'static ' : ''}${method.returnTypeDocUrl} <B>${method.name}</B>(${method.parametersDocUrl})</PRE>
+<DL>
+<dt>&nbsp;</dt>
+<DD>${method.comment}</DD>
+</DL>
+<% if (method.parametersSignature) { %>
+<dl><DT><B>Parameters:</B></DT>
+ <% method.parameters.each { param -> %>
+ <DD><CODE>${param.name}</CODE> - ${param.comment}.</DD>
+<% } %>
+ </dl>
+ <%
+ } %>
+
+<% if (method.returnComment) { %>
+<dl><DT><B>Returns:</B></DT><DD>${method.returnComment}</DD></dl>
+<% } %>
+
+<%if (method.since) { %>
+<dl>
+<DT><B>Since:</B></DT>
+<DD>${method.since}</DD>
+</dl>
+<%}%>
+
+<% if (method.seeComments) { %>
+<dl>
+<DT><B>See:</B></DT>
+<% method.seeComments.each { param -> %>
+ <DD>${param.target}.</DD>
+<% }%>
+</dl>
+<% } %>
+
+<HR>
+<% } %>
+<!-- ========= END OF CLASS DATA ========= -->
+
+ <!-- ======= START OF BOTTOM NAVBAR ====== -->
+<A NAME="navbar_bottom"><!-- --></A>
+<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
+
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+ <TR>
+ <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
+ <A NAME="navbar_top_firstrow"><!-- --></A>
+ <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pathPref}overview-summary.html"><SPAN CLASS="NavBarFont1"><B>Overview</B></SPAN></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Package</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Class</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Tree</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Deprecated</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pathPref}index-all.html"><SPAN CLASS="NavBarFont1"><B>Index</B></SPAN></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Help</SPAN>&nbsp;</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+ <b>${title}</b></EM>
+ </TD>
+ </TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+</BODY>
+</HTML>
View
122 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/template.index-all.html
@@ -0,0 +1,122 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
+<!--NewPage-->
+<HTML>
+ <HEAD>
+ <!-- Generated by javadoc on Wed Dec 25 23:04:46 CET 2002 -->
+ <TITLE>
+ Index
+ </TITLE>
+ <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
+ </HEAD>
+ <SCRIPT>
+function asd()
+{
+ parent.document.title="Index";
+}
+</SCRIPT>
+ <BODY BGCOLOR="white" onload="asd();">
+
+ <!-- ========== START OF NAVBAR ========== -->
+ <A NAME="navbar_top"><!-- --></A>
+ <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+ <TR>
+ <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
+ <A NAME="navbar_top_firstrow"><!-- --></A>
+ <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><SPAN CLASS="NavBarFont1"><B>Overview</B></SPAN></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Package</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Class</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Tree</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Deprecated</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <SPAN CLASS="NavBarFont1Rev"><B>Index</B></SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Help</SPAN>&nbsp;</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+ <b>${title}</b></EM>
+ </TD>
+ </TR>
+ </TABLE>
+ <!-- =========== END OF NAVBAR =========== -->
+ <!--
+ <A HREF="#_A_">A</A>
+ -->
+ <% indexMap.each{ it -> %>
+ <A HREF="#_${it.key}_">${it.key}</A>
+ <% } %>
+ <HR>
+
+ <% indexMap.each { indexMapEntry -> %>
+ <A NAME="_${indexMapEntry.key}_"><!-- --></A>
+ <H2><B>${indexMapEntry.key}</B></H2>
+ <DL>
+ <!--
+ <DT><A HREF="com/thoughtworks/qdox/model/AbstractJavaEntity.html">
+ <B>AbstractJavaEntity</B></A>
+ - class com.thoughtworks.qdox.model.
+ <A HREF="com/thoughtworks/qdox/model/AbstractJavaEntity.html">AbstractJavaEntity</A>.
+
+ <DT><A HREF="com/thoughtworks/qdox/model/ClassLibrary.html#add(java.lang.String)"><B>add(String)</B></A> -
+ Method in class com.thoughtworks.qdox.model.<A HREF="com/thoughtworks/qdox/model/ClassLibrary.html">ClassLibrary</A>
+ <DD>&nbsp;
+ -->
+
+ <% indexMapEntry.value.each{ it -> %>
+ <DT>
+ <% if (it.'method') {
+ final String href1 = it.class.replaceAll('\\.','/') + '.html'
+ final String href2 = href1 +
+ '#' + it.method.name + '(' + it.parametersSignature + ')'
+ %>
+ <a href="${href2}"><b>${it.method.name}(${it.parametersSignature})</b></a> -
+ Method in class ${it.packageName}.<a href="${href1}">${it.simpleClassName}</a>
+ <% } %>
+ </DT>
+ <DD>
+ ${it.shortComment}
+ </DD>
+ &nbsp;
+ <% } %>
+ </DL>
+ <HR>
+ <% } %>
+
+ <!--
+ <A HREF="#_A_">A</A>
+ -->
+ <% indexMap.each{ it -> %>
+ <A HREF="#_${it.key}_">${it.key}</A>
+ <% } %>
+
+ <!-- ========== START OF NAVBAR ========== -->
+ <A NAME="navbar_bottom"><!-- --></A>
+ <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+ <TR>
+ <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
+ <A NAME="navbar_bottom_firstrow"><!-- --></A>
+ <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><SPAN CLASS="NavBarFont1"><B>Overview</B></SPAN></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Package</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Class</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Tree</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Deprecated</SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <SPAN CLASS="NavBarFont1Rev"><B>Index</B></SPAN>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <SPAN CLASS="NavBarFont1">Help</SPAN>&nbsp;</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+ <b>${title}</b></EM>
+ </TD>
+ </TR>
+
+ </TABLE>
+ <!-- =========== END OF NAVBAR =========== -->
+
+ <HR>
+
+ </BODY>
+</HTML>
View
41 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/template.overview-frame.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<head>
+<title>
+Overview (Groovy JDK)
+</title>
+
+<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
+</head>
+
+<body>
+
+<table border="0" width="100%">
+<tr>
+<th align="left" nowrap>Groovy JDK</th>
+</tr>
+</table>
+
+<table border="0" width="100%">
+<TR>
+<TD NOWRAP><SPAN CLASS="FrameItemFont"><A HREF="allclasses-frame.html" target="packageFrame">All Classes</A></SPAN>
+
+<P>
+<SPAN CLASS="FrameHeadingFont">Packages</SPAN><BR>
+
+<SPAN CLASS="FrameItemFont"><a href="primitive-types/package-frame.html" target="packageFrame">Primitive types</A></SPAN>
+<% packages.each { %>
+<SPAN CLASS="FrameItemFont"><a href="${it.replaceAll('\\.', '/')}/package-frame.html" target="packageFrame">${it}</A></SPAN>
+<BR>
+<% } %>
+</P>
+</TD>
+</TR>
+</TABLE>
+
+<P>
+&nbsp;
+</P>
+</BODY>
+</HTML>
View
41 gaelyk-docgenerator/src/main/resources/groovyx/gaelyk/tools/docs/template.package-frame.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<TITLE>
+${packageName} (Java 2 Platform SE 5.0)
+</TITLE>
+
+<META NAME="keywords" CONTENT="${packageName}">
+<%
+def path = '..'
+packageName.count('.').times {
+ path += ('/..')
+}
+%>
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="${path}/stylesheet.css" TITLE="Style">
+
+
+</HEAD>
+
+<BODY BGCOLOR="white">
+<SPAN CLASS="FrameTitleFont">${packageName}</SPAN>
+
+
+<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
+<TR>
+<TD NOWRAP>
+<SPAN CLASS="FrameHeadingFont">Classes</SPAN>&nbsp;
+<SPAN CLASS="FrameItemFont">
+<% classes.each { %>
+<BR>
+<A href="${it}.html" title="class in ${packageName}" target="classFrame">${it}</A>
+<% } %>
+</SPAN></TD>
+</TR>
+</TABLE>
+
+
+</BODY>
+</HTML>
View
2  settings.gradle
@@ -1 +1 @@
-include 'core', 'website'
+include 'core', 'website', 'gaelyk-docgenerator'
Please sign in to comment.
Something went wrong with that request. Please try again.