Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue that Android libraries was not published #887

Merged
merged 2 commits into from Aug 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -64,13 +64,23 @@ publishing {
}
}*/
}
// Configure for Android libraries
publications {
if (project.extensions.findByName("android") != null) {
register<MavenPublication>("release") {
afterEvaluate {
from(components["release"])
}
}
}
}
publications.withType<MavenPublication>().configureEach {
createMockKPom {
name.set(provider { mavenName })
description.set(provider { mavenDescription })
}

artifact(tasks.provider<Jar>("javadocJar"))
artifact(tasks.provider<Task>("javadocJar"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this change is that the following error occurs.

> The task 'javadocJar' (org.gradle.jvm.tasks.Jar) is not a subclass of the given type (org.gradle.api.tasks.bundling.Jar).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to have been caused by importing org.gradle.jvm.tasks.Jar in android-library.gradle.kts.
Removing import from android-library.gradle.kts solved the problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks


signing.sign(this)
}
Expand Down