1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
/*
* 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.
*/
task doc(dependsOn: ['javadocAll', 'groovydocAll', 'docGDK']) {
ext.footer = 'Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.'
ext.title = "Groovy ${groovyVersion}"
}
def javadocSpec = {
maxMemory = javaDoc_mx
project.configure(options) {
windowTitle = doc.title
docTitle = doc.title
encoding = 'UTF-8'
author = true
version = true
overview = rootProject.file('src/main/overviewj.html')
footer = doc.footer
source = rootProject.useIndy()?'1.7':'1.6'
links('http://docs.oracle.com/javase/8/docs/api/', 'http://docs.oracle.com/javaee/7/api/',
'http://commons.apache.org/proper/commons-cli/javadocs/api-release/', 'http://junit.org/apidocs/',
'http://docs.oracle.com/javaee/6/api/', 'http://www.antlr2.org/javadoc/')
}
}
def groovydocSpec = {
use = true
if (project != rootProject) source = project.sourceSets.main.allSource
classpath = javadoc.classpath
ext.windowtitle = doc.title
ext.doctitle = doc.title
header = doc.title
footer = doc.footer
overview = rootProject.file('src/main/overview.html')
includePrivate = false
link 'http://docs.oracle.com/javaee/7/api/', 'javax.servlet.', 'javax.management.'
link 'http://docs.oracle.com/javase/8/docs/api/', 'java.', 'org.xml.', 'javax.', 'org.w3c.'
link 'http://docs.groovy-lang.org/docs/ant/api/', 'org.apache.ant.', 'org.apache.tools.ant.'
link 'http://junit.org/apidocs/', 'org.junit.', 'junit.'
link 'http://www.antlr2.org/javadoc/', 'antlr.'
link 'http://commons.apache.org/proper/commons-cli/javadocs/api-release/', 'org.apache.commons.cli.'
}
allprojects {
javadoc javadocSpec
groovydoc groovydocSpec
}
// Root project has an extra 'all' javadoc task
task javadocAll(type: Javadoc)
javadocAll {
destinationDir = new File(buildDir, 'alljavadoc')
source = javadoc.source
classpath = javadoc.classpath
subprojects.each { sp ->
source += sp.javadoc.source
classpath += sp.javadoc.classpath
}
}
javadocAll javadocSpec
// Root project has an extra 'all' groovydoc task
task groovydocAll(type: Groovydoc)
groovydocAll {
dependsOn( { project(':groovy-groovydoc').classes })
dependsOn( { project(':groovy-docgenerator').classes })
destinationDir = new File(buildDir, 'allgroovydoc')
source = groovydoc.source
classpath = groovydoc.classpath
groovyClasspath = groovydoc.groovyClasspath
subprojects.each { sp ->
source += sp.groovydoc.source
classpath += sp.groovydoc.classpath
groovyClasspath += sp.groovydoc.groovyClasspath
}
}
groovydocAll groovydocSpec
// when docgenerator is run by the build, it requires a groovy-release-info file
// but the file is only generated by the 'jar' task, so as a workaround, we copy
// it into the docgenerator classes
task docProjectVersionInfo(type: Copy) {
destinationDir = file("${project(':groovy-docgenerator').buildDir}/classes/main")
into('META-INF') {
from('src/main/META-INF/groovy-release-info.properties') {
filter(rootProject.propertiesFilter, org.apache.tools.ant.filters.ReplaceTokens)
}
}
from('subprojects/groovy-docgenerator/src/main/resources')
}
task docGDK {
// ext.extraDocGDKclasses = []
// TODO don't hard-code these
ext.destinationDir = "$buildDir/html/groovy-jdk"
inputs.files sourceSets.main.runtimeClasspath + configurations.tools
outputs.dir destinationDir
}
if (JavaVersion.current().isJava7Compatible()) {
javadocAll.options.source = '1.7'
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
|