Permalink
Browse files

added "allDocs" target for generating all the documentation from core…

… and the sub projects
  • Loading branch information...
graemerocher committed Dec 14, 2011
1 parent 1fb76d3 commit f876f2c32f39529aa02a72df3b12e4fe2399d853
View
@@ -53,6 +53,7 @@ subprojects {
}
def isGormDatasource = project.name.startsWith("grails-datastore-gorm-") && !project.name.endsWith("tck") && !project.name.endsWith("plugin-support")
+ def isDocumentationProject = project.name.startsWith("grails-documentation")
repositories {
mavenRepo name:'mavenLocal',
@@ -78,6 +79,38 @@ subprojects {
compile spockDependency
}
}
+
+ if(isDocumentationProject) {
+ configurations {
+ documentation
+ }
+ dependencies {
+ documentation group: 'org.grails', name: 'grails-docs', version: '2.0.0'
+ project(":grails-datastore-core")
+ documentation "org.slf4j:jcl-over-slf4j:$slf4jVersion"
+ documentation "org.slf4j:slf4j-api:$slf4jVersion"
+ documentation "org.slf4j:slf4j-simple:$slf4jVersion"
+ }
+ task docs << {
+ ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
+ classpath {
+ configurations.documentation.resolve().each { f ->
+ pathelement(location:f)
+ }
+ }
+
+ }
+ ant.docs(src:"src/docs", dest:destinationDir, properties:"src/docs/doc.properties")
+ }
+ docs.destinationDir = "${buildDir}/docs"
+
+
+ task clean << {
+ ant.delete(dir:buildDir)
+ }
+
+
+ }
if (isGormDatasource) {
dependencies {
@@ -240,6 +273,25 @@ dependencies {
build "org.apache.ant:ant-nodeps:1.8.1"
}
+task allDocs(dependsOn: getTasksByName("docs", true)) << {
+ def docTasks = getTasksByName("docs", true)
+ allDocsDir = "$buildDir/docs"
+ mkdir allDocsDir
+ for(task in docTasks) {
+ def dir = task.destinationDir
+ def projectName = task.project.name
+ if(projectName.endsWith("core")) {
+ fileTree { from dir }.copy { into allDocsDir }
+ }
+ else {
+ def storeName = projectName["grails-documentation-".size()..-1]
+ def docsDir = "$allDocsDir/$storeName"
+ mkdir docsDir
+ fileTree { from dir }.copy { into docsDir }
+ }
+ }
+
+}
task test(dependsOn: getTasksByName("test", true)) << {
def reportsDir = "${buildDir}/reports"
@@ -1,27 +1,3 @@
-configurations {
- documentation
-}
-dependencies {
- documentation group: 'org.grails', name: 'grails-docs', version: '2.0.0.RC3'
- project(":grails-datastore-core")
- documentation "org.slf4j:jcl-over-slf4j:1.6.1"
- documentation "org.slf4j:slf4j-api:1.6.1"
- documentation "org.slf4j:slf4j-simple:1.6.1"
-}
-
-task clean << {
- ant.delete(dir:buildDir)
-}
-
-task assemble << {
+task assemble(dependsOn:docs) << {
group = "docs"
- ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
- classpath {
- configurations.documentation.resolve().each { f ->
- pathelement(location:f)
- }
- }
-
- }
- ant.docs(src:"src/docs", dest:"build/docs", properties:"src/docs/doc.properties")
-}
+}
@@ -1,27 +1,3 @@
-configurations {
- documentation
-}
-dependencies {
- documentation group: 'org.grails', name: 'grails-docs', version: '2.0.0.M1'
- project(":grails-datastore-core")
- documentation "org.slf4j:jcl-over-slf4j:1.5.8"
- documentation "org.slf4j:slf4j-api:1.5.8"
- documentation "org.slf4j:slf4j-simple:1.5.8"
-}
-
-task clean << {
- ant.delete(dir:buildDir)
-}
-
-task assemble << {
+task assemble(dependsOn:docs) << {
group = "docs"
- ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
- classpath {
- configurations.documentation.resolve().each { f ->
- pathelement(location:f)
- }
- }
-
- }
- ant.docs(src:"src/docs", dest:"build/docs", properties:"src/docs/doc.properties")
-}
+}
@@ -1,27 +1,3 @@
-configurations {
- documentation
-}
-dependencies {
- documentation group: 'org.grails', name: 'grails-docs', version: '2.0.0.RC3'
- project(":grails-datastore-core")
- documentation "org.slf4j:jcl-over-slf4j:1.5.8"
- documentation "org.slf4j:slf4j-api:1.5.8"
- documentation "org.slf4j:slf4j-simple:1.5.8"
-}
-
-task clean << {
- ant.delete(dir:buildDir)
-}
-
-task assemble << {
+task assemble(dependsOn:docs) << {
group = "docs"
- ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
- classpath {
- configurations.documentation.resolve().each { f ->
- pathelement(location:f)
- }
- }
-
- }
- ant.docs(src:"src/docs", dest:"build/docs", properties:"src/docs/doc.properties")
-}
+}
@@ -1,46 +1,3 @@
-configurations {
- documentation
-}
-dependencies {
- documentation group: 'org.grails', name: 'grails-docs', version: '1.3.+'
- documentation "org.slf4j:jcl-over-slf4j:1.5.8"
- documentation "org.slf4j:slf4j-api:1.5.8"
- documentation "org.slf4j:slf4j-simple:1.5.8"
- project(":grails-datastore-core")
-}
-
-if (Boolean.getBoolean("skip.javadoc")) {
- task javadoc << {} // do nothing
-}
-else {
- task javadoc(type: Javadoc) {
- source groovyProjects().collect { project ->
- project.sourceSets.main.allJava
- }
- destinationDir = new File(file("$buildDir/docs"), 'api')
- classpath = files(groovyProjects().collect { project ->
- [project.sourceSets.main.compileClasspath, project.sourceSets.main.classes]
- })
- options.links("http://download.oracle.com/javase/6/docs/api/", "http://groovy.codehaus.org/gapi/")
- doFirst {
- title = "Datastore API $version"
- }
- }
-}
-
-task clean << {
- ant.delete(dir:buildDir)
-}
-
-task assemble(dependsOn:javadoc) << {
+task assemble(dependsOn:docs) << {
group = "docs"
- ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
- classpath {
- configurations.documentation.resolve().each { f ->
- pathelement(location:f)
- }
- }
-
- }
- ant.docs(src:"src/docs", dest:"build/docs", properties:"src/docs/doc.properties")
-}
+}
@@ -1,47 +1,3 @@
-configurations {
- documentation
-}
-
-dependencies {
- documentation group: 'org.grails', name: 'grails-docs', version: '1.3.+'
- documentation group: 'org.slf4j', name: 'slf4j-api', version: '1.6.+'
- project(":grails-datastore-core")
-}
-
-if (Boolean.getBoolean("skip.javadoc")) {
- task javadoc << {} // do nothing
-} else {
- task javadoc(type: Javadoc) {
- source groovyProjects().collect { project ->
- if (project.name.endsWith("riak")) {
- project.sourceSets.main.allJava
- } else {
- []
- }
- }
- destinationDir = new File(file("$buildDir/docs"), 'api')
- classpath = files(groovyProjects().collect { project ->
- [project.sourceSets.main.compileClasspath, project.sourceSets.main.classes]
- })
- options.links("http://download.oracle.com/javase/6/docs/api/", "http://groovy.codehaus.org/gapi/")
- doFirst {
- title = "Datastore API $version"
- }
- }
-}
-
-task clean << {
- ant.delete(dir:buildDir)
-}
-
-task assemble << {
+task assemble(dependsOn:docs) << {
group = "docs"
- ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
- classpath {
- configurations.documentation.resolve().each { f ->
- pathelement(location:f)
- }
- }
- }
- ant.docs(src:"src/docs", dest:"build/docs", properties:"src/docs/doc.properties")
-}
+}
@@ -1,27 +1,3 @@
-configurations {
- documentation
-}
-dependencies {
- documentation group: 'org.grails', name: 'grails-docs', version: '2.0.0.M1'
- project(":grails-datastore-core")
- documentation "org.slf4j:jcl-over-slf4j:1.5.8"
- documentation "org.slf4j:slf4j-api:1.5.8"
- documentation "org.slf4j:slf4j-simple:1.5.8"
-}
-
-task clean << {
- ant.delete(dir:buildDir)
-}
-
-task assemble << {
+task assemble(dependsOn:docs) << {
group = "docs"
- ant.taskdef (name: 'docs', classname : 'grails.doc.ant.DocPublisherTask') {
- classpath {
- configurations.documentation.resolve().each { f ->
- pathelement(location:f)
- }
- }
-
- }
- ant.docs(src:"src/docs", dest:"build/docs", properties:"src/docs/doc.properties")
-}
+}

0 comments on commit f876f2c

Please sign in to comment.