diff options
author | Victor Häggqvist <[email protected]> | 2015-09-17 17:48:17 +0200 |
---|---|---|
committer | Victor Häggqvist <[email protected]> | 2015-09-17 17:48:17 +0200 |
commit | a19f657fe34def1f12ad04035418c74297fbb468 (patch) | |
tree | 5fcedb3ba42dfb2679c6315ad3abc9bc35373376 /aboutit | |
parent | b9803311977d0155dc05eaa4b563443ca19132dc (diff) |
publish javadoc
Diffstat (limited to '')
-rw-r--r-- | aboutit/build.gradle | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/aboutit/build.gradle b/aboutit/build.gradle index d377df0..c6ebbc8 100644 --- a/aboutit/build.gradle +++ b/aboutit/build.gradle @@ -81,4 +81,33 @@ uploadArchives { } } } -}
\ No newline at end of file +} + +android.libraryVariants.all { variant -> + task("${variant.name}Javadoc", type: Javadoc, dependsOn: "assemble${variant.name.capitalize()}") { + source = variant.javaCompile.source + + title = "AboutIt" + + options.links("http://docs.oracle.com/javase/7/docs/api/"); + options.linksOffline("http://d.android.com/reference","${android.sdkDirectory}/docs/reference"); + + // First add all of your dependencies to the classpath, then add the android jars + classpath += files(variant.javaCompile.classpath.files) + classpath += files(android.getBootClasspath()) + + // We're excluding these generated files + exclude '**/BuildConfig.java' + exclude '**/R.java' + } +} + +android.libraryVariants.all { variant -> + task("${variant.name}JavadocJar", type: Jar, dependsOn: "${variant.name}Javadoc") { + classifier = 'javadoc' + from tasks["${variant.name}Javadoc"].destinationDir + } + + // Add the Javadoc jar to the project's artifacts. This will allow us to upload it easily later + project.artifacts.add("archives", tasks["${variant.name}JavadocJar"]); +} |