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 maven publish #973

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ nexusPublishing {
}
}


// "JavaDoc" artifact for all publications.
task jarJavaDocs(type: Jar) {
group project.letsPlotTaskGroup
archiveClassifier.set("javadoc")
from("$rootDir/README.md")
}

// Publish some sub-projects as Kotlin Multiproject libraries.
task publishLetsPlotCoreModulesToMavenLocalRepository {
group project.letsPlotTaskGroup
Expand All @@ -149,6 +141,21 @@ task publishLetsPlotCoreModulesToMavenRepository {
group project.letsPlotTaskGroup
}

// Generating JavaDoc task for each publication task.
// Fixes "Task ':canvas:publishJsPublicationToMavenRepository' uses this output of task ':canvas:signJvmPublication'
// without declaring an explicit or implicit dependency" error.
// Issues:
// - https://github.com/gradle-nexus/publish-plugin/issues/208
// - https://github.com/gradle/gradle/issues/26091
//
def getJarJavaDocsTask(distributeName) {
return tasks.register("${distributeName}${project.name}jarJavaDoc", Jar) {
archiveClassifier.set("javadoc")
from("$rootDir/README.md")
archiveBaseName.set("${distributeName}")
}
}

subprojects {
// Configure Kotlin targets.
// List of modules used in Python native extension:
Expand Down Expand Up @@ -220,7 +227,9 @@ subprojects {
withType(MavenPublication) {
if (name in publications_to_publish) {
// Configure this publication.
artifact rootProject.jarJavaDocs

// "JavaDoc" artifact for all publications.
artifact getJarJavaDocsTask("${name}-${project.name}")

pom {
name = "Lets-Plot core artifact"
Expand Down
2 changes: 1 addition & 1 deletion plot-image-export/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ publishing {

artifact jvmJar
artifact jvmSourcesJar
artifact rootProject.jarJavaDocs
artifact rootProject.getJarJavaDocsTask("${artifactBaseName}-${project.name}")

pom {
name = "Lets-Plot raster image export"
Expand Down