Browse files

finished documentation generation task allDocs. Updating github docs …

…no longer a manual process.
  • Loading branch information...
1 parent f876f2c commit d666dbe8b9439dbe62d2929a860d0e09cc2c12c4 @graemerocher graemerocher committed Dec 14, 2011
View
42 build.gradle
@@ -275,19 +275,57 @@ dependencies {
task allDocs(dependsOn: getTasksByName("docs", true)) << {
def docTasks = getTasksByName("docs", true)
+ def groovydocTasks = getTasksByName("groovydoc", true)
allDocsDir = "$buildDir/docs"
mkdir allDocsDir
+ def stores = []
for(task in docTasks) {
def dir = task.destinationDir
def projectName = task.project.name
if(projectName.endsWith("core")) {
- fileTree { from dir }.copy { into allDocsDir }
+ mkdir "$allDocsDir/manual"
+ fileTree { from dir }.copy { into "$allDocsDir/manual" }
+ def groovydocTask = groovydocTasks.find { it.project.name.endsWith "core" }
+ if(groovydocTask != null) {
+ mkdir "$allDocsDir/api"
+ groovydocTask.actions.each { it.execute(groovydocTask) }
+
+ fileTree { from groovydocTask.destinationDir }.copy { into "$allDocsDir/api"}
+ }
+
}
else {
def storeName = projectName["grails-documentation-".size()..-1]
+ stores << storeName
def docsDir = "$allDocsDir/$storeName"
mkdir docsDir
- fileTree { from dir }.copy { into docsDir }
+ def groovydocTask = groovydocTasks.find { it.project.name == "grails-datastore-$storeName" }
+ if(groovydocTask == null) groovydocTask = groovydocTasks.find { it.project.name == "grails-datastore-gorm-$storeName" }
+ if(groovydocTask != null) {
+ mkdir "$docsDir/api"
+ groovydocTask.actions.each { it.execute(groovydocTask) }
+ fileTree { from groovydocTask.destinationDir }.copy { into "$docsDir/api"}
+ }
+ mkdir "$docsDir/manual"
+ fileTree { from dir }.copy { into "$docsDir/manual" }
+ }
+
+ def engine = new groovy.text.SimpleTemplateEngine()
+ def binding = [
+ datastores:stores.collect { "<li><a href=\"$it/index.html\">GORM for ${it[0].toUpperCase()}${it[1..-1]}</a></li>" }.join(System.getProperty("line.separator"))
+ ]
+ def template = engine.createTemplate(new File("src/docs/resources/core.template")).make(binding)
+ new File("$allDocsDir/index.html").text = template.toString()
+
+ for(store in stores) {
+ def index = "$allDocsDir/$store/index.html"
+ def storeName = "${store[0].toUpperCase()}${store[1..-1]}".toString()
+ binding = [
+ datastore:storeName
+ ]
+ template = engine.createTemplate(new File("src/docs/resources/datastore.template")).make( binding )
+ new File(index).text = template.toString()
+
}
}
View
2 gradlew
@@ -7,7 +7,7 @@
##############################################################################
# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
-GRADLE_OPTS="$GRADLE_OPTS -Xmx1024m"
+export GRADLE_OPTS="$GRADLE_OPTS -Xmx1024m -XX:MaxPermSize=256m"
# JAVA_OPTS="$JAVA_OPTS -Xmx512"
GRADLE_APP_NAME=Gradle
View
12 grails-documentation-core/src/docs/guide/2. Getting Started.gdoc
@@ -39,6 +39,18 @@ To install the jar files for the various subprojects into your local Maven repos
./gradlew install
{code}
+To build all of the documentation run the command:
+
+{code}
+./gradlew allDocs
+{code}
+
+Documentation will produced in the @build/docs@ directory.
+
+{note}
+If you experience PermGen errors when building documentation you may need to increase the JVM permgen inside GRADLE_OPTS
+{note}
+
h3. Project Structure
The project is essentially a multi-project Gradle build. There is a core API and then subprojects that implement that API. The core API subprojects include:
View
55 src/docs/resources/core.template
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Grails Data Mapping @ GitHub</title>
+ <style type="text/css">
+body {
+ margin-top: 1.0em;
+ font-family: "Helvetica,Arial,FreeSans";
+}
+
+#container {
+ margin: 0 auto;
+ margin-left: 50px;
+ margin-right: 50px;
+}
+
+.propName { font-weight: bold; }
+
+h1 { color: #00CC00; margin-bottom: 3px; }
+td { padding: 2px 5px; }
+ </style>
+</head>
+<body>
+ <a href="https://github.com/SpringSource/grails-data-mapping/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
+
+ <div id="container">
+ <h1>GORM for NoSQL</h1>
+ <table id="properties">
+ <tbody>
+ <tr>
+ <td class="propName">Grails Version</td>
+ <td>1.3.7 and above</td>
+ </tr>
+ <tr>
+ <td class="propName">Author</td>
+ <td>Graeme Rocher</td>
+ </tr>
+ </tbody>
+ </table>
+ <hr />
+ <h2>Documentation</h2>
+ <ul>
+ <li><a href="api/index.html">Core API</a></li>
+ <li><a href="manual/index.html">Developer Guide</a></li>
+ </ul>
+ <h2>Implementations</h2>
+ <ul>
+ ${datastores}
+ </ul>
+ <hr />
+</body>
+</html>
View
47 src/docs/resources/datastore.template
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>GORM for ${datastore} @ GitHub</title>
+ <style type="text/css">
+body {
+ margin-top: 1.0em;
+ font-family: "Helvetica,Arial,FreeSans";
+}
+
+#container {
+ margin: 0 auto;
+ margin-left: 50px;
+ margin-right: 50px;
+}
+
+.propName { font-weight: bold; }
+
+h1 { color: #00CC00; margin-bottom: 3px; }
+td { padding: 2px 5px; }
+ </style>
+</head>
+<body>
+ <a href="https://github.com/SpringSource/grails-data-mapping/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
+
+ <div id="container">
+ <h1>GORM for ${datastore}</h1>
+ <table id="properties">
+ <tbody>
+ <tr>
+ <td class="propName">Grails Version</td>
+ <td>1.3.7 and above</td>
+ </tr>
+ </tbody>
+ </table>
+ <hr />
+ <h2>Documentation</h2>
+ <ul>
+ <li><a href="manual/index.html">User guide</a></a>
+ <li><a href="api/index.html">Java API</a></li>
+ </ul>
+ <hr />
+</body>
+</html>

0 comments on commit d666dbe

Please sign in to comment.