Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible fix #2765: Add task to download package-list file from java as element-list #2766

1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -25,6 +25,7 @@ plugins {
id 'com.github.ben-manes.versions' version '0.42.0'
id 'biz.aQute.bnd.builder' version '6.3.1'
id 'ru.vyarus.animalsniffer' version '1.5.2'
id 'de.undercouch.download' version '5.3.0'
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
}

description = 'Mockito mock objects library core API and implementation'
Expand Down
21 changes: 19 additions & 2 deletions gradle/mockito-core/javadoc.gradle
Expand Up @@ -38,8 +38,8 @@ javadoc {
options.noIndex = false
options.noNavBar = false
options.noTree = false
options.links = ['https://docs.oracle.com/javase/6/docs/api/',
'https://junit.org/junit4/javadoc/4.12/']
options.links('https://junit.org/junit4/javadoc/4.12/')
options.linksOffline('https://docs.oracle.com/javase/6/docs/api/', "$buildDir/javase-6-docs/")
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
options.bottom("""
<script type="text/javascript" src="{@docRoot}/js/jdk6-project-version-insert.min.js"></script>
<script type="text/javascript" src="{@docRoot}/js/jquery-1.7.min.js"></script>
Expand All @@ -52,6 +52,23 @@ javadoc {
options.addStringOption('Xwerror', '-quiet')
options.addBooleanOption('-allow-script-in-comments', true)

// attempt to fix https://github.com/mockito/mockito/issues/2765
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
doFirst {
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
download.run {
src 'https://docs.oracle.com/javase/6/docs/api/package-list'
// somehow downloading src/javadoc or buildDir/javadoc didn't work, probably something related to the folder
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
// lifecycle
dest "$buildDir/javase-6-docs/element-list"
overwrite true
}
// dumbly downloading again just to see if we can make all jdks happy
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
download.run {
src 'https://docs.oracle.com/javase/6/docs/api/package-list'
dest "$buildDir/javase-6-docs/package-list"
overwrite true
}
}

doLast {
copy {
from "src/javadoc"
Expand Down