Skip to content

Commit

Permalink
Use an older version of shardingsphere-infra-util in Espresso's Truff…
Browse files Browse the repository at this point in the history
…le context
  • Loading branch information
linghengqian committed Jan 31, 2023
1 parent 5f765b3 commit 7ee3e88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions infra/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@
<goals>
<goal>copy</goal>
</goals>
<phase>package</phase>
<phase>process-test-classes</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-infra-util-groovy</artifactId>
<version>${project.version}</version>
<artifactId>shardingsphere-infra-util</artifactId>
<version>5.3.1</version>
<type>jar</type>
<overWrite>true</overWrite>
<destFileName>shardingsphere-infra-util-groovy.jar</destFileName>
<destFileName>shardingsphere-infra-util.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.apache.groovy</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.shardingsphere.infra.util.expr;

import groovy.lang.Closure;
import org.apache.shardingsphere.infra.util.groovy.expr.HotspotInlineExpressionParser;
import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Value;

Expand Down Expand Up @@ -48,7 +47,7 @@ public class EspressoInlineExpressionParser {
URL resource = Thread.currentThread().getContextClassLoader().getResource("espresso-need-libs");
assert null != resource;
String dir = resource.getPath();
String javaClasspath = String.join(":", dir + "/groovy.jar", dir + "/guava.jar", dir + "/shardingsphere-infra-util-groovy.jar");
String javaClasspath = String.join(":", dir + "/groovy.jar", dir + "/guava.jar", dir + "/shardingsphere-infra-util.jar");
POLYGLOT = Context.newBuilder().allowAllAccess(true)
.option("java.MultiThreaded", "true")
.option("java.Classpath", javaClasspath)
Expand All @@ -57,7 +56,7 @@ public class EspressoInlineExpressionParser {

public EspressoInlineExpressionParser(final String inlineExpression) {
espressoInlineExpressionParser = POLYGLOT.getBindings("java")
.getMember(HotspotInlineExpressionParser.class.getName())
.getMember("org.apache.shardingsphere.infra.util.expr.InlineExpressionParser")
.newInstance(inlineExpression);
}

Expand All @@ -69,7 +68,7 @@ public EspressoInlineExpressionParser(final String inlineExpression) {
*/
public static String handlePlaceHolder(final String inlineExpression) {
return POLYGLOT.getBindings("java")
.getMember(HotspotInlineExpressionParser.class.getName())
.getMember("org.apache.shardingsphere.infra.util.expr.InlineExpressionParser")
.invokeMember("handlePlaceHolder", inlineExpression)
.as(String.class);
}
Expand Down

0 comments on commit 7ee3e88

Please sign in to comment.