|
1 | 1 | import com.android.build.gradle.BaseExtension
|
| 2 | +import com.android.build.gradle.LibraryExtension |
2 | 3 | import com.jfrog.bintray.gradle.BintrayExtension
|
3 | 4 | import com.jfrog.bintray.gradle.tasks.RecordingCopyTask
|
4 | 5 | import org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention
|
@@ -42,16 +43,6 @@ allprojects {
|
42 | 43 | mavenLocal()
|
43 | 44 | }
|
44 | 45 |
|
45 |
| - // Skip Javadoc generation for Java 1.8 as it breaks build |
46 |
| - if (JavaVersion.current().isJava8Compatible) { |
47 |
| - tasks.withType<Javadoc> { |
48 |
| - options { |
49 |
| - this as StandardJavadocDocletOptions |
50 |
| - addStringOption("Xdoclint:none", "-quiet") |
51 |
| - } |
52 |
| - } |
53 |
| - } |
54 |
| - |
55 | 46 | if ((group as String).isNotEmpty() && name != "lint" && name != "internal") {
|
56 | 47 | configureAndroid()
|
57 | 48 | configureQuality()
|
@@ -148,9 +139,18 @@ fun Project.setupPublishing() {
|
148 | 139 | }
|
149 | 140 |
|
150 | 141 | val javadoc = tasks.register<Javadoc>("javadoc") {
|
151 |
| - setSource(project.the<BaseExtension>().sourceSets["main"].java.srcDirs) |
152 |
| - classpath += configurations["compile"] |
153 |
| - classpath += project.files(project.the<BaseExtension>().bootClasspath) |
| 142 | + afterEvaluate { |
| 143 | + dependsOn(project.the<LibraryExtension>().libraryVariants.map { it.assemble }) |
| 144 | + |
| 145 | + setSource(project.the<BaseExtension>().sourceSets["main"].java.srcDirs) |
| 146 | + classpath += files(project.the<BaseExtension>().bootClasspath) |
| 147 | + classpath += files(project.the<LibraryExtension>().libraryVariants.map { |
| 148 | + (it.javaCompiler as AbstractCompile).classpath |
| 149 | + }) |
| 150 | + } |
| 151 | + |
| 152 | + // Ignore warnings about incomplete documentation |
| 153 | + (options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet") |
154 | 154 | }
|
155 | 155 |
|
156 | 156 | val javadocJar = tasks.register<Jar>("javadocJar") {
|
@@ -199,7 +199,7 @@ fun Project.setupPublishing() {
|
199 | 199 | }.toTypedArray())
|
200 | 200 | }
|
201 | 201 | } else {
|
202 |
| - val pomTask = "generatePomFileFor${project.name.capitalize()}LibraryPublication" |
| 202 | + val pomTask = "generatePomFileFor${name.capitalize()}LibraryPublication" |
203 | 203 | tasks.register("prepareArtifacts") {
|
204 | 204 | dependsOn(javadocJar, sourcesJar, "assembleRelease", pomTask)
|
205 | 205 | }
|
|
0 commit comments