You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/12/02 11:33:06 UTC

[46/50] tinkerpop git commit: TINKERPOP-1562 Fixed the InstallCommand for new GremlinPlugin usage.

TINKERPOP-1562 Fixed the InstallCommand for new GremlinPlugin usage.

DependencyGrabber wasn't using the right Artifact implementation and wasn't taking into account -Dplugins=v3d3


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d68f6938
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d68f6938
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d68f6938

Branch: refs/heads/TINKERPOP-1562
Commit: d68f69383464f8f54b98acecf99a39587f2e4839
Parents: ae45eca
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 1 08:25:19 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 2 06:31:51 2016 -0500

----------------------------------------------------------------------
 .../gremlin/console/commands/InstallCommand.groovy    | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d68f6938/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/commands/InstallCommand.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/commands/InstallCommand.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/commands/InstallCommand.groovy
index a680757..c8a49df 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/commands/InstallCommand.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/commands/InstallCommand.groovy
@@ -21,9 +21,9 @@ package org.apache.tinkerpop.gremlin.console.commands
 import org.apache.tinkerpop.gremlin.console.ConsoleFs
 import org.apache.tinkerpop.gremlin.console.Mediator
 import org.apache.tinkerpop.gremlin.console.plugin.PluggedIn
-import org.apache.tinkerpop.gremlin.groovy.plugin.Artifact
 import org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin
 import groovy.grape.Grape
+import org.apache.tinkerpop.gremlin.groovy.util.Artifact
 import org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber
 import org.codehaus.groovy.tools.shell.CommandSupport
 import org.codehaus.groovy.tools.shell.Groovysh
@@ -64,9 +64,17 @@ class InstallCommand extends CommandSupport {
 
         // note that the service loader utilized the classloader from the groovy shell as shell class are available
         // from within there given loading through Grape.
-        ServiceLoader.load(GremlinPlugin.class, shell.getInterp().getClassLoader()).forEach { plugin ->
+        def pluginClass = mediator.useV3d3 ? org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin : GremlinPlugin
+        ServiceLoader.load(pluginClass, shell.getInterp().getClassLoader()).forEach { plugin ->
             if (!mediator.availablePlugins.containsKey(plugin.class.name)) {
-                mediator.availablePlugins.put(plugin.class.name, new PluggedIn(plugin, shell, io, false))
+
+                if (Mediator.useV3d3) {
+                    mediator.availablePlugins.put(plugin.class.name, new PluggedIn(new PluggedIn.GremlinPluginAdapter((org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin) plugin, shell, io), shell, io, false))
+                } else {
+                    mediator.availablePlugins.put(plugin.class.name, new PluggedIn((GremlinPlugin) plugin, shell, io, false))
+                }
+
+                //mediator.availablePlugins.put(plugin.class.name, new PluggedIn(plugin, shell, io, false))
                 if (plugin.requireRestart())
                     pluginsThatNeedRestart << plugin.name
             }