Skip to content

Commit 33c13e2

Browse files
Fixed release publishing failing to build the javadoc jar (#1024)
* Fixed release publishing failing to build the javadoc jar AGP generates the published javadoc with Dokka 1.4.32, which cannot read the sealed classes in livekit-uniffi-android and fails with "PermittedSubclasses requires ASM9". Disabled AGP's javadoc generation and packaged the javadoc jar from the project's Dokka 1.9.20 dokkaJavadoc task instead. * Generated the javadoc into AGP's output directory instead of appending to the jar Disabling AGP's javadoc generation left any output from an earlier build in place, and the jar, which fails on duplicate files, then packaged it next to the Dokka output. The generation task now syncs the Dokka output into its own output directory, so the jar keeps its single input and stale files are removed.
1 parent 66288fc commit 33c13e2

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎livekit-android-sdk/build.gradle‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,27 @@ dokkaHtml {
113113
}
114114
}
115115

116+
interface InjectedFileSystemOperations {
117+
@javax.inject.Inject
118+
FileSystemOperations getFs()
119+
}
120+
121+
// AGP generates the published javadoc with Dokka 1.4.32, which fails to read the sealed classes
122+
// in livekit-uniffi-android ("PermittedSubclasses requires ASM9"). The generation task fills its
123+
// output directory from this project's Dokka instead, and the javadoc jar packages that directory.
124+
tasks.withType(com.android.build.gradle.tasks.JavaDocGenerationTask).configureEach { task ->
125+
def fs = objects.newInstance(InjectedFileSystemOperations).fs
126+
def dokkaJavadocOutput = files(tasks.named("dokkaJavadoc"))
127+
task.inputs.files(dokkaJavadocOutput)
128+
task.actions.clear()
129+
task.doLast { generationTask ->
130+
fs.sync {
131+
from(dokkaJavadocOutput)
132+
into(generationTask.outputDirectory)
133+
}
134+
}
135+
}
136+
116137
dependencies {
117138
//api fileTree(dir: 'libs', include: ['*.jar'])
118139
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

0 commit comments

Comments
 (0)