Skip to content

Commit

Permalink
Javadoc generation with custom doclet
Browse files Browse the repository at this point in the history
  • Loading branch information
benjchristensen committed Nov 22, 2012
1 parent 24787df commit 7775cc8
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 7 deletions.
12 changes: 6 additions & 6 deletions gradle/convention.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ subprojects { project ->
}

configurations.add('sources')
//configurations.add('javadoc')
configurations.add('javadoc')
configurations.archives {
extendsFrom configurations.sources
//extendsFrom configurations.javadoc
extendsFrom configurations.javadoc
}

// When outputing to an Ivy repo, we want to use the proper type field
Expand All @@ -46,13 +46,13 @@ subprojects { project ->
// Weird Gradle quirk where type will be used for the extension, but only for sources
type 'jar'
}
//javadoc(javadocJar) {
// type 'javadoc'
//}
javadoc(javadocJar) {
type 'javadoc'
}
}

// Ensure output is on a new line
//javadoc.doFirst { println "" }
javadoc.doFirst { println "" }

}

Expand Down
Binary file added gradle/doclet-exclude.jar
Binary file not shown.
59 changes: 59 additions & 0 deletions gradle/javadocStyleSheet.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# originally from http://sensemaya.org/files/stylesheet.css and then modified
# http://sensemaya.org/maya/2009/07/10/making-javadoc-more-legible

/* Javadoc style sheet */

/* Define colors, fonts and other style attributes here to override the defaults */

/* Page background color */
body { background-color: #FFFFFF; color:#333; font-size: 100%; }

body { font-size: 0.875em; line-height: 1.286em; font-family: "Helvetica", "Arial", sans-serif; }

code { color: #777; line-height: 1.286em; font-family: "Consolas", "Lucida Console", "Droid Sans Mono", "Andale Mono", "Monaco", "Lucida Sans Typewriter"; }

a { text-decoration: none; color: #16569A; /* also try #2E85ED, #0033FF, #6C93C6, #1D7BBE, #1D8DD2 */ }
a:hover { text-decoration: underline; }


table[border="1"] { border: 1px solid #ddd; }
table[border="1"] td, table[border="1"] th { border: 1px solid #ddd; }
table[cellpadding="3"] td { padding: 0.5em; }

font[size="-1"] { font-size: 0.85em; line-height: 1.5em; }
font[size="-2"] { font-size: 0.8em; }
font[size="+2"] { font-size: 1.4em; line-height: 1.3em; padding: 0.4em 0; }

/* Headings */
h1 { font-size: 1.5em; line-height: 1.286em;}
h2.title { color: #c81f08; }

/* Table colors */
.TableHeadingColor { background: #ccc; color:#444; } /* Dark mauve */
.TableSubHeadingColor { background: #ddd; color:#444; } /* Light mauve */
.TableRowColor { background: #FFFFFF; color:#666; font-size: 0.95em; } /* White */
.TableRowColor code { color:#000; } /* White */

/* Font used in left-hand frame lists */
.FrameTitleFont { font-size: 100%; }
.FrameHeadingFont { font-size: 90%; }
.FrameItemFont { font-size: 0.9em; line-height: 1.3em;
}
/* Java Interfaces */
.FrameItemFont a i {
font-style: normal; color: #16569A;
}
.FrameItemFont a:hover i {
text-decoration: underline;
}


/* Navigation bar fonts and colors */
.NavBarCell1 { background-color:#E0E6DF; } /* Light mauve */
.NavBarCell1Rev { background-color:#16569A; color:#FFFFFF} /* Dark Blue */
.NavBarFont1 { }
.NavBarFont1Rev { color:#FFFFFF; }

.NavBarCell2 { background-color:#FFFFFF; color:#000000}
.NavBarCell3 { background-color:#FFFFFF; color:#000000}

16 changes: 15 additions & 1 deletion hystrix-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,18 @@
compile 'org.slf4j:slf4j-api:1.7.0'
compile 'com.google.code.findbugs:jsr305:2.0.0'
provided 'junit:junit:4.10'
}
}

javadoc {
// the exclude isn't working, nor is there a subPackages options as docs suggest there should be
// we do not want the com.netflix.hystrix.util package include
// javadoc.exclude = ['**/util/**']

javadoc.options.doclet = "org.benjchristensen.doclet.DocletExclude"
javadoc.options.docletpath = [new File('./gradle/doclet-exclude.jar')]
javadoc.options.stylesheetFile = new File('./gradle/javadocStyleSheet.css')
javadoc.options.windowTitle = "Hystrix Javadoc 1.0.x" // can this version come from a variable?
// The 'top' option available on command-line appears to not exist via Gradle
//javadoc.options.top = "<h2 class='title'>Hystrix: Latency and Fault Tolerance for Distributed Systems</h2>"
}

0 comments on commit 7775cc8

Please sign in to comment.