-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Scott M Stark <[email protected]>
- Loading branch information
Showing
4 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# TestArtifacts(tcks/apis/messaging/messaging-outside-container/pom.xml): jakarta.tck:jms-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/messaging/messaging-outside-container | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/messaging/messaging-inside-container/pom.xml): jakarta.tck:jms:1.0.9 | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/messaging/messaging-inside-container | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/platform/xa/pom.xml): jakarta.tck:xa:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/platform/xa | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/platform/samples/pom.xml): jakarta.tck:samples:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/platform/samples | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/connector/pom.xml): jakarta.tck:connector:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/connector | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/tags/pom.xml): jakarta.tck:tags-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/tags | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/transactions/pom.xml): jakarta.tck:transactions-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/transactions | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/platform/integration/pom.xml): jakarta.tck:integration:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/platform/integration | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/pages/pom.xml): jakarta.tck:pages-platform-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/pages | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/platform/appclient/pom.xml): jakarta.tck:appclient:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/platform/appclient | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/jsonp/pom.xml): jakarta.tck:jsonp-platform-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/jsonp | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/platform/javaee/pom.xml): jakarta.tck:javaee-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/platform/javaee | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/enterprise-beans/ejb30/pom.xml): jakarta.tck:ejb30:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/enterprise-beans/ejb30 | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/javamail/pom.xml): jakarta.tck:javamail:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/javamail | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/persistence/persistence-inside-container/pom.xml): jakarta.tck:persistence-platform-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/persistence/persistence-inside-container | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/expression-language/expression-language-outside-container/pom.xml): jakarta.tck:jakarta-expression-language-tck:6.0.2-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/expression-language/expression-language-outside-container | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/persistence/persistence-outside-container/pom.xml): jakarta.tck:persistence-tck:3.2.1-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/persistence/persistence-outside-container | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/cdi-ee-tck/tck/pom.xml): jakarta.tck:cdi-tck-ee-impl:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/cdi-ee-tck/tck | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/websocket/pom.xml): jakarta.tck:websocket-tck:2.2.0 | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/websocket | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/jsonb/pom.xml): jakarta.tck:jsonb-platform-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/jsonb | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/core-profile-tck/pom.xml): jakarta.tck.coreprofile:core-tck-parent:11.0.1-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/core-profile-tck | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(user_guides/pom.xml): jakarta.tck:jakarta.tck-user-guide-parent:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/user_guides | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/platform/assembly/pom.xml): jakarta.tck:assembly-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/platform/assembly | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/enterprise-beans/ejb32/pom.xml): jakarta.tck:ejb32:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/enterprise-beans/ejb32 | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/profiles/platform/jdbc/pom.xml): jakarta.tck:jdbc:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/profiles/platform/jdbc | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/rest/pom.xml): jakarta.tck:rest-platform-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/rest | ||
mvn install deploy -DskipTests | ||
# TestArtifacts(tcks/apis/expression-language/expression-language-inside-container/pom.xml): jakarta.tck:el-platform-tck:11.0.0-SNAPSHOT | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/tcks/apis/expression-language/expression-language-inside-container | ||
mvn install deploy -DskipTests | ||
cd /Users/starksm/Dev/Jakarta/platform-tck/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2021 Contributors to the Eclipse Foundation | ||
All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>jakarta.tck</groupId> | ||
<artifactId>versions</artifactId> | ||
<version>11.0.0</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Versions</name> | ||
<description>Tool to version release</description> | ||
<url>https://github.com/jakartaee/platform-tck</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.dom4j</groupId> | ||
<artifactId>dom4j</artifactId> | ||
<version>2.1.4</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>jaxen</groupId> | ||
<artifactId>jaxen</artifactId> | ||
<version>1.1.6</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<!-- Restricts the Java version to 17 --> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.13.0</version> | ||
<configuration> | ||
<release>17</release> | ||
<compilerArgument>-Xlint:all</compilerArgument> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar-no-fork</goal> | ||
</goals> | ||
<phase>verify</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
25 changes: 25 additions & 0 deletions
25
tools/version/src/main/java/ee/tck/versions/TestArtifact.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package ee.tck.versions; | ||
|
||
import java.io.File; | ||
|
||
public record TestArtifact(String groupId, String artifactId, String version, File pomXml) { | ||
public TestArtifact { | ||
if (groupId == null || groupId.isBlank()) { | ||
throw new IllegalArgumentException("groupId is required"); | ||
} | ||
if (artifactId == null || artifactId.isBlank()) { | ||
throw new IllegalArgumentException("artifactId is required"); | ||
} | ||
if (version == null || version.isBlank()) { | ||
throw new IllegalArgumentException("version is required"); | ||
} | ||
} | ||
|
||
public String toString() { | ||
return String.format("TestArtifacts(%s): %s:%s:%s", pomXml.getPath(), groupId, artifactId, version); | ||
} | ||
|
||
public String getPomDir() { | ||
return pomXml.getParentFile().getAbsolutePath(); | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
tools/version/src/main/java/ee/tck/versions/VersionRelease.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package ee.tck.versions; | ||
|
||
|
||
import org.dom4j.Document; | ||
import org.dom4j.Element; | ||
import org.dom4j.Node; | ||
import org.dom4j.io.SAXReader; | ||
|
||
import java.io.File; | ||
import java.io.FileWriter; | ||
import java.io.IOException; | ||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
|
||
/** | ||
* | ||
*/ | ||
public class VersionRelease { | ||
// The x.y version of the platform | ||
private static final String TCK_BASE_VERSION = "11.0"; | ||
public static void main(String[] args) throws Exception { | ||
if (args.length == 0) { | ||
System.out.println("Usage: VersionRelease <version>"); | ||
System.exit(1); | ||
} | ||
String version = args[0]; | ||
new VersionRelease().run(version); | ||
} | ||
|
||
private HashSet<TestArtifact> artifacts = new HashSet<>(); | ||
|
||
private void run(String version) throws Exception{ | ||
SAXReader reader = new SAXReader(); | ||
Document document = reader.read(new File("pom.xml")); | ||
|
||
Element project = document.getRootElement(); | ||
List<Node> list = document.selectNodes("/project/modules/module"); | ||
System.out.println("Modules:" + list.size()); | ||
|
||
List<Element> modules = project.elements("modules"); | ||
modules.get(0).elements("module").forEach(module -> { | ||
File moduleFile = new File(module.getText() + "/pom.xml"); | ||
try { | ||
Document moduleDocument = reader.read(moduleFile); | ||
Element moduleProject = moduleDocument.getRootElement(); | ||
String moduleVersion = getVersion(moduleProject); | ||
String moduleGroupId = getGroupId(moduleProject); | ||
String moduleArtifactId = moduleProject.element("artifactId").getText(); | ||
TestArtifact testArtifact = new TestArtifact(moduleGroupId, moduleArtifactId, moduleVersion, moduleFile); | ||
artifacts.add(testArtifact); | ||
System.out.printf("%s\n", testArtifact); | ||
if(moduleVersion.startsWith(TCK_BASE_VERSION)) { | ||
System.out.println("Update version"); | ||
moduleProject.element("version").setText(version); | ||
Element parentVersion = moduleProject.element("parent").element("version"); | ||
if (parentVersion.getText().startsWith(TCK_BASE_VERSION)) { | ||
parentVersion.setText(version); | ||
} | ||
} | ||
// Write the updated module file | ||
try(FileWriter writer = new FileWriter(moduleFile)) { | ||
moduleDocument.write(writer); | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
}); | ||
|
||
// Write a release script for deploying the artifacts | ||
writeReleaseScript(version); | ||
// Write a bom for the artifacts | ||
} | ||
|
||
void writeReleaseScript(String version) throws IOException { | ||
System.out.println("Write release script"); | ||
FileWriter writer = new FileWriter("release.sh"); | ||
File root = new File("."); | ||
for (TestArtifact artifact : artifacts) { | ||
writer.write(String.format("# %s\n", artifact)); | ||
writer.write(String.format("cd %s\n", artifact.getPomDir())); | ||
writer.write("mvn install deploy -DskipTests\n"); | ||
} | ||
writer.write(String.format("cd %s\n", root.getAbsolutePath())); | ||
writer.close(); | ||
} | ||
String getVersion(Element root) { | ||
return getInfo(root, "version"); | ||
} | ||
String getGroupId(Element root) { | ||
return getInfo(root, "groupId"); | ||
} | ||
String getInfo(Element root, String name) { | ||
Element versionElement = root.element(name); | ||
if (versionElement != null) { | ||
return versionElement.getText(); | ||
} else { | ||
return root.element("parent").element(name).getText(); | ||
} | ||
} | ||
} |