Skip to content

Commit

Permalink
Update javadoc jars with better links for java/androi.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjudd committed Jun 16, 2017
1 parent bfe1442 commit 7049ace
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions scripts/upload.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,36 @@ afterEvaluate { project ->
it.buildType.name.equalsIgnoreCase('release')
}

task androidJavadocs(type: Javadoc, dependsOn: compileReleaseJavaWithJavac) {
def getAndroidCompileSdkVersion = project.android.compileSdkVersion

def getAndroidSdkDirectory = project.android.sdkDirectory

def getAndroidJar = "${getAndroidSdkDirectory}/platforms/${getAndroidCompileSdkVersion}/android.jar"

def getSupportJar = "${getAndroidSdkDirectory}/extras/android/support/v4/android-support-v4.jar"

task androidJavadocs(type: Javadoc, dependsOn: assembleRelease) {
source = releaseVariants.collect { it.javaCompile.source }
classpath = files(releaseVariants.collect { files(it.javaCompile.classpath.files,
project.android.bootClasspath) })
classpath = files(releaseVariants.collect {
files(it.javaCompile.classpath.files, getAndroidJar, getSupportJar)
})
classpath += files("${project.projectDir}/build/intermediates/classes/release")

options {
links('http://docs.oracle.com/javase/7/docs/api/')
linksOffline('http://d.android.com/reference', "${android.sdkDirectory}/docs/reference")
links("http://docs.oracle.com/javase/7/docs/api/")
linksOffline("http://d.android.com/reference",
"${getAndroidSdkDirectory}/docs/reference")
}

exclude '**/BuildConfig.java'
exclude '**/R.java'
}

def cleanJavadocTask = task("cleanJavadocTask", type: Delete) {
delete androidJavadocs.destinationDir
} as Task
project.clean.dependsOn(cleanJavadocTask)

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
Expand Down

0 comments on commit 7049ace

Please sign in to comment.