File: docs.gradle

package info (click to toggle)
groovy 2.4.21-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 30,708 kB
  • sloc: java: 157,114; xml: 728; sh: 357; makefile: 64; javascript: 15
file content (132 lines) | stat: -rw-r--r-- 4,797 bytes parent folder | download
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
127
128
129
130
131
132
/*
 *  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-2019 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
        locale = 'en_US'
        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('file:///usr/share/doc/ant/api/', 'file:///usr/share/doc/default-jdk/api/',
              'file:///usr/share/doc/libservlet3.1-java-doc/api',
              'file:///usr/share/doc/junit4/api/')
        failOnError = false
    }
}

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
        if (gradle.gradleVersion.startsWith('2.')) {
            overview = rootProject.file('src/main/overview.html')
        } else {
            overviewText = resources.text.fromFile(rootProject.file('src/main/overview.html'))
        }
        includePrivate = false
        link 'file:///usr/share/doc/libservlet3.1-java-doc/api', 'javax.servlet.', 'javax.management.'
        link 'file:///usr/share/doc/default-jdk/api/', 'java.', 'org.xml.', 'javax.', 'org.w3c.'
        link 'file:///usr/share/doc/ant/api/', 'org.apache.tools.ant.'
        link 'file:///usr/share/doc/junit4/api/', 'org.junit.'
}

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'
    javadocAll.options.noTimestamp()
}

if (JavaVersion.current().isJava8Compatible()) {
    allprojects {
        tasks.withType(Javadoc) {
            // disable the crazy super-strict doclint tool in Java 8
            options.addStringOption('Xdoclint:none', '-quiet')
            options.noTimestamp()
        }
    }
}