diff options
-rw-r--r-- | aboutit/build.gradle | 31 | ||||
-rw-r--r-- | publishJavadoc.sh | 12 |
2 files changed, 42 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"]); +} diff --git a/publishJavadoc.sh b/publishJavadoc.sh new file mode 100644 index 0000000..c2f3811 --- /dev/null +++ b/publishJavadoc.sh @@ -0,0 +1,12 @@ +gradle releaseJavadoc +git clone --branch=gh-pages --single-branch [email protected]:victorhaggqvist/AboutIt.git ghpages +pushd ghpages +rm -rf * +popd +cp -r aboutit/build/docs/javadoc/* ghpages +pushd ghpages +git add . +git commit -m "Update JavaDoc" +git push --force +popd +rm -rf ghpages
\ No newline at end of file |