Dokka: Module publication broken on Dokka 0.10+

Created on 26 Mar 2020  路  2Comments  路  Source: Kotlin/dokka

Describe the bug
When trying to :publish an Android library with a project() dependency on another java-library module, Dokka 0.10.0+ results in an error due to not being able to resolve the dependency jar file that is not built yet.

Expected behavior
I would expect that running the publication task on a module would trigger the appropriate dependent build tasks, and then proceed in packaging the aforementioned module's artifacts for publication.

To Reproduce
Download the small project attached project.zip
and execute the following task: android-lib:publishToMavenLocal.

This results in the following error:

* What went wrong:
Could not determine the dependencies of task ':android-lib:dokka'.
> Could not resolve all files for configuration ':android-lib:releaseCompileClasspath'.
   > Failed to transform some-lib.jar (project :some-lib) to match attributes {artifactType=android-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.usage=java-api, org.jetbrains.kotlin.localToProject=public, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for JetifyTransform: [...]/some-lib/build/libs/some-lib.jar.
         > Failed to transform '[...]/some-lib/build/libs/some-lib.jar' using Jetifier. Reason: [...]/some-lib/build/libs/some-lib.jar (No such file or directory). (Run with --stacktrace for more details.)

Installation

  • Operating system: macOS
  • Build tool: Gradle v6.1.1
  • Dokka version: 0.10.1

Additional context
This was previously working when using v0.9.18
In the example project, applying the following changes will cause the publication to succeed:

===================================================================
--- android-lib/build.gradle    
+++ android-lib/build.gradle
@@ -4,7 +4,7 @@
 apply plugin: 'maven-publish'
 apply from: "$rootDir/gradle/scripts/android.gradle"

-apply plugin: "org.jetbrains.dokka"
+apply plugin: "org.jetbrains.dokka-android"

 dokka {
     outputFormat = "javadoc"
===================================================================
--- build.gradle
+++ build.gradle
@@ -11,7 +11,7 @@
 }

 plugins {
-    id "org.jetbrains.dokka" version "0.10.1" apply false // broken
+    id "org.jetbrains.dokka-android" version "0.9.18" apply false
 }

 allprojects {
bug

Most helpful comment

@kamildoleglo Is this still relevant for 0.11.0?

All 2 comments

Thanks for reporting!
You can run ./gradlew build explicitly before publishToMavenLocal and it will fix this problem, but we should fix it in our plugin

@kamildoleglo Is this still relevant for 0.11.0?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juergenzimmermann picture juergenzimmermann  路  3Comments

fschoellhammer picture fschoellhammer  路  6Comments

jnizet picture jnizet  路  5Comments

Egorand picture Egorand  路  3Comments

xit0c picture xit0c  路  4Comments