Status Update
Comments
kf...@gmail.com <kf...@gmail.com> #2
As a temporary workaround, we can override the "archiveFileName" at the project level to achieve the expected behavior:
android {
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
afterEvaluate {
tasks.named('sourceReleaseJar') {
archiveFileName.set('sources.jar')
}
tasks.named('javaDocReleaseJar') {
archiveFileName.set('javadoc.jar')
}
}
}
https://github.com/kfaraj/support
android {
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
afterEvaluate {
tasks.named('sourceReleaseJar') {
archiveFileName.set('sources.jar')
}
tasks.named('javaDocReleaseJar') {
archiveFileName.set('javadoc.jar')
}
}
}
lo...@gmail.com <lo...@gmail.com> #3
There's a fix in AGP 7.1.2 saying
Issue #201080958: AGP 7.1 new publishing API: created javadoc jar does not get signed
Maybe it got fixed?
lo...@gmail.com <lo...@gmail.com> #4
Confirmed it's fixed in AGP 7.1.2
Description
However, both the generated Javadoc JAR and sources JAR have the same name: "out.jar"
As a consequence, the Signing Plugin only signs one "out.jar" but not both.
Then, releasing a library on Maven Central fails due to missing signature.
The expected behavior would be that the generated Javadoc JAR and sources JAR have different names: "javadoc.jar" and "sources.jar"
As a consequence, the Signing Plugin would sign both "javadoc.jar" and "sources.jar".
Then, releasing a library on Maven Central would succeed.
After checking out the source code of the Android Gradle plugin on the "studio-2021.1.1" branch, I would like to submit this patch:
- replace "out.jar" with "sources.jar" in "tools/base/build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/SourceJarTask.kt"
- replace "out.jar" with "javadoc.jar" in "tools/base/build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/JavaDocJarTask.kt"
Disclaimer:
This issue should be created in "Android Public Tracker > App Development > Android Studio > Gradle > Android Gradle Plugin" but I "do not have permission to create issues in this component".