@@ -23,36 +23,47 @@ dependencies {
23
23
add(' documentation' , ' org.fusesource.jansi:jansi' )
24
24
add(' documentation' , ' jline:jline' )
25
25
add(' documentation' , ' com.github.javaparser:javaparser-core' )
26
- add(' documentation' , ' org.codehaus.groovy:groovy' )
27
- add(' documentation' , ' org.codehaus.groovy:groovy-ant' )
28
- add(' documentation' , ' org.codehaus.groovy:groovy-docgenerator' )
29
- add(' documentation' , ' org.codehaus.groovy:groovy-templates' )
26
+ add(' documentation' , " org.apache.groovy:groovy:${ bomDependencyVersions['groovy.version']} " )
27
+ add(' documentation' , " org.apache.groovy:groovy-groovydoc:${ bomDependencyVersions['groovy.version']} " )
28
+ add(' documentation' , " org.apache.groovy:groovy-ant:${ bomDependencyVersions['groovy.version']} " )
29
+ add(' documentation' , " org.apache.groovy:groovy-docgenerator:${ bomDependencyVersions['groovy.version']} " )
30
+ add(' documentation' , " org.apache.groovy:groovy-templates:${ bomDependencyVersions['groovy.version']} " )
30
31
}
31
32
32
33
ext {
33
34
includeInApiDocs = true
34
35
}
35
36
36
- tasks. named(' groovydoc' , Groovydoc ). configure {
37
- classpath = configurations. documentation
38
- groovyClasspath = configurations. documentation
39
- access = GroovydocAccess . PROTECTED
40
- includeAuthor = true
41
- includeMainForScripts = false
42
- processScripts = false
43
- destinationDir = project. file(' build/docs/api' )
37
+ TaskProvider<Groovydoc > groovydocTask = tasks. named(' groovydoc' , Groovydoc )
38
+ groovydocTask. configure { Groovydoc it ->
39
+ it. classpath = configurations. documentation
40
+ it. groovyClasspath = configurations. documentation
41
+ it. access = GroovydocAccess . PROTECTED
42
+ it. includeAuthor = false
43
+ it. includeMainForScripts = false
44
+ it. processScripts = false
45
+ it. noTimestamp = true
46
+ it. destinationDir = project. file(' build/docs/api' )
44
47
}
45
48
46
- tasks. named(' javadoc' , Javadoc ). configure { Javadoc it ->
47
- (it. options as StandardJavadocDocletOptions ). with {
48
- encoding = ' UTF-8'
49
- docEncoding = ' UTF-8'
50
- charSet = ' UTF-8'
51
- addStringOption(' Xms64M' )
52
- addStringOption(' Xmx512M' )
53
- }
49
+ tasks. named(' javadoc' ). configure {
50
+ it. enabled = false
51
+ }
52
+
53
+ tasks. named(' javadocJar' , Jar ). configure { Jar jar ->
54
+ jar. reproducibleFileOrder = true
55
+ jar. preserveFileTimestamps = false
56
+ jar. dirMode = 0755 // To avoid platform specific defaults
57
+ jar. fileMode = 0644 // to avoid platform specific defaults
58
+
59
+ jar. dependsOn(groovydocTask)
60
+
61
+ // Ensure the java source set is included in the groovydoc source set
62
+ SourceSetContainer sourceSets = project. extensions. getByType(SourceSetContainer )
63
+ groovydocTask. get(). source(project. files(sourceSets. main. java. srcDirs))
64
+
65
+ ConfigurableFileCollection groovyDocFiles = project. files(groovydocTask. get(). destinationDir)
66
+ jar. from(groovyDocFiles)
67
+ jar. inputs. files(groovyDocFiles)
54
68
}
55
69
56
- tasks. named(' build' ). configure {
57
- finalizedBy(' groovydoc' )
58
- }
0 commit comments