This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch tapestry-core-jakarta in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
commit 90afe79fc1081369e6fb40bfc66352539e354a4d Author: Thiago H. de Paula Figueiredo <thi...@arsmachina.com.br> AuthorDate: Sat Aug 17 15:57:13 2024 -0300 First pass at creating suffixed artifacts for javax branch --- build.gradle | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 11f89651a..83653bbc4 100755 --- a/build.gradle +++ b/build.gradle @@ -28,8 +28,10 @@ project.ext.versions = [ webdriverManager: "5.3.1" ] -def artifactsToBePublished = ["tapestry-core", "tapestry-http", "tapestry-test", - "tapestry-beanvalidator", "tapestry-runner", "tapestry-spring"] +def artifactSuffix = "-jakarta" + +def suffixedArtifactNames = ["tapestry-core", "tapestry-http", "tapestry-test", + "tapestry-runner", "tapestry-spring"] ext.continuousIntegrationBuild = Boolean.getBoolean("ci") @@ -296,7 +298,7 @@ subprojects { artifact sourcesJar pom { - name = project.name + "-javax" + name = project.name + artifactSuffix // TODO: find some way to get the subproject description here. // description = url = "https://tapestry.apache.org/" @@ -311,9 +313,21 @@ subprojects { developerConnection = 'scm:git://gitbox.apache.org/repos/asf/tapestry-5.git' url = 'https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=summary' } + // Changes the generated pom.xml so its dependencies on suffixed artifacts + // get properly updated with suffixed artifact ids withXml { + def artifactIdQName = new groovy.namespace.QName( + "http://maven.apache.org/POM/4.0.0", "artifactId") def node = asNode(); - println " NNNNNNNode: " + node.get("dependencies") + def dependencies = node.get("dependencies")[0] + if (dependencies != null) { + dependencies.'*'.forEach { + def artifactIdNode = it.getAt(artifactIdQName)[0] + if (suffixedArtifactNames.contains(artifactIdNode.text())) { + artifactIdNode.value = artifactIdNode.text() + artifactSuffix + } + } + } } } matching { @@ -356,7 +370,7 @@ subprojects { } } - def actuallyPublish = artifactsToBePublished.contains(project.name) + def actuallyPublish = suffixedArtifactNames.contains(project.name) if (!actuallyPublish) { tasks.withType(PublishToMavenRepository).configureEach { it.enabled = false } tasks.withType(PublishToMavenLocal).configureEach { it.enabled = false }