From 6a995426c662b487282d2a0089a98e72e178f6e1 Mon Sep 17 00:00:00 2001 From: fishjd Date: Tue, 30 Jan 2018 17:33:42 -0700 Subject: [PATCH] Add JavaDoc and Source task to allow to be published in jitpack.io. --- wbsnotchview/build.gradle | 25 +++++++++++++++++++++++++ wbsseekbar/build.gradle | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/wbsnotchview/build.gradle b/wbsnotchview/build.gradle index 470ea7c..96eda6e 100644 --- a/wbsnotchview/build.gradle +++ b/wbsnotchview/build.gradle @@ -37,3 +37,28 @@ dependencies { androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' } + + +// build a jar with source files +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + failOnError false + source = android.sourceSets.main.java.sourceFiles + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + classpath += configurations.compile +} + +// build a jar with javadoc +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} \ No newline at end of file diff --git a/wbsseekbar/build.gradle b/wbsseekbar/build.gradle index d5f7acd..17c7c86 100644 --- a/wbsseekbar/build.gradle +++ b/wbsseekbar/build.gradle @@ -38,3 +38,28 @@ dependencies { androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' } + + +// build a jar with source files +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + failOnError false + source = android.sourceSets.main.java.sourceFiles + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + classpath += configurations.compile +} + +// build a jar with javadoc +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} \ No newline at end of file