You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by co...@apache.org on 2026/07/22 19:13:38 UTC
(tinkerpop) 01/03: Automate GLV version propagation for Python, JavaScript, and Gremlint
This is an automated email from the ASF dual-hosted git repository.
Cole-Greer pushed a commit to branch version-propagation
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit b9fc8b08ab3eef24f04f05bb400ec1e68e9b7373
Author: Cole Greer <co...@colegreer.ca>
AuthorDate: Tue Jul 21 15:38:07 2026 -0700
Automate GLV version propagation for Python, JavaScript, and Gremlint
---
gremlin-javascript/pom.xml | 14 +++++++++
.../javascript/gremlin-javascript/lib/utils.js | 2 +-
gremlin-python/pom.xml | 36 ++++++++++++++++++++++
gremlint/pom.xml | 9 ++++++
4 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index dea2967ef9..d36ae807c5 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -112,8 +112,21 @@ limitations under the License.
def mavenVersion = "${project.version}"
def versionForJs = mavenVersion.replace("-SNAPSHOT", "-alpha1")
def platformAgnosticBaseDirPath = project.basedir.getAbsolutePath().replace("\\", "/")
+
+ // Update package.json
def file = new File(platformAgnosticBaseDirPath + "/src/main/javascript/gremlin-javascript/package.json")
file.write(file.getText("UTF-8").replaceFirst(/"version": "(.*)",/, "\"version\": \"" + versionForJs + "\","))
+
+ // Update package-lock.json
+ file = new File(platformAgnosticBaseDirPath + "/src/main/javascript/gremlin-javascript/package-lock.json")
+ def lockContent = file.getText("UTF-8")
+ lockContent = lockContent.replaceFirst(/"version": ".*",\n\s+"lockfileVersion"/, "\"version\": \"" + versionForJs + "\",\n \"lockfileVersion\"")
+ lockContent = lockContent.replaceFirst(/("": \{\n\s+"name": "gremlin",\n\s+"version": )".*"/, "\$1\"" + versionForJs + "\"")
+ file.write(lockContent)
+
+ // Update utils.js
+ file = new File(platformAgnosticBaseDirPath + "/src/main/javascript/gremlin-javascript/lib/utils.js")
+ file.write(file.getText("UTF-8").replaceFirst(/gremlinVersion = '.*'/, "gremlinVersion = '" + versionForJs + "'"))
</script>
</scripts>
</configuration>
@@ -223,6 +236,7 @@ limitations under the License.
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<configuration>
+ <skip>true</skip>
<file>src/main/javascript/gremlin-javascript/lib/utils.js</file>
<replacements>
<replacement>
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
index e2fd9b0250..686fe53e9d 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/utils.js
@@ -25,7 +25,7 @@
const uuid = require('uuid');
-const gremlinVersion = '3.7.7-SNAPSHOT'; // DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
+const gremlinVersion = '3.7.7-alpha1'; // DO NOT MODIFY - Configured automatically by Maven build
exports.toLong = function toLong(value) {
return new Long(value);
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index 21ccc02a84..d80f849d96 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -82,6 +82,42 @@ limitations under the License.
</replacements>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>${groovy.version}</version>
+ <type>pom</type>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>update-version</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <scripts>
+ <script>
+ def mavenVersion = "${project.version}"
+ // Translate Maven version to PEP 440:
+ // "x.y.z-SNAPSHOT" -> "x.y.z.dev1"
+ // "x.y.z" -> "x.y.z"
+ def pythonVersion = mavenVersion.replace("-SNAPSHOT", ".dev1")
+ def platformAgnosticBaseDirPath = project.basedir.getAbsolutePath().replace("\\", "/")
+ def file = new File(platformAgnosticBaseDirPath + "/src/main/python/gremlin_python/__init__.py")
+ file.write(file.getText("UTF-8").replaceFirst(/__version__ = '.*'/, "__version__ = '" + pythonVersion + "'"))
+ </script>
+ </scripts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/gremlint/pom.xml b/gremlint/pom.xml
index 43984f33c0..1a9b16122a 100644
--- a/gremlint/pom.xml
+++ b/gremlint/pom.xml
@@ -82,8 +82,17 @@ limitations under the License.
<script>
def versionForJs = mavenVersion.replace("-SNAPSHOT", "-alpha1")
def platformAgnosticBaseDirPath = project.basedir.getAbsolutePath().replace("\\","/")
+
+ // Update package.json
def file = new File(platformAgnosticBaseDirPath + "/package.json")
file.write(file.getText("UTF-8").replaceFirst(/"version": "(.*)",/, "\"version\": \"" + versionForJs + "\","))
+
+ // Update package-lock.json
+ file = new File(platformAgnosticBaseDirPath + "/package-lock.json")
+ def lockContent = file.getText("UTF-8")
+ lockContent = lockContent.replaceFirst(/"version": ".*",\n\s+"lockfileVersion"/, "\"version\": \"" + versionForJs + "\",\n \"lockfileVersion\"")
+ lockContent = lockContent.replaceFirst(/("": \{\n\s+"name": "gremlint",\n\s+"version": )".*"/, "\$1\"" + versionForJs + "\"")
+ file.write(lockContent)
</script>
</scripts>
</configuration>