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 artifact names (post Gradle to 8.5 update) #386

Merged
merged 1 commit into from
Jan 8, 2024
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `org.json4s:json4s-jackson_2.12` from 4.0.6 to 4.0.7

### Changed
- Update Gradle to 8.5 ([#377](https://github.com/opensearch-project/opensearch-hadoop/pull/377))
- Update Gradle to 8.5 ([#377](https://github.com/opensearch-project/opensearch-hadoop/pull/377), [#386](https://github.com/opensearch-project/opensearch-hadoop/pull/386))

### Deprecated

Expand Down
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
Loading