Skip to content

Commit

Permalink
Fix publishing of the documentation artifact under jpro-media subpr…
Browse files Browse the repository at this point in the history
…oject
  • Loading branch information
besidev committed Oct 24, 2023
1 parent ebd2627 commit 63851c7
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions jpro-media/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ test {
onlyIf { !Boolean.getBoolean("ciTest") }
}

tasks.register('renameReadme', Copy) {
from 'README.md'
into layout.buildDirectory.dir('docs')
rename 'README.md', 'DOCUMENTATION.md'

doLast {
println("Renamed README.md to DOCUMENTATION.md")
}
}

javadoc {
options {
encoding = 'UTF-8'
Expand All @@ -50,11 +60,13 @@ javadoc {
}
}

javadocJar.dependsOn renameReadme

publishing {
publications {
mavenJava(MavenPublication) {
// Add README.md as an artifact named DOCUMENTATION.md
artifact(source: file('build/tmp/DOCUMENTATION.md')) {
artifact(source: file('build/docs/DOCUMENTATION.md')) {
classifier 'documentation'
extension 'md'
}
Expand All @@ -77,12 +89,3 @@ publishing {
}
}
}

tasks.register('renameReadme', Copy) {
from layout.projectDirectory
include 'README.md'
into layout.buildDirectory.dir('tmp')
rename 'README.md', 'DOCUMENTATION.md'
}

publish.mustRunAfter('renameReadme')

0 comments on commit 63851c7

Please sign in to comment.