Top Level Namespace

Defined Under Namespace

Modules: DebugAdapterProtocolTunnel, HMAC, PluginTool Classes: TemplateParserConfiguration

Constant Summary collapse

PLUGIN_TOOL_JRUBY_REQUIREMENT =

Make sure we use a JRuby which has been tested

'9.0.4.0'
PLUGIN_TOOL_JAVA_REQUIREMENT =
'1.8'
PLUGIN_TOOL_JAVA_REQUIREMENT_READABLE =
"at least Java 8"
PLUGIN_TOOL_ROOT_DIR =
File.expand_path(File.dirname(__FILE__)+'/..')
JS_JAR =
"#{PLUGIN_TOOL_ROOT_DIR}/lib/js.jar"
TEMPLATES_JAR =
"#{PLUGIN_TOOL_ROOT_DIR}/lib/haplo-templates.jar"
WORKSPACE_FILE =
'workspace.json'
LOCAL_ONLY_COMMANDS =
{"license-key" => true, "pack" => true, "check" => true, "new" => true, "list" => true, "extract-text" => true}
NO_DEPENDENCY_COMMANDS =
{"reset-db" => true}.merge(LOCAL_ONLY_COMMANDS)
PLUGIN_SEARCH_PATH =
['.']
PLUGIN_TOOL_COMMAND =

Handle rest of command line – first arg is the command, the rest are passed on

(ARGV.shift || 'develop')
ALL_PLUGINS =

Make plugin objects, start them, sort by order the server will load them

plugin_paths.map do |path|
  PluginTool::Plugin.new(path, options)
end

Instance Method Summary collapse

Instance Method Details

#end_on_error(err) ⇒ Object



8
9
10
11
# File 'lib/plugin_tool.rb', line 8

def end_on_error(err)
  puts err
  exit 1
end

#find_plugin_in_list(list, name) ⇒ Object



215
216
217
# File 'lib/plugin_tool.rb', line 215

def find_plugin_in_list(list, name)
  list.find { |p| p.name == name }
end

#plugins_with_dependencies(plugin_names, no_dependency = false) ⇒ Object



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/plugin_tool.rb', line 223

def plugins_with_dependencies(plugin_names, no_dependency=false)
  selected_plugins = ALL_PLUGINS.select { |plugin| plugin_names.include?(plugin.name) }
  # Attempt to resolve dependencies
  unless no_dependency
    while true
      selected_plugins_expanded = selected_plugins.dup
      selected_plugins.each do |plugin|
        plugin.depend.each do |name|
          unless name =~ /\Astd_/
            unless find_plugin_in_list(selected_plugins_expanded, name)
              add_plugin = find_plugin_in_list(ALL_PLUGINS, name)
              if add_plugin
                selected_plugins_expanded << add_plugin
              else
                puts "WARNING: Can't find dependency #{name}"
              end
            end
          end
        end
      end
      break if selected_plugins_expanded.length == selected_plugins.length
      selected_plugins = selected_plugins_expanded
    end
  end
  selected_plugins
end