This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/master by this push:
     new 88d0aa49d TAP5-2785: suffixing jakarta.servlet artifacts
88d0aa49d is described below

commit 88d0aa49d1194535edb0e2e5b775237b27b82b2d
Author: Thiago H. de Paula Figueiredo <[email protected]>
AuthorDate: Sun Aug 18 12:08:10 2024 -0300

    TAP5-2785: suffixing jakarta.servlet artifacts
---
 build.gradle | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index cd51c5987..c257c7c4b 100755
--- a/build.gradle
+++ b/build.gradle
@@ -28,6 +28,13 @@ project.ext.versions = [
     webdriverManager: "5.3.1"
 ]
 
+def artifactSuffix = "-jakarta"
+
+// Artifacts that have both an unsuffixed artifact from the javax branch
+// and a suffixed one from the master branch
+def suffixedArtifactNames = ["tapestry-core", "tapestry-http", "tapestry-test",
+        "tapestry-runner", "tapestry-spring"]
+
 ext.continuousIntegrationBuild = Boolean.getBoolean("ci")
 
 // Provided so that the CI server can override the normal version number for 
nightly builds.
@@ -40,7 +47,7 @@ project.version = tapestryVersion()
 
 def tapestryVersion() {
 
-    def major = "5.50.0"
+    def major = "5.8.8"
     def minor = ""
 
     // When building on the CI server, make sure -SNAPSHOT is appended, as it 
is a nightly build.
@@ -289,6 +296,9 @@ subprojects {
             mavenJava(MavenPublication) {
                 version = parent.version
                 groupId = "org.apache.tapestry"
+                if (suffixedArtifactNames.contains(project.name)) {
+                    artifactId = project.name + artifactSuffix
+                }
                 from components.java
                 artifact sourcesJar
 
@@ -308,6 +318,22 @@ 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();
+                        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 {
                     it.name.endsWith(".jar") || it.name.endsWith(".pom")
@@ -348,6 +374,13 @@ subprojects {
             sign publishing.publications.mavenJava
         }
     }
+    
+    def actuallyPublish = !artifactSuffix.isEmpty() || 
suffixedArtifactNames.contains(project.name)
+    // println "XXXXXX Actually publish? " + actuallyPublish + " project " + 
project.name + " " + "!artifactSuffix.isEmpty() " + !artifactSuffix.isEmpty()
+    if (!actuallyPublish) {
+        tasks.withType(PublishToMavenRepository).configureEach { it.enabled = 
false }
+        tasks.withType(PublishToMavenLocal).configureEach { it.enabled = false 
}
+    }
 
     task uploadPublished {
 

Reply via email to