Cole-Greer commented on code in PR #3341:
URL: https://github.com/apache/tinkerpop/pull/3341#discussion_r2984391235


##########
gremlin-js/gremlin-mcp/pom.xml:
##########
@@ -37,6 +38,46 @@ limitations under the License.
         <directory>${basedir}/target</directory>
         <finalName>${project.artifactId}-${project.version}</finalName>
         <plugins>
+            <plugin>
+                <!--
+                Use gmavenplus-plugin to:
+                    - Update the package version and gremlin dependency version
+                -->
+                <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}"
+                                    def versionForJs = 
mavenVersion.replace("-SNAPSHOT", "-alpha1")
+                                    def platformAgnosticBaseDirPath = 
project.basedir.getAbsolutePath().replace("\\", "/")
+                                    def file = new 
File(platformAgnosticBaseDirPath + "/package.json")
+                                    def content = file.getText("UTF-8")
+                                    content = content.replaceFirst(/"version": 
"(.*)",/, "\"version\": \"" + versionForJs + "\",")
+                                    content = content.replaceFirst(/"gremlin": 
"[^"]+"/, "\"gremlin\": \"" + versionForJs + "\"")

Review Comment:
   ```suggestion
                                       content = 
content.replaceFirst(/"gremlin": "[^"]+"/, "\"gremlin\": \"" + versionForJs + 
"\"")
                                       content = 
content.replaceFirst(/"gremlint": "[^"]+"/, "\"gremlint\": \"" + versionForJs + 
"\"")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to