From a19f657fe34def1f12ad04035418c74297fbb468 Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Thu, 17 Sep 2015 17:48:17 +0200 Subject: publish javadoc --- aboutit/build.gradle | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'aboutit') 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"]); +} -- cgit v1.2.3