Skip to content

Commit

Permalink
Fix artifact names (post Gradle to 8.5 update)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta committed Jan 8, 2024
1 parent ff60571 commit 543ff4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ class BuildPlugin implements Plugin<Project> {
// Set the pom's destination to the distribution directory
project.tasks.withType(GenerateMavenPom).all { GenerateMavenPom pom ->
if (pom.name == "generatePomFileFor${publication.name.capitalize()}Publication") {
pom.destination = project.provider({"${project.buildDir}/poms/${project.base.archivesName}-${project.getVersion()}.pom"})
pom.destination = project.provider({"${project.buildDir}/poms/${project.base.archivesName.get()}-${project.getVersion()}.pom"})
}
}

Expand Down Expand Up @@ -738,7 +738,7 @@ class BuildPlugin implements Plugin<Project> {
private static void updateVariantPomLocationAndArtifactId(Project project, MavenPublication publication, SparkVariant variant) {
// Add variant classifier to the pom file name if required
String classifier = variant.shouldClassifySparkVersion() && variant.isDefaultVariant() == false ? "-${variant.getName()}" : ''
String filename = "${project.base.archivesName}_${variant.scalaMajorVersion}-${project.getVersion()}${classifier}"
String filename = "${project.base.archivesName.get()}_${variant.scalaMajorVersion}-${project.getVersion()}${classifier}"
// Fix the pom name
project.tasks.withType(GenerateMavenPom).all { GenerateMavenPom pom ->
if (pom.name == "generatePomFileFor${publication.name.capitalize()}Publication") {
Expand All @@ -749,7 +749,7 @@ class BuildPlugin implements Plugin<Project> {
publication.getPom().withXml { XmlProvider xml ->
Node root = xml.asNode()
Node artifactId = (root.get('artifactId') as NodeList).get(0) as Node
artifactId.setValue("${project.base.archivesName}_${variant.scalaMajorVersion}")
artifactId.setValue("${project.base.archivesName.get()}_${variant.scalaMajorVersion}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ publishing {
repository.appendNode('url', 'https://clojars.org/repo')

// Correct the artifact Id, otherwise it is listed as 'dist'
root.get('artifactId').get(0).setValue(project.base.archivesName)
root.get('artifactId').get(0).setValue(project.base.archivesName.get())
}
}
}
Expand Down

0 comments on commit 543ff4f

Please sign in to comment.